Re: Please confirm parser error concerning ws

rainerbecker.mail@t-online.de (Rainer Becker) writes:

> 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>

<snip/>

> 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?

I believe your analysis is correct, and your instance should be OK --
which validator are you getting the error from?

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Tuesday, 24 September 2002 03:08:44 UTC