[jdom-interest] Turning of entity expansion

Elliotte Rusty Harold elharo at metalab.unc.edu
Tue Sep 3 14:04:05 PDT 2002


>How am I supposed to create my XHTML documents then?

Just the way you're doing it. You shouldn't care whether you get the 
actual character or the ũ. Theya re the same thing to an XML or 
XHTML processor.

>There should at least be the OPTION to leave text verbatim?, for instance
>what if you use CDATA, you'd be screwed then, not that I do however,
>I always use entities (if " is an entity ;)).

No screwed. Again, it simply does not matter whether entity 
references or the actual characters or CDATA sections or character 
references are used.

>There MUST be a way, surely, just a way to let certain text go out verbatim
>because otherwise JDOM would be generating non-XML compliant documents
>which would be pretty crap for an XSLT tool, XML generator, or whatever
>description you think it should have.

Absolutely not. JDOM should not be able to generate non-XML compliant 
documents (Actually it can, but you have to know where to look, and I 
would consider these bugs in JDOM.) However, I doubt you've run 
across any of these weird cases. If you have, please demonstrate the 
code that makes JDOM output malformed XML so we can fix the bug. But 
I think your problem is that you have an incorrect understanding of 
XML. Your problem lies with XML, not with JDOMM.

>Ok, so is there any way I can make JDOM output the sequence:
>
>©
>
>to an XML document???

There is a way, in fact they're a couple, but they're really 
complicated; and trust me, you really don't want to do that. If you 
can convince me you have a real use case for this, I'll show you how; 
but I really think right now showing you would do you more harm than 
good.

>if not then where is it's support for XML unicode character references
>
>http://www.w3.org/TR/REC-xml#sec-references
>
>?

JDOM supports these fully on input and as necessary on output. If 
you're not seeing them, it's because they're not necessary in your 
documents. JDOM is preventing you from shooting yourself in the foot. 
Convince me you don't want to shoot yourself in the foot, and I'll 
tell you how to turn the safety off, but right now it sounds to me 
like you're just itching to shoot your foot off. :-)
-- 

+-----------------------+------------------------+-------------------+
| 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