On Tuesday, January 21, 2003, at 12:10 AM, Mathieu MANGEOT-LEREBOURS
wrote:
Everything works fine except when I want to add html entities in my
XSL stylesheet:
<xsl:stylesheet version="1.0" ... >
<xsl:output method="html" encoding="utf-8" indent="yes"/">
<xsl:template match="/">
<xsl:text>⌈</xsl:text>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylessheet>
This is a fairly basic XML question. (It's the equivalent of asking why
you get "undefined variable" errors in Java when you don't declare your
variables.)
Nowhere in your stylesheet have you defined the entity ⌈ -- so
how is the XML processor supposed to know what it means? You either
need to define those entities, use numeric entities instead, or use the
UTF-8 value that the entity represents.
There's DTDs for the (X)HTML entities at section A.2 in
http://www.w3.org/TR/xhtml1/ -- so you don't have to try to define them
all yourself. (Often it's simpler to manually look up the entity in the
entity sets and use the numeric entity, rather than hooking the DTD
into your stylesheet. So you could use ⌈ instead of ⌈ in
the above code without needing to change anything else.)
--Bill
|