DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27009>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27009 Empty string as an attribute value. ------- Additional Comments From [EMAIL PROTECTED] 2004-02-18 22:58 ------- Starting with DOM behavior: Trying to retrieve the value of an attribute which doesn't exist does return empty string in the DOM. To distinguish the two cases, retrieve the attribute _node_. If that returns null, there is no such attribute. Don't use the DOM's getAttribute() call at all, since it isn't namespace-aware and thus is pretty basically broken in terms of modern XML usage. (It would be deprecated if the W3C had a deprecation mechanism and if DOM Level 2 wasn't optional.) And don't use getAttributeNS() if you want to be able to distinguish empty from absent; use getAttributeNodeNS(). Moving on to DTM: I haven't checked the code, but I suspect DTM has similar behavior: If you ask for the value of an attibute, you get empty string if it doesn't exist, but if you ask for the attribute node, you get DTM.NULL if it doesn't exist. Again, if you need to distinguish the two cases, you probably need to ask the model the right question.
