XML Tree

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

XML Tree

sellossa
hello,

Thank you for your answers. But this is not really what I want to do :)

Indeed, I want to create a node for each XML entity.
The methods you told me just return a DocumentType with a root that
containt the whole xml file!
Any idea how to populate the DocumentType.nodes? Or maybe there is an
other object that I should use?

Thank you for your help

Sara

Reply | Threaded
Open this post in threaded view
|

Re: XML Tree

jarober
The document contains nodes - you can walk them.  I do just that to
deal with RSS/Atom feeds in BottomFeeder

At 11:05 AM 4/25/2007, you wrote:

>hello,
>
>Thank you for your answers. But this is not really what I want to do :)
>
>Indeed, I want to create a node for each XML entity.
>The methods you told me just return a DocumentType with a root that
>containt the whole xml file!
>Any idea how to populate the DocumentType.nodes? Or maybe there is an
>other object that I should use?
>
>Thank you for your help
>
>Sara

<Talk Small and Carry a Big Class Library>
James Robertson, Product Manager, Cincom Smalltalk
http://www.cincomsmalltalk.com/blog/blogView

Reply | Threaded
Open this post in threaded view
|

Re: XML Tree

Janko Mivšek
In reply to this post by sellossa
Sara,

You actually got a tree od such nodes. Root is only a root node,
containing all others as children, and children of children etc.

Then you can access those nodes with methods, like in these examples:

        (doc root anyElementNamed: 'bpmn') elementsNamed: 'attribute')
        (each attributeNamed: 'type' ifAbsent: ['']) value.
etc ..

JAnko

[hidden email] wrote:

> hello,
>
> Thank you for your answers. But this is not really what I want to do :)
>
> Indeed, I want to create a node for each XML entity.
> The methods you told me just return a DocumentType with a root that
> containt the whole xml file!
> Any idea how to populate the DocumentType.nodes? Or maybe there is an
> other object that I should use?
>
> Thank you for your help
>
> Sara
>
>

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si