XML tree

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

XML tree

sellossa
Hello,

I want to know if there is a method in VW that is able to return an XML
tree from an XML file.
I have checked in the XML parser but I was rapidly lost :)
Thanks

Sara

Reply | Threaded
Open this post in threaded view
|

Re: XML tree

Janko Mivšek
Salut Sara,

Here is a simple example of parsing a XML file in VW:

        | parser doc|
        parser := XML.XMLParser new. parser validate: false.
        doc := parser parse: 'file.xml' asFilename readStream.
        ^doc

Best regards
Janko


[hidden email] wrote:

> Hello,
>
> I want to know if there is a method in VW that is able to return an XML
> tree from an XML file.
> I have checked in the XML parser but I was rapidly lost :)
> Thanks
>
> Sara
>
>

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

Reply | Threaded
Open this post in threaded view
|

RE: XML tree

Terry Raymond
In reply to this post by sellossa
Sara

Try

XML.XMLParser new parseElement: 'filename'

Terry
 
===========================================================
Terry Raymond       Smalltalk Professional Debug Package
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Wednesday, April 25, 2007 9:24 AM
> To: [hidden email]
> Subject: XML tree
>
> Hello,
>
> I want to know if there is a method in VW that is able to return an XML
> tree from an XML file.
> I have checked in the XML parser but I was rapidly lost :)
> Thanks
>
> Sara

Reply | Threaded
Open this post in threaded view
|

Re: XML tree

jarober
In reply to this post by sellossa
         parser := XMLParser new.
         parser validate: false.
         ^parser parse: someXMLString readStream.

where someXMLString is the XML content - in the snippet above, either
grabbed via HTTP, file read, whatever.  You'll get an XML Document object

At 09:24 AM 4/25/2007, you wrote:
>Hello,
>
>I want to know if there is a method in VW that is able to return an XML
>tree from an XML file.
>I have checked in the XML parser but I was rapidly lost :)
>Thanks
>
>Sara

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