[jdom-interest] Auto-normalizing attribute values

Laurent Bihanic laurent.bihanic at atosorigin.com
Mon May 6 00:35:24 PDT 2002


Elliotte Rusty Harold wrote:
> Should the various setAttributeValue() methods in Element and Attribute 
> check the attribute type and normalize the string according to the 
> attribute type? i.e. normalize the white space if the attribute has any 
> type other than CDATA or UNDECLARED.
> 
That would also mean updating the attribute value when the attribute type is 
changed. But if the type is then switched back to the previous one, the 
original attribute value is lost.

Why not just change the getAttributeValue methods to only normalize the 
returned value according to the current type without changing the inner storage?

Laurent




More information about the jdom-interest mailing list