List Info

Thread: Re: How to add encoding property in xml document




Re: How to add encoding property in xml document
country flaguser name
United Kingdom
2007-02-07 07:17:09
Hi Sai Reddy,

I don't know too much about the C implementation, but in the
Python examples (serialize.py) he uses the encoding as a
parameter to the serialize method...

doc =
libxml2.parseDoc("""<root><foo>he
llo</foo></root>""")
str = doc.serialize()
if str != """<?xml
version="1.0"?>
<root><foo>hello</foo></root>
""":
   print "error serializing XML document 1"
   sys.exit(1)
str = doc.serialize("iso-8859-1")
if str != """<?xml version="1.0"
encoding="iso-8859-1"?>
<root><foo>hello</foo></root>
""":
   print "error serializing XML document 2"
   sys.exit(1)


any help?

Cheers
Mike
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )