[Top] [All Lists]

Re: [xsl] Using saxon:parse on processing instructions

2017-12-18 16:13:29
On 18.12.2017 21:18, Spencer Tickner spencertickner(_at_)gmail(_dot_)com wrote:
Hello and thanks in advance for the help. I'm scratching my head on trying to convert a string of serialized xml in a processing instruction back into XML.

I'm restricted to XSLT 2.0 and am using Saxon 9.1. When I treat the simply copy and past the xml into the stylesheet everything works (see variable $s2), but when breaking the string out of the processing instruction the elements remain serialized:


<?xml version="1.0"?>
<root xmlns:bcl="http://bcl";>
<?pi a="&lt;bcl:e&gt;Test&lt;/bcl:e&gt;" ?>

A PI does not contain parsed character data so your data is double escaped.


        <xsl:template match="processing-instruction('pi')">
<root xmlns:bcl="http://example.com/bcl";><xsl:value-of select="saxon:get-pseudo-attribute('a')" disable-output-escaping="yes"/></root>

work with your version of Saxon?

With Saxon 9.7 PE that gives

        <root xmlns:bcl="http://example.com/bcl";><bcl:e>Test</bcl:e></root>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>