[jdom-interest] Turning of entity expansion

Elliotte Rusty Harold elharo at metalab.unc.edu
Wed Sep 4 06:03:21 PDT 2002


At 9:33 PM -0700 9/3/02, Philip Nelson wrote:
>Alex is right I think.  Isn't it also on the the todo list to determine if
>there could be a way to be able to do a better job of round tripping character
>entities?  Possibly not because the cost would be too high but I think most of
>us agreed that would be our choice if it were possible to do without 
>to great a
>performance penalty.
>

I don't agree. It would encourage developers to misuse XML by 
treating actual characters and character references differently.

What's in the TODO list is a proposal to be less aggressive about 
escaping non-ASCII characters with character entity references when 
the specified encoding allows them to be represented literally. 
That's reasonable. Round tripping them from input is not.

Furthermore, practically, neither DOM nor SAX parsers give us any 
information about which characters are represented by character 
references, so it's really not possible to round trip this without 
rolling our own parser.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/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