W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2002

Please confirm parser error concerning ws

From: Rainer Becker <rainerbecker.mail@t-online.de>
Date: Sun, 22 Sep 2002 18:14:58 +0200
Message-ID: <3D8DEC82.EA3C3795@t-online.de>
To: xmlschema-dev@w3.org

Hallo newsgroup readers,

I have a question concerning the following schema and the handling
of whitespaces:

   <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <xsd:element name="Final">
         <xsd:complexType>
            <xsd:sequence>
               <xsd:element name="Test" type="TestType" />
            </xsd:sequence>
         </xsd:complexType>
      </xsd:element>

      <xsd:complexType name="TestType">
         <xsd:simpleContent>
            <xsd:extension base="xsd:string">
                <xsd:attribute name="id" type="xsd:ID"/>
            </xsd:extension>
         </xsd:simpleContent>
      </xsd:complexType>

   </xsd:schema>

Validating the following instance against it works just fine, (as
expected)

<Final>
   <Test id="myId"></Test>
</Final>

But if i put any whitespaces into the attribute value, the tells me,
that "attribute content is invalid according to DTD/Schema". So

<Final>
   <Test id="
            myId
             "></Test>
</Final>

does not work. The parser tells me that
"Attribute Value is invalid according to Schema"

The fact is, that ID inherits whitespace="collapse" from
the value space of token. Additionally, ID inherits the
NCName pattern (from the value space of NCName)

Because the whitespace normalization takes place BEFORE the
attribute value is validated against the schema, the second
instance should be valid too. Can one confirm please?

Thank, you very much!

Rainer Becker
Received on Sunday, 22 September 2002 12:14:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT