|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: special characters
Hi, > how can you make special characters(like é) appairs in a text > output file in xsl encoding? I thought I'd take this opportunity to describe one of the new features in XSLT 2.0 -- the ability to map characters in text nodes and attribute values during output onto arbitrary strings. This is done through a "character map". To say that é should be output as é, for example, you can create a character map as follows: <xsl:character-map name="latin-1"> <xsl:output-character character="é" string="&eacute;" /> </xsl:character-map> and reference this character map from your output definition: <xsl:output use-character-maps="latin-1" /> When the result tree is output, every occurrence of é, in text or in attribute values, will be replaced by the string é. Note that this will work for é characters that get into the output from being part of the source document as well as the é characters that you use in your stylesheet. It also does the replacement in attribute values as well as text nodes. In both ways it's more powerful than d-o-e. Of course that might mean that your output is not well-formed, because there's no guarantee that the output has an entity declaration for the é entity, so you should usually specify a doctype-system so that the output includes a DOCTYPE declaration that contains the relevant entity declaration. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








