[jdom-interest] SAXHandler / CDATA / entities

Malachi de AElfweald malachi at tremerechantry.com
Mon Nov 18 18:17:32 PST 2002


I am confused by your statement....

JDOM does cope with CDATA just fine. You can put all of those characters in 
a
CDATA now.

Besides, why would "Unparsed Character Data" (ie: CDATA) need parsed?

Malachi

On Mon, 18 Nov 2002 21:46:25 +0100, Ingo Struck <ingo at ingostruck.de> wrote:

> Hi folks,
>
> the inability of jdom to cope with CDATA sections is really a great
> drawback.
> To be halfway useful, at least the character escaping should work 
> properly
> (i.e. encoding of the five "evil" chars AMP, LT, GT, QUOTE, APOS).
> I propose the following fix in SAXHandler java, such that the numerical escaping 
> (with the great advantage of uniform length for all escaped chars)
> works as well:
>
> public void startEntity(String name) throws SAXException {
> [...]
> // Ignore DTD references, and translate the standard 5
> if ((!inDTD) &&
> (!name.equals("amp")) && (!name.equals( "#38" )) && (!name.equals( "#x26" 
> ) )
> && (!name.equals("lt")) && (!name.equals( "#60" )) && (!name.equals( 
> "#x3C" ))
> && (!name.equals("gt")) && (!name.equals( "#62" )) && (!name.equals( 
> "#x3E" ))
> && (!name.equals("apos")) && (!name.equals( "#39" )) && (!name.equals( 
> "#x27" ))
> && (!name.equals("quot")) && (!name.equals( "#34" )) && (!name.equals( 
> "#x22" ))
> ) {
> [...]
>
> Still a proper CDATA handling would be really great for the release 
> anyway.
>
> Kind regards
>
> Ingo Struck
>



-- 




More information about the jdom-interest mailing list