[xml] serializing dtd nodes (python)


I'm using libxml2 (2.5.7) to parse a DTD. When I try to serialize it
back I get None unless I create a new document (completely unrelated
to the dtd node) before doing so. That's weird.  

The following script demonstrates the problem. DTD is passed on the
command line. I used test/valid/t4a.dtd from the libxml2 distro.

Am I doing something completelly wrong or is it a bug? Thanks,


import sys
import libxml2

dtd = libxml2.parseDTD('foo', sys.argv[1])
#doc = libxml2.newDoc('1.0') # uncomment to make serialize work

print dtd.serialize()


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