[XOM-interest] entity in attribute value

Luca Passani passani at eunet.no
Mon Jan 12 06:34:51 EST 2009


Hi, I just figured that XML is touchy about using entities in attribute 
value even for super-simple XML files with no DTD:

         <capability name="entity_euro" value="&euro;"/>

Caused by: org.xml.sax.SAXParseException: The entity "euro" was 
referenced, but
 not declared.
        at 
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.j
ava:1189)
        at nu.xom.Builder.build(Builder.java:1127)


is there a standard way to escape entities in XML?

who said that XML was simple? it is horrendously gotcha-ridden....

Thanks

Luca



More information about the XOM-interest mailing list