Re: variable element names

I think you've identified a bug in Noah's solution.

The processContents attribute of wildcards is not inherited.  So
given

        <parent>
                <var>
                        <x>123</x>
                        <w><a/></w>
                        <z/>
                </var>
        <parent>

and writing

<xs:element name="parent">
 <xs:complexType>
  <xs:sequence>
   <xs:any processContents="strict"/>
  </xs:sequence>
 </xs:complexType>
</xs:element>

in its schema, we would have a requirement that a declaration for the
_var_ element be available.  There's no way to make that requirement
inherited.

So what you actually want is 

<xs:element name="parent">
 <xs:complexType>
  <xs:sequence>
   <xs:any processContents="lax"/>
  </xs:sequence>
 </xs:complexType>
</xs:element>

<xs:element name="x" type="..."/>
<xs:element name="y" type="..."/>
<xs:element name="z" type="..."/>

By using 'lax' you avoid the (undesirable for your example)
requirement for a declaration for 'var', but because lax validation
_is_ recursive, and declarations for x, y and z _are_ present,
requires that they conform to those declarations.

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, 19 November 2002 14:13:15 UTC