xproc / Vnext

Assembly point for all issues for a next version of XProc
1 stars 0 forks source link

Serialization of XSLT results with/without disable-output-escaping #42

Open xatapult opened 10 months ago

xatapult commented 10 months ago

In the result of an XSLT stylesheet you can turn disable-output-escaping on (on <xsl:value-of.../>). Turning it on makes for instance > and < characters not to be serialized as &gt; and &lt; but as the characters themselves. This is useful if you have for instance a piece of XML in a string variable that you want serialized as XML, not as text.

However, serializing an XSLT result that uses this feature in an XProc pipeline does not retain this. Maybe we should do something about it.

ndw commented 10 months ago

I don't think disable-output-escaping is the way forward. You should be able to do it more cleanly with character maps at serialization time.

xatapult commented 10 months ago

Sure, but what if some text nodes have disable-output-escaping on and some have it off? Character maps are global...

ndw commented 10 months ago

Yeah. You have to manage things a little more carefully. But disable-output-escaping can produce data models that can't be serialized. It exists now only for backwards compatibility reasons, processors aren't required to support it.