Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] entity in attribute value

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Luca Passani <passani AT eunet.no>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] entity in attribute value
  • Date: Mon, 12 Jan 2009 08:12:52 -0800

Luca Passani wrote:
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?


Use a numeric character reference or the actual character.

Without a DTD how would you expect the XML parser to know what &euro; represents?


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Refactoring HTML Just Published!
http://www.amazon.com/exec/obidos/ISBN=0321503635/ref=nosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page