[jdom-interest] Trimming attribute values before conversion

Bradley S. Huffman hip at a.cs.okstate.edu
Sun May 4 12:08:08 PDT 2003


Elliotte Rusty Harold writes:

> The W3C XML Schema Language recognizes strings with extra space as 
> legal ints, integers, floats, etc. For example width="  75.2  " is a 
> legal double. I suggest that in the Attribute class the various 
> getDoubleValue, getFloatValue(), getBooleanValue() etc. methods trim 
> white space from both ends of the string before attempting to convert 
> them to the relevant types.

+1 for this idea.

Brad



More information about the jdom-interest mailing list