Re: Unique element identifiers across attributes

I'm not sure from your examples exactly what you want, because it's
not clear what's accidental and what's essential.  Stipulate that
there's some scoping element 'scope', which is the domain within which
the key is unique.  Then I _think_ the following is the closest you
can get to what you want, but it doesn't quite work:

<xs:element name="scope">
 . . .
 <xs:unique name="tricky">
  <xs:select xpath="a|b"/>
  <xs:field xpath="@n|@m"/>
 </xs:unique>
</xs:element>

This fails because the field selects more than one key in the
<a n='x' m='x'/> case.

Sorry.  If you could say a bit more about the element structure of
your documents, it might turn out that there is a solution.

ht
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.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 Saturday, 31 January 2004 06:22:16 UTC