[jdom-interest] Auto-normalizing attribute values

Philip Nelson panmanphil at yahoo.com
Sun May 5 07:10:11 PDT 2002


I can't see any negatives, would it help people much?

--- Elliotte Rusty Harold <elharo at metalab.unc.edu> wrote:
> A question for consideration:
> 
> 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.
> 
> Currently it is possible for getAttributeValue() and related methods to 
> return a string containing lots of extraneous white space where it 
> wouldn't be expected in ID and IDREFs attributes and the like.
> 
> Note that unlike the getTextTrim() and getTextNormalize() methods for 
> Element, the XML spec does specify normalization behavior for 
> attributes. We follow this spec on input because th eparser normalizes 
> for us. This would only be an issue when setting attribute values 
> outside the context of a parser.
> 
> -- 
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+-------------------+ 
> |           The XML Bible, 2nd Edition (IDG Books, 2001)             |
> |             http://www.cafeconleche.org/books/bible2/              |
> |   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:   http://www.cafeaulait.org/     | 
> |  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
> +----------------------------------+---------------------------------+
> 
> 
> 
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com



More information about the jdom-interest mailing list