I am trying to pass a piece of XMLthat has escaped characters e.g >
into a new piece of XML. However when I pass it I don't want these
characters escaped and want them to appear in the XML.
Any ideas on how to do this.
FAQ.
You're essentially asking for a way to re-parse something that was
designated character data in your XML as if it were actually elements and
other markup. If you want it to be treated as markup, don't put it in your
original XML as character data. Fix the problem at it's source.
If you cannot fix the XML, then check your XSLT processor's docs for an
extension function that can parse an arbitrary string and return a node-set
or result tree fragment. If there isn't one, then write your own. You'll
probably need to wrap the string in a dummy element to ensure it's a
well-formed document entity before you send it to the parser.
In a controlled environment you may be able to rely on the kludgy
disable-output-escaping="yes" on xsl:value-of or xsl:text. It's not
guaranteed to work if the XSLT processor is not in direct control of the
serializer, if any (e.g. the processor may actually output a DOM object,
thus rendering d-o-e ineffective... Netscape/Mozilla comes to mind).