xsl-list
[Top] [All Lists]

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

2019-10-17 13:32:25
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).

Cheers,

E.

--
Eliot Kimber
http://contrext.com
 

On 10/17/19, 12:16 PM, "Michael Kay mike(_at_)saxonica(_dot_)com" 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> 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 
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(_at_)contrext(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> 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> 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
    
    
    
    
    
    
    
    
    
    XSL-List info and archive 
<http://www.mulberrytech.com/xsl/xsl-list>EasyUnsubscribe 
<http://lists.mulberrytech.com/unsub/xsl-list/1278982>
    (by email <>)
    
    
    
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>