[XML-SIG] Multiple top nodes

richard@iopen.co.nz richard@iopen.co.nz
Wed, 1 Nov 2000 01:07:34 +1300 (NZDT)


Greetings -

Recently I installed PyXML 0.6.1, having previously been using 0.5.2. I
had an XML parser written with 0.5.2 which took an XML document with
multiple top nodes and created DOM from it (ie. it created a
DocumentFragment that wasn't well formed XML).

eg. a file of xml snippets -
---

<sometag><somenestedtag/></sometag>

<sometag><somenestedtag/></sometag>

<sometag><somenestedtag/></sometag>

<sometag><somenestedtag/></sometag>

---

to do this in 0.5.2 I had a pretty simple fragment of code such as -

---

parser=saxexts.make_parser()
dh=SaxBuilder()
dh.buildFragment()
parser.setDocumentHandler(snippetFile)
parser.parse(snippetfile)

---

which worked great. I'm having exactly 0 luck getting the same sort of
thing to work with 0.6.1. The key in this case was using a DocumentHandler
that stuffed the DOM into a DocumentFragment, not a Document (which must
be well formed).

Anyway, to get to the point, could someone please give me a pointer to do
the same with 0.6.1? I'm sure that it is as simple (or at least close) in
0.6.1, but I'm probably missing the obvious.

Regards,

Richard Waid
Network/Software Engineer
iOpen Technologies Ltd.