RE: Poorly researched observations on <xsd:key>, <xsd:keyref> and <xsd:unique>

Poorly researched on no sleep.

From Part 1, Section 3.10:
{selector} specifies an XPath expression [XPath] relative to instances of the element being declared. This must identify a node set of subelements (i.e. elements contained within the declared element)
to which the constraint applies.
---
Was this intentionally omitting the constrained element from the potential node set?  My previous message assumed that self or descendant-or-self would be legal though the target node set might
contain the constrained element.
For example, you might want to constrain the following document
<Profiles favorite="javaProfile">
	<Profile id="javaProfile">Java</Profile>
	<Profile id="cppProfile">C++</Profile>
</Profiles>
with a constraint like:
<xsd:key name="profileID">
	<xsd:selector xpath="Profile"/>
	<xsd:field xpath="@id"/>
</xsd:key>
<xsd:keyref name="favoriteProfile" refers="profileID">
	<xsd:selector xpath="."/>
	<xsd:field xpath="@favorite"/>
</xsd:keyref>
However, the keyref would not be legal with the current construct since the constrained node is not a subelement of itself.

Received on Friday, 9 February 2001 18:41:05 UTC