Hi Christian, Christian Will <[EMAIL PROTECTED]> wrote on 09/05/2005 12:19:42 PM:
> Hi, > > I have a question... > > I created an element declaration with an attribute of type IDREF and a > default value. The xml processor creates automaticaly the attribute > with the default value, if it is absent in the instance document. > > So I expected that the validator also checks ID/IDREF dependency for > default attributes. > > <?xml version="1.0" encoding="UTF-8"?> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > elementFormDefault="qualified" attributeFormDefault="unqualified"> > <xs:element name="ROOT"> > <xs:complexType> > <xs:sequence> > <xs:element name="ELEMENT" minOccurs="0" maxOccurs="unbounded"> > <xs:complexType> > <xs:attribute name="idref" type="xs:IDREF" default="ID001"/> > <xs:attribute name="id" type="xs:ID"/> > </xs:complexType> > </xs:element> > </xs:sequence> > </xs:complexType> > </xs:element> > </xs:schema> > > > <?xml version="1.0" encoding="UTF-8"?> > <ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:noNamespaceSchemaLocation="schema.xsd"> > <ELEMENT id="ID002"></ELEMENT> > </ROOT> > > For example for this instance document I expected the error > "cvc-id.1: There is no ID/IDREF binding for IDREF 'ID001'", > but xerces reports no error. > > So maybe I'm wrong or this is a bug? Where can I find the rule for > this case in the schema recommendation? It's a grey area of the spec. It isn't clear whether IDREF is enforced for defaulted attributes. Members of the schema WG are aware of this issue and have opened a bug report against the spec in Bugzilla [1]. I think this is probably a bug, but will wait for a response from them before making any changes to the code. > Cheers, > Christian > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Thanks. [1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=2041 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]
