[jdom-interest] Request -- please allow all XML 1.1 conformant text in Element.se tText()

Chris B. chris at tech.com.au
Sat Mar 6 04:35:13 PST 2004

Elliotte Rusty Harold wrote:

> Thanks for reminding me of another very good reason why 
> UncheckedJDOMFactory shouldn't be public even if it makes things 
> faster. :-) If people actually use this to accept XML 1.1, then the 
> Serializer is going to output documents that are malformed XML 1.0 and 
> malformed XML 1.1. 

Data validity should be handled by assertions. It's not for you to 
decide if the user of JDOM wants to guarantee to pass in valid data and 
doesn't want checking overhead. Go read Object Oriented Software 
Construction by Bertrand Meyer.

BTW, private members are evil. Everything should be protected. It's not 
up to you to decide how somebody may want to extend your object.

> Plus recent versions of Xerces will let XML 1.1 documents into JDOM as 
> well, so we can't even really use Xerces with an UncheckedJDOMFactory. 
> (Well, you can, but there are some extra nasty hacks you have to pull 
> to make Xerces reject 1.1 documents.) If the serializer can't output 
> 1.1, we shouldn't be accepting 1.1 input. Not that it's likely there 
> are any JDOM customers who actually need 1.1.

More information about the jdom-interest mailing list