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.

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]

Reply via email to