Subject: Re: [xsl] XSLT 3: Possible to Get Unescaped Markup in Message Results? From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 17 Oct 2019 16:36:58 -0000 |
To continue, if the XML is already serialized as a good-looking string, then it just needs to be re-parsed (use the standard parse-xml() orparse-xml-fragment() function) and the result of this parse is what should be output with <xsl:message> Cheers, Dimitre On Thu, Oct 17, 2019 at 9:32 AM Dimitre Novatchev dnovatchev@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > wrote some templates to generate the formatted markup I want but the > <xsl:message> o;?result has all the angle brackets escaped > > I don't see what is the problem... > > Even with XSLT 2.0, given this XML document: > > <t/> > > And this transformation: > > <xsl:stylesheet version="1.0" xmlns:xsl=" > http://www.w3.org/1999/XSL/Transform"> > <xsl:output omit-xml-declaration="yes" indent="yes"/> > > <xsl:template match="/*"> > <xsl:message select="."/> > </xsl:template> > </xsl:stylesheet> > > I get the output of <xsl:message> exactly as wanted: > > Saxon 9.1.0.1J from Saxonica > Java version 1.8.0_191 > Warning: at xsl:stylesheet on line 1 column 80 of marrowtr.xsl: > Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor > Stylesheet compilation time: 137 milliseconds > Processing file:/C:/Program%20Files/Java/jre1.8.0_191/bin/marrowtr.xml > Building tree for > file:/C:/Program%20Files/Java/jre1.8.0_191/bin/marrowtr.xml using class > net.sf.saxon.tinytree.TinyBuilder > Tree built in 1 milliseconds > Tree size: 3 nodes, 0 characters, 0 attributes > Loading net.sf.saxon.event.MessageEmitter > <t/> > Execution time: 16 milliseconds > Memory used: 16171704 > NamePool contents: 12 entries in 12 chains. 6 prefixes, 6 URIs > > Cheers, > Dimitre > > On Thu, Oct 17, 2019 at 9:21 AM 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 >> >> >> > XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> > EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/782854> (by > email <>)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT 3: Possible to Get U, Dimitre Novatchev dn | Thread | Re: [xsl] XSLT 3: Possible to Get U, Michael Kay mike@xxx |
Re: [xsl] XSLT 3: Possible to Get U, Dimitre Novatchev dn | Date | Re: [xsl] Does XQuery allow you to , Adam Retter adam.ret |
Month |