help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Help with reading/parsing an XML file in GST 3.2


From: Rick Flower
Subject: Re: [Help-smalltalk] Help with reading/parsing an XML file in GST 3.2
Date: Wed, 05 Sep 2012 08:56:30 -0700
User-agent: Apple Webmail/0.6

On 05.09.2012 08:16, Rick Flower wrote:

...
stream := './identity.xml' asFile readStream.
parser := XML.XMLParser new.
parser validate: false.
parser parse: stream.

For those like me that stumbled around a bit more on the XML parsing, once you've got a parser object that is good to go, you can access the docroot and associated items (as mentioned on the help page entitled "Building a DOM from XML") using the
following snippet :

doc := parser document

Once you have that you can get the items of interest as mentioned earlier :

item1 := (doc root elementNamed: 'foo') characterData.

Seems to work OK! I now believe I'm good to go.. Hopefully this helped someone else
besides me.. :-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]