summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2010-05-26 11:15:16 +0200
committerThorsten Behrens <tbehrens@novell.com>2010-05-26 11:15:16 +0200
commitaab9cd288fb23e5c4edfa66ed87cee0a3df3f1c7 (patch)
tree7059f5f0a84bf7dece4c0b41ebe13a56bc2e31f5
parent8de3f3b99a1ec20cb9fc690694ba4d76fb7e8d5e (diff)
Fix bug in processingInstruction handling, elaborate on
roundtripping losses.
-rw-r--r--README6
-rwxr-xr-xxml2pyx.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/README b/README
index 48afc09..1e26589 100644
--- a/README
+++ b/README
@@ -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
========
diff --git a/xml2pyx.py b/xml2pyx.py
index 4b16bac..06850e9 100755
--- a/xml2pyx.py
+++ b/xml2pyx.py
@@ -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