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

Re: recognize character entities

Subject: Re: recognize character entities
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 29 Aug 2006 18:06:09 +0100
re recognize
> Is it in the spirit of XML to let the parser expand the entity
> references back to themselves? For example, in the above situation, is
> this a reasonable thing to do: 

  <!ENTITY euro "&amp;euro;">

It might be (but probably isn't:-) But that isn't making teh entity
reference convert back to itself, it's making it expand to the 6
characters &euro;, not to an entity reference.

the real question is why are you looking for the entity refs.
The whole point of entities are supposed to be as an author convenience
so if the _author_ doesn't have a euro key on his or her keyboard and
finds it convenient to instead type &euro; that they may do so safe in
the knowledge that alllater applications will treat &euro; the same as
if the character had been entered directly.

So if you make &euro; be something else then the "spirit" has been broken
in that now the character and the entity ref will do different things.

Do you really need to look for entity refererences or do you need to
look for characters that are normally entered via entity references?

If you do end up redefining teh entities, it's easier to test for
<entity name="euro"/> in xslt1 than it is for a string containing
&amp;euro; and much easier to use xslt to convert it back to a single
character.

But the question is really _why_ do you want to treat
&euro; differently from &#8364; ?

David

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.