Michael Glavassevich wrote:
Hi all,
Over the weekend I noticed Venu's commit for DOM Level 3 TypeInfo. This interface requires that the typeName [1] be null when the type declared for an attribute is unknown. The infoset [2] says when there is no declaration for an attribute the attribute type property "... has no value" and also that "applications should treat no value and unknown as equivalent to a value of CDATA".
The problem is that XNI does not expose information about whether an attribute was declared in the DTD, and setting the type of an attribute to null isn't allowed in XNI (nor is this an expected value when the configuration is used in a SAX context). In the current implementation you'll get a NullPointerException if you try reading a 'null' type back from XMLAttributesImpl. All that said, it seems that there needs to be a change to align with the infoset.
Sorry i had missed checking in XMLAttributesImpl.java.
As you already pointed out in [2]and [1] attribute type should be null when declaration is not found .My intent is to change all the places in xerces where type is referenced appropriately( eg : check for null , etc.).If all feel this is not appropriate thing to do then provding a variable as suggested is the easiest alternative.
Depending on the suggestions i would either goahead and make changes req when a SAXParser is used or back out the current checkins.
All please let us know your views at the earliest.
Regards, Venu
I propose that we add a property to Augmentations for attributes which specifies whether the attribute was declared in the DTD. We'd also need to give it a name. Perhaps something like "ATTRIBUTE_DECL". To me, this seems like the cleanest way of exposing this information without making any XNI changes or relying on casting to get at implementation methods.
What does everyone else think?
[1] http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030609/core.html#TypeInfo-typeName
[2] http://www.w3.org/TR/xml-infoset/#infoitem.attribute
Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
