Martin v. Löwis wrote:
Irmen de Jong wrote:

The unescaping is usually done for you by the xml parser that you use.


Usually, but not in this case. If you have a text that looks like
XML, and you want to put it into an XML element, the XML file uses
&lt; and &gt;. The XML parser unescapes that as < and >. However, it
does not then consider the < and > as markup, and it shouldn't.

That's also what I said?

The unescaping of the XML entities in the contents of the OP's
<string> element is done for you by the parser,
so you will get a text node with the <,>,&,whatever in there.
The OP probably wants to feed that to a new xml parser instance
to process it as markup.
Or perhaps the way the original XML document is constructed is
flawed.

--Irmen
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to