Learning more about YAXO
yampa at mindspring.com
yampa at mindspring.com
Sat Nov 16 07:08:03 UTC 2002
> An example line in my (better: Christian
> Langreiter's) code:
>
> ((xmldoc entityAt: 'methodResponse') entities
> at: 1) key = 'fault'
>
> xmldoc is an instance of XMLDocument. The
> XMLParser I used (don't know
> where it came from :-) answered to #entityAt:
> with an
> XMLNodeWithElements. The answer to "#entities"
> is a OrderedCollection, I
> think, with (#entityName -> allContainingData).
> So
> c would be made to: ((a -> (b -> c)) (b -> c)).
> Does
> anyone have these and know where they came from
> (maybe VWXML?)
>
> Regards, Markus
>
>
>
>
In YAXO you need to have a reference to the root entity of the document,
instead of the XMLDocument itself. Paste the following into a workspace so
you can try it and
inspect it.
---------------------------------------------
| xmlDoc |
xmlDoc := XMLViewSpecParser fromString: '
Buttercup
Ranunculus
4
Shade
$2.57
061099
California Poppy
Eschscholzia californica
Annual
Sun
$7.89
032799
'.
"------Try these one at a time--------------------------"
"To get the document root:"
^xmlDoc topElement "<- I THINK THIS IS WHAT YOU ARE MISSING"
"To get entities:"
" ^xmlDoc topElement entityAt: 'PLANT'"
"To get a collection of entities:"
" ^xmlDoc topElement entities"
"To get attributes: (this document doesn't have any):"
" ^xmlDoc topElement attributeAt: ''"
More information about the Squeak-dev
mailing list
|