[jdom-interest] CDATA inconsistency

Alex Rosen arosen at novell.com
Wed Nov 27 08:30:32 PST 2002


It's a good question. We've debated about this - see the thread starting at http://www.servlets.com/archive/servlet/ReadMsg?msgId=217592&listName=jdom-interest 

If it were free, then absolutely we'd check for it, but there would be significant costs to making sure that you can never do anything bad using JDOM. Having to check every character of the document (CDATA and plain text nodes, attribute values, element and attribute names, etc.) for well-formedness would be one of them. Some people think it's worth the trade-off, some don't.

BTW you can absolutely fail a constructor nicely in Java - just throw an exception. C++ used to have this problem, but I think that adding exceptions fixed it.

Alex Rosen
Novell, Inc.

>>> Duane Morin <dmorin at lear.morinfamily.com> 11/01/02 10:58AM >>>
Is this the right behavior, is what I'm asking. I am allowed to create a
CDATA with those illegal characters.  I assume that this is because 
you can't real fail a constructor nicely in Java.  Should there be a way 
that I can tell immediately that I've got bad characters on my hands?

Duane





More information about the jdom-interest mailing list