[Home] [By Thread] [By Date] [Recent Entries]
Michael Kay schrieb:
Does anyone know of a tool that parses an XML document and outputs it as ASCII replacing characters with named entities instead of numeric entites? Named entites you'd probably have to supply yourself?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output use-character-maps="Zeichen"/>
<xsl:character-map name="Zeichen" use-character-maps="Umlaute-und-_">
<xsl:output-character character=" " string="&nbsp;"/>
</xsl:character-map>
<xsl:character-map name="Umlaute-und-_">
<xsl:output-character character="Ä" string="&Auml;"/><!--D-->
<xsl:output-character character="Ö" string="&Ouml;"/><!--V-->
<xsl:output-character character="Ü" string="&Uuml;"/><!--\-->
<xsl:output-character character="ß" string="&szlig;"/><!--_-->
<xsl:output-character character="ä" string="&auml;"/><!--d-->
<xsl:output-character character="ö" string="&ouml;"/><!--v-->
<xsl:output-character character="ü" string="&uuml;"/><!--|-->
</xsl:character-map>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:transform>I had my employer buy a copy of the 4th edition of your XSLT 2.0 and XPath 2.0 reference. I used it to read up on character references and are very pleased with both the contents and the page-number-annotated cross-references. I haven't read more yet, but I'm sure this is as excellent a book as many people on this list have pointed out. Thanks! Michael Ludwig
|

Cart



