Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: entities in attribute values

From: luca <luca_remove@-----.-->
To: NULL
Date: 1/12/2009 7:32:00 PM
Martin Honnen wrote:
> 
> You need a DTD that declares the entity named 'euro'.
> Or you need to use a numeric character reference e.g.
>   &#8364;
> 
> And that has nothing to do with whether you use the entity reference in 
> an attribute or in an element, that does not matter. You need to declare 
> any entity you want to reference, with the exception of 'lt', 'gt', 
> 'quot', 'apos', 'amp'.

so, here is my problem. I use this XML file simply to hold configuration info. 
One of the strings I need to store in the config file is "&euro;" which, 
unfortunately, happens to be an XML entity and have special meaning for XML and 
XML parsers.

I tried:

<elem name="entity_euro" value="<![CDATA[&euro;]]>"/>

but it does not work.

I can work this around outside of XML by using a different expression and having 
Java re-build the entity string:

<elem name="entity_euro" value="amp_euro;"/>

before I do it, though, I would like to hear whether there is a better (and more 
elegant!) way, because my heart cries when I see XML suck so bad. :)

Luca


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent