[Home] [By Thread] [By Date] [Recent Entries]

  • From: "Michael Kay" <mike@s...>
  • To: "'dave'" <ceek63@y...>,<xml-dev@l...>
  • Date: Wed, 14 Nov 2007 20:40:35 -0000

> ...
> <parent a="bc" d="ef">
>   <container>
>     <name> xx </name>
>     <misc> xx </misc>
>   </container>
> </parent>
> ...
> 
> In the above xml, the "key" is composed of attributes 'a','d' 
> and element 'name'. How do I define a selector and fields 
> here to define the 'key' in this situation?
> Because, the attributes and element are at different 
> levels/scopes. I am using w3c schema 1.0.
> 

I think you can do

<xs:unique>
  <xs:selector xpath="XXX/parent"/>
  <xs:field xpath="@a"/>
  <xs:field xpath="@d"/>
  <xs:field xpath="container/name"/>
</xs:unique>

Not sure what XXX is since it depends where you are selecting from.

Michael Kay
http://www.saxonica.com/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member