[jdom-interest] Entities in attributes

Elliotte Rusty Harold elharo at metalab.unc.edu
Wed May 1 20:08:28 PDT 2002


At 6:20 PM -0700 5/1/02, Jason Hunter wrote:
>Parsers hand it to JDOM that way.  I recall they do that even if you
>turn entity expansion off.  We decided if no parsers worry about entity
>refs in attribute values, we didn't need to.
>

DOM parsers do worry about this. SAX parsers don't, and in fact run 
into trouble when faced with skipped entities in attribute values. 
There's a thread about this on sax-users right now.

However, since our model of an attribute value is a string, there's 
really no way for us to maintain entity references in attribute 
values, nor do I think we should. We don't maintain unskipped 
entities in element content either.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list