diff options
author | Thorsten Behrens <tbehrens@novell.com> | 2010-05-26 11:15:16 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2010-05-26 11:15:16 +0200 |
commit | aab9cd288fb23e5c4edfa66ed87cee0a3df3f1c7 (patch) | |
tree | 7059f5f0a84bf7dece4c0b41ebe13a56bc2e31f5 | |
parent | 8de3f3b99a1ec20cb9fc690694ba4d76fb7e8d5e (diff) |
Fix bug in processingInstruction handling, elaborate on
roundtripping losses.
-rw-r--r-- | README | 6 | ||||
-rwxr-xr-x | xml2pyx.py | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -81,6 +81,12 @@ Converting that back to xml via "pyx2xml -ns" yields this: You notice that the conversion is not lossless in terms of octets produced, but should reasonably faithfully conserve the xml info set. +One noticeable gap is the fact that conforming sax parsers will not +report the xml prologue, so this is not converted to pyx, instead +regenerated from scratch inside pyx2xml.py and thus loosing e.g. extra +standalone attributes etc. + + INVOKING ======== @@ -47,8 +47,8 @@ class PyxConverter (xml.sax.handler.ContentHandler): def characters (self, content): print "-%s" % self.encode(content) - def processingInstruction (self, data): - print "?%s" % self.encode(data) + def processingInstruction (self, target, data): + print "?%s %s" % (target, self.encode(data)) if __name__ == "__main__": import sys |