That did it, thank you so much Martin for the help.
Cheers,
Spencer
On Mon, Dec 18, 2017 at 2:13 PM, Martin Honnen martin.honnen@xxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On 18.12.2017 21:18, Spencer Tickner spencertickner@xxxxxxxxx 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:
>>
>> input:
>>
>> <?xml version="1.0"?>
>> <root xmlns:bcl="http://bcl">
>> <?pi a="<bcl:e>Test</bcl:e>" ?>
>> </root>
>>
>
> A PI does not contain parsed character data so your data is double escaped.
>
> Does
>
>
> <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>
> </xsl:template>
>
>
> 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
|