Re: [xsl] XSLT 3: Possible to Get Unescaped Markup in Message Results?

Subject: Re: [xsl] XSLT 3: Possible to Get Unescaped Markup in Message Results?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Oct 2019 17:15:57 -0000
According to the spec, a message produced by xsl:message is an XML document.
Saxon passes this document to the callback

MessageListener2.message(XdmNode content, QName errorCode, boolean terminate,
SourceLocator locator)
where content is the XML document, errorCode is the requested error code on
xsl:message, terminate indicates whether terminate=yes was requested, and
locator idenfies the originating xsl:message instruction.

What happens to the message after that is entirely under application control.

When you say you are generating formatted markup, I assume this means you are
generating text nodes containing angle brackets in their content (rather than
generating a tree of nodes).

You could of course write a MessageListener that simply outputs the string
value of the supplied message document, in which case there would be no
escaping applied. But it looks as if that's not what oXygen is doing.

Michael Kay
Saxonica

> On 17 Oct 2019, at 17:21, Eliot Kimber ekimber@xxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> This may be a Saxon-specific question but I thought I would start here.
>
> Using Saxon 9.9 and XSLT 3, I want to emit nicely-formatted XML markup in my
messages where the base markup has lots of noise I don't want to see (in this
case Office Open XML which is oversupplied with namespace declarations and
lots of little elements with lots of attributes.
>
> I wrote some templates to generate the formatted markup I want but the
<xsl:message> o;?result has all the angle brackets escaped (I'm running from
within Oxygen but I assume the result would be the same from the command
line).
>
> Is there a standard way around this? If not, is there a Saxon-specific way
around it?
>
> I tried capturing the markup to a variable and then using xsl:text with
disable-output-escaping="yes" but that didn't seem to work.
>
> Thanks,
>
> Eliot
> --
> Eliot Kimber
> http://contrext.com

Current Thread