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?

Cheers,
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to