Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - entities in attribute values >Thread Next - Re: entities in attribute values Re: entities in attribute valuesTo: NULL Date: 1/12/2009 7:07:00 PM luca wrote: > Hi, I just figured that XML is touchy about using entities in attribute > value even for super-simple XML files with no DTD: > > <elem name="entity_euro" value="€"/> > > Caused by: org.xml.sax.SAXParseException: The entity "euro" was > referenced, but > not declared. > at > org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1189) > > > > is there a standard way to escape entities in XML? You need a DTD that declares the entity named 'euro'. Or you need to use a numeric character reference e.g. € 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'. -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
