[xml] Dumping documents with substituted entities



If I parse a simple XML document in Python and dump it using serializeNode(), 
many special characters are output as entities. Example:

  import libxml2mod

  dom = libxml2mod.xmlParseDoc("""<test>"text"</test>""")
  print "Raw document:\n%s" % libxml2mod.serializeNode(dom, 'iso-8859-1', 1)

This program outputs:

Raw document:
<?xml version="1.0" encoding="iso-8859-1"?>
<test>&quot;text&quot;</test>

How do I make it output the document as:

<test>"text"</test>

What I need to do is to generate some JavaScript code via XML/XSLT in which 
quotes are essential. Alså I may need to generate some plain-text XSLT output 
in which I don't want entities.

regards, Jørgen



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