[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[XSL] How to display special characters in a xsl:messa

Subject: [XSL] How to display special characters in a xsl:message
From: Alain <alainb06@xxxxxxx>
Date: Sat, 20 Oct 2007 15:33:32 +0200
 [XSL] How to display special characters in a xsl:messa
Hello XSL List members,

I would like to display characters in a message (eq. through xsl:message) on the MS-DOS console such as : > (superior, ascii 0x3E)

I tried that :

XSL file :
===================================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="msg" select="'>'"/>
<xsl:message><xsl:value-of select="$msg"/></xsl:message>
<xsl:message><xsl:value-of disable-output-escaping="yes" select="$msg"/></xsl:message>
<xsl:message><xsl:value-of disable-output-escaping="no" select="$msg"/></xsl:message>
<xsl:message><xsl:text>></xsl:text></xsl:message>
<xsl:message><xsl:text disable-output-escaping="yes">></xsl:text></xsl:message>
<xsl:message><xsl:text disable-output-escaping="no">></xsl:text></xsl:message>
<xsl:message><![CDATA[>]]></xsl:message>


<xsl:variable name="msg2" select="'&gt;'"/>
<xsl:message><xsl:value-of select="$msg2"/></xsl:message>
<xsl:message><xsl:value-of disable-output-escaping="yes" select="$msg2"/></xsl:message>
<xsl:message><xsl:value-of disable-output-escaping="no" select="$msg2"/></xsl:message>
<xsl:message><xsl:text>&gt;</xsl:text></xsl:message>
<xsl:message><xsl:text disable-output-escaping="yes">&gt;</xsl:text></xsl:message>
<xsl:message><xsl:text disable-output-escaping="no">&gt;</xsl:text></xsl:message>
<xsl:message><![CDATA[&gt;]]></xsl:message>
</xsl:template>
</xsl:stylesheet>



XML File =================================================== Any valid XML file


Output : Saxon 8.9J =================================================== &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &amp;gt;

Xalan1.10
===================================================
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: > (...)
XSLT Message: &gt; (...)


==================================================
Although chapter 4.7 of XSLT2.0 norm says that disable-output-escaping is deprecated and not REQUIRED to be compliant, I would like to be able to have the character '>' in the strings output by xsl:message.
Xalan looks right to me, as xsl:message are used for debug purpose, or to be nice to the user and tell him what's happening when things can be a little time consuming. So outputting a '>' through xsl:message has little chance of disrupting anything.
Although I prefer Saxon method that displays only what is in the xsl:message (and no other string I didn't ask as Xalan does) I can't make it output a '>'


But I can't stick with Xalan because I need XSLT2.0 features to generated my site.

The XSLT2.0 norm does also says that the feature disable-output-escaping is deprecated has been replaced by character-map. But character-map looks "global" to me (it seams to apply at the xsl:output level), and I want this "no-escaping" only on some xsl:message, and not on my regular output which should be properly escaped when needed.
For the same reason, I cannot make my output method="text" (which has better chances of not escaping!) because I need XHTML or HTML as regular output.


Any idea of how to get '>' (or any character XSL will escape) on the MS-DOS console as xsl:message result with Saxon8.9 (without un-escaping '>' everywhere on my regular output) ?

Regards.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.