[jdom-commits] CVS Update: jdom/src/java/org/jdom
nobody at chimbo.servlets.com
Sun May 4 23:36:55 PDT 2003
Date: Mon May 5, 2003 @00:36:55 MDT
Update of /home/cvs/jdom/src/java/org/jdom
In directory chimbo:/tmp/cvs-serv7215
Handling emails from Rusty.
I added attribute value trimming before data conversion per:
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.
I also added "1" and "0" as boolean values and improved the related
Currently, getBooleanValue recognizes "true", "on", and "yes" as true
and "false", "off", and "no" as false.
I suspect we should follow the W3C XML Schema definitionn of boolean;
i.e. "true" and "1" are true; "false" and "0" are false. All other
values throw an exception.
A weaker version would keep "on/off" and "yes/no" but add 0 and 1.
Finally, whatever decision is reached here, the JavaDoc needs to be
adjusted to document what is going on. Currently you have to read the
source code for this method to find out.
I chose the "weaker" version for now since it's a sure thing improvement.
Fully changing behavior as Rusty proposes will subtly break code and
shouldn't be done without a lot of debate.
File: no file Attribute.java Status: Needs Checkout
Working revision: 1.47 Mon May 5 06:36:55 2003
Repository revision: 1.47 /home/cvs/jdom/src/java/org/jdom/Attribute.java,v
jdom_1_0_b9 (revision: 1.45)
jdom_1_0_b8 (revision: 1.40)
jdom_prefilter (revision: 1.34)
jdom_1_0_b7 (revision: 1.32)
jdom_1_0_b6 (revision: 1.20)
start (revision: 18.104.22.168)
jdom (branch: 1.1.1)
More information about the jdom-commits