← Prev in month ← Prev in thread

how to output HTML entities?

From
Sam Steingold <>
Date
2004-11-17T22:02:07+00:00
ID
Thread
how to output HTML entities?
I want <computeroutput> inside <programlisting> to be preceded with a
double right arrow (XHTML &rArr;) and a space for the first such element
and 3 spaces for all following elements.

here is my attempt:

<xsl:template match="programlisting/computeroutput">
 <xsl:choose>
  <xsl:when test="previous-sibling::computeroutput()">
   <xsl:text>&rArr;&nbsp;</xsl:text></xsl:when>
  <xsl:otherwise><xsl:text>&nbsp;&nbsp;&nbsp;</xsl:text>
 </xsl:otherwise></xsl:choose>
 <xsl:apply-imports/>
</xsl:template>

here is what I get:

common.xsl:63: parser error : Entity 'rArr' not defined
   <xsl:text>&rArr;&nbsp;</xsl:text></xsl:when>
                   ^
common.xsl:63: parser error : Entity 'nbsp' not defined
   <xsl:text>&rArr;&nbsp;</xsl:text></xsl:when>
                         ^
common.xsl:64: parser error : Entity 'nbsp' not defined
  <xsl:otherwise><xsl:text>&nbsp;&nbsp;&nbsp;</xsl:text>
                                 ^
common.xsl:64: parser error : Entity 'nbsp' not defined
  <xsl:otherwise><xsl:text>&nbsp;&nbsp;&nbsp;</xsl:text>
                                       ^
common.xsl:64: parser error : Entity 'nbsp' not defined
  <xsl:otherwise><xsl:text>&nbsp;&nbsp;&nbsp;</xsl:text>
                                             ^

when I replace "&rArr;" with "&amp;rArr;", the XHTML output contains
"&amp;rArr;" which is not what I want.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Diplomacy is the art of saying "nice doggy" until you can find a rock.
← Prev in month ← Prev in thread