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

Re: Entities Conversion

Subject: Re: Entities Conversion
From: Tony Graham <Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 May 2007 13:25:18 +0100
Re:  Entities Conversion
On Sat, May 26 2007 23:39:12 +0100, Abel Braaksma wrote:
> J. S. Rawat wrote:
...
>> DESIRED OUTPUT
>> &ldquo; &rdquo; &ndash; &mdash;
>
> there's a way to get this in XSLT 2.0 using character-sets, but it is
> usually not the way to go as you will invalidate your xml.

...unless your output includes (or is included as an external general
parsed entity in a document that includes) the DOCTYPE declaration for
a DTD that defines those entities.

It's generally not necessary to turn the characters back into entity
references since your XML parser will turn them back into characters
again anyway when you come to parse your XML.

About the only use that I can see for turning the characters back into
entities is if you both need to eyeball the XML and it would make more
sense to you if you saw named entity references rather than numeric
references.

If you want to, your stylesheet can import a set of XSLT 2.0 character
maps for the ISO entity sets that can be downloaded from
http://www.w3.org/2003/entities/iso8879doc/overview.html.

While DTDs sometimes map multiple different ISO entities to
the same numeric entity reference, these character maps can only
convert a character back to a single entity reference.  If you use
these character maps, you might particularly look at the mappings to
'rsquor' and 'rdquor' in the ISOpub mapping since you may want 'rsquo'
and 'rdquo' instead.

Regards,


Tony Graham.
======================================================================
Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
----------------------------------------------------------------------
Menteith Consulting -- Understanding markup
======================================================================

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.