Re: recursive interleaving -- is it possible

Freddy Berriau <Freddy.Berriau@valtech.fr> writes:

> This should work for question a and question b :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
> elementFormDefault="qualified">
> 	<!--
> 	
> 	
> 		Part a of your question
> 	-->
> 	<xsd:element name="primitive">
> 		<xsd:complexType>
> 			<xsd:attribute name="name" type="xsd:string"/>
> 		</xsd:complexType>
> 		<xsd:key name="primitive_key">
> 			<xsd:selector xpath="."/>
> 			<xsd:field xpath="@name"/>
> 		</xsd:key>
> 	</xsd:element>

Content model is fine -- key declaration is scoped wrongly -- needs to 
be in document element declaration, as follows:

 		<xsd:key name="primitive_key">
			<xsd:selector xpath=".//primitive"/>
 			<xsd:field xpath="@name"/>
 		</xsd:key>

<snip?>

> 		<xsd:keyref name="functionOf_keyref" refer="primitive_key">
> 			<xsd:selector xpath="//primitive"/>
> 			<xsd:field xpath="@name"/>
> 		</xsd:keyref>


Again, you need to move the keyref up to the right scope.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, 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/

Received on Monday, 19 March 2001 07:04:32 UTC