You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Neeraj Bajaj <Ne...@Sun.COM> on 2002/01/16 16:28:22 UTC

Validity constraint: One ID per Element Type

hi All,
	
According to the constraint,  http://www.w3.org/TR/REC-xml#one-id-per-el

<snip>
Validity constraint: One ID per Element Type

No element type may have more than one ID attribute specified.
</snip>

so as per the above constraint, parser will give an error for an element 
declaration like

<!ELEMENT foo EMPTY>
<!ATTLIST foo id  ID  #IMPLIED>
<!ATTLIST foo id1 ID  #IMPLIED>

what should be the behavior of the parser when ATTLIST declaration is like.. 

<!ELEMENT foo EMPTY>
<!ATTLIST foo id ID  #IMPLIED>
<!ATTLIST foo id ID  #IMPLIED>

XML 1.0 spec allows more than one defintion of the same attribute for a given
element type and later declaration is to be ignored, parser may choose 
to issue a warning when more than one attribute definition is provided for given 
attribute but it is not an error.

http://www.w3.org/TR/REC-xml#NT-AttDef

<snip>
When more than one definition is provided for the same attribute of a given 
element type, the first declaration is  binding and later declarations are 
ignored. 
       ....................
        For interoperability, an XML processor may at user option issue a 
warning when more than one attribute-list declaration is provided for a
given element type, or more than one attribute definition is provided for a 
given attribute, but this is not an error.
</snip>       

As of right now Xerces(X2) reports an error with 'Validity constraint: One ID 
per Element Type', IMO parser should not report an error, as the second 
definition for the same attribute should be ignored. What do others think ? 

regards,

Neeraj Bajaj
SUN Microsystems, inc.




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org