[XML-SIG] producing large XML files

Martin v. Loewis martin@v.loewis.de
19 Sep 2002 20:51:31 +0200


J=FCrgen Schmidt <scjuonline@web.de> writes:

> Ok.=20
> Here is what I've tried:

I see. Let me take back my earlier statement: XmlWriter is *not*
current, anymore, as it is a SAX1 application; we encourage users to
use SAX2 these days. The mostly-equivalent SAX2 class is
xml.sax.saxlib.XMLGenerator or xml.sax.saxlib.LexicalXMLGenerator
(in your case, you need the LexicalXMLGenerator).

That said, XmlWriter ought to work. Feel free to submit bug reports at
sf.net/projects/pyxml. If you can, patches would be even better.

> lw.characters("Hallo",0,len("Hallo"))

In SAX2, this becomes

lw.characters("Hallo")

> # lw.handle_cdata("<b>das ist html<b>")
[...]
> # but shouldn't the data appear without escaping?

Right, that's a bug. In SAX2, it becomes

lw.startCDATA()
lw.characters("<b>das ist html<b>")
lw.endCDATA()

> # lw.comment("great",0,len("great"))
> # if you uncomment this, the comment won't show up (in the xml ;-)

That's a bug; it works in the LexicalXMLGenerator.

> # Is my function call wrong?

Your call is right. It is a bug, and works in the LexicalXMLGenerator.

Do you really need to output PIs and comments in your application, or
was that just for testing purposes?

Regards,
Martin