June 2008
Intermediate to advanced
986 pages
27h 8m
English
[2.0]
<xsl:output-character>
Defines a symbol and a string that should replace it.
This is similar to an XML <!ENTITY> declaration.
Declaration (this is effectively part of the <xsl:character-map> element).
characterThe character to be replaced.
stringThe string that replaces the character.
None.
None. <xsl:output-character> is an empty
element.
The <xsl:character-map>
element.
XSLT section 20, “Serialization.”
We’ll repeat a small section of our example from the description
of the <xsl:character-map> element.
Here is a stylesheet that replaces two circled number characters
(Unicode code points ૜
and ૝) with
graphics:
<?xml version="1.0" encoding="utf-8"?> <!-- character-map2.xsl --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" use-character-maps="circles"/> <xsl:character-map name="circles"> <xsl:output-character character="➀" string="<img src='images/circle1.gif' width='28' height='28'/>"/> <xsl:output-character character="➁" string="<img src='images/circle2.gif' width='28' height='28'/>"/> </xsl:character-map> <xsl:template match="char-test"> <html> <head> <title>A test of some special characters</title> </head> <body style="font-family: sans-serif;"> <h1>A test of some special characters</h1> <xsl:apply-templates select="*"/> </body> </html> </xsl:template> <xsl:template match="special-char"> <p ...
Read now
Unlock full access