[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Transform from UTF-8 symbol to character entity

Subject: RE: Transform from UTF-8 symbol to character entity
From: "Selvaganesh" <selvaganesh_t@xxxxxxxxxxxxxx>
Date: Sat, 16 Jan 2010 16:48:13 +0530
RE:  Transform from UTF-8 symbol to character entity
Hi David,

Thank you for the respons,

Actually I was inserted for curly quotes but that quote was changed as
straight quote (I think, we are using plain mails for xsl-list not an html
format, the plain mail not support the curly quote text, if am wrong please
correct.).

Your suggestion working fine, thank you so much.

Thanks,
Selva

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx] 
Sent: Saturday, January 16, 2010 3:58 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Transform from UTF-8 symbol to character entity


If you use html output then (most likely) these will happen
automatically, for xml output then are you sure you want to do this (it
will make your output not well formed unless you also reference a DTD
that defines the entities)

I assume your input is not exactly as you show as you showed
ascii " being converted to both ldquo and rdquo and asci - being
converted to both ndash and mdash.

Assuming you are using xslt 2 the simplest way to do this is to use a
character map, you appear to be using the standard iso/html entity names
so I assume (despite the examples you gave) that you want the usual
definitions. A character map that does the right thing is avaiablable at

http://www.w3.org/2003/entities/2007/entitynamesmap.xsl


so you can use

<xsl:import
href="http://www.w3.org/2003/entities/2007/entitynamesmap.xsl"/>

<xsl:output use-character-maps="w3c-entity-names"/>

or better, take a local copy of the files in that directory and
reference the local copy.


However for most purposes it is better to use numeric chharacter
references rather than character names, in which case you just need to
specify an encoding that does not include these characters, and they
will be encoded as numeric references

<xsl:output encoding="US-ASCII"/>

for example.

David



Confidentiality Notice:  This transmittal is a confidential communication.  If you are not the intended recipient, you are hereby notified that you have received this transmittal in error and that any review, dissemination, distribution or copying of this transmittal is strictly prohibited.  If you have received this communication in error, please notify this office immediately by reply and immediately delete this message and all of its attachments, if any.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.