[Top][All Lists]
[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:00:04 -0700 |
User-agent: |
Apple Webmail/0.6 |
Nevermind.. I found that if I changed #processDocumentStream: to
#parse: that it works fine.. I searched the archives the other day but
didn't notice one post from someone else using that method..
So, for
completeness for anyone that might come after me here's the scoop :
With this XML file (for example) :
]>
foo
bar
baz
You can then use
this code to read & parse it :
[PackageLoader fileInPackage: #XML] on:
Error do: [:ex | ex return].
...
| stream |
stream :=
'./identity.xml' asFile readStream.
parser := XML.XMLParser new.
parser validate: false.
parser parse: stream.