- From: Rainer Becker <rainerbecker.mail@t-online.de>
- Date: Sun, 22 Sep 2002 18:14:58 +0200
- 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 UTC