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

semi-newbie question about escaping

Subject: semi-newbie question about escaping
From: Bob Purvy <bpurvy@xxxxxxxxxxxxx>
Date: Mon, 14 Oct 2002 18:20:13 -0700
purvy
The goal here was to output some non-breaking space entities in HTML (&nbsp;) to denote indentation.

So how come this sort of thing works:

   <xsl:choose>
       <xsl:when test='$level=1'>
       <xsl:text> &lt; </xsl:text>
       </xsl:when>
       <xsl:when test='$level=2'>
       <xsl:text> &lt;&lt;   </xsl:text>
       </xsl:when>
   </xsl:choose>

but this doesn't?

    <xsl:choose>
       <xsl:when test='$level=1'>
       <xsl:text disable-output-escaping="yes"> &nbsp; </xsl:text>
       </xsl:when>
       <xsl:when test='$level=2'>
       <xsl:text disable-output-escaping="yes"> &nbsp;&nbsp; </xsl:text>
       </xsl:when>
   </xsl:choose>

I get an error "entity 'nbsp' not found". I tried all sorts of combinations, including not having the <xsl:text> tags at all. Leaving out "disable-output-escaping" also didn't help. I'm using Xalan, if it matters, and my output-method is "html".


I finally got it to do what I wanted, thus:


<xsl:choose>
<xsl:when test='$level=1'>
<xsl:text disable-output-escaping="yes"> &#x26;nbsp;</xsl:text>
</xsl:when>
<xsl:when test='$level=2'>
<xsl:text disable-output-escaping="yes"> &#x26;nbsp;&#x26;nbsp;</xsl:text>
</xsl:when>
</xsl:choose>


but I'm wondering if there isn't some easier way? Thanks




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.