Trying one more time -- since part of it got eaten.. I think I forgot
to switch to plain text.. Doh!
The primer I used to build the internal DTD can be found here:
http://www.w3schools.com/dtd/dtd_intro.asp
-------------------------------------------------------------------------------------------------------
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) :
<?xml version="1.0"?>
<!DOCTYPE identity [
<!ELEMENT identity (name1, name2, name3)>
<!ELEMENT name1(#PCDATA)>
<!ELEMENT name2(#PCDATA)>
<!ELEMENT name3(#PCDATA)>
]>
<identity>
<name1>foo</name1>
<name2>bar</name2>
<name3>baz</name3>
</identity>
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.
_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk