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: "Eliot Kimber ekimber@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Oct 2019 18:32:21 -0000
Yes, I was just generating literal strings for the markup--it didn't occur to
me to generate a new XML tree, but that would almost certainly do what I want
(and be easier to boot).



Eliot Kimber

o;?On 10/17/19, 12:16 PM, "Michael Kay mike@xxxxxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

    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

    What happens to the message after that is entirely under application

    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

    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

    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.


    Eliot Kimber

    XSL-List info and archive
    (by email <>)

Current Thread