xsltsaxonxmlspy

XSL disable-output-escaping XML SPY vs SAXON


I need help with my XSLT.

I have an XML with encoded HTML tags with a tag:

input code

Using XmlSpy (Altova) this DOES work:

'<xsl:value-of select="de" disable-output-escaping="yes"/>'

which returns html tags within the data tag.

But executing this XSL on SAXON does not work. The XSL is executed and returns output, but the output-escaping seems to be ignored.

Any ideas?


Solution

  • The key thing to remember is that disable-output-escaping is an instruction to the serializer, and it has no effect unless the XSLT processor is serializing the output. The most common reason for it "not working" is that the transformation output is going to a destination other than the serializer (for example, a DOM tree). So we need to know how you are running the transformation.

    Also related to this, there have been changes to the spec regarding what happens if you use disable-output-escaping while writing to a temporary tree (that is, to a variable).

    Processors are allowed to ignore disable-output-escaping entirely, but Saxon doesn't do that, except of course when the output isn't serialized. (That's because "escaping" is a serialization thing, and if you're not serializing, then you're not escaping anything, so there is nothing to disable).