W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2002

use of "or" in keyref selector

From: Colin Mackenzie <colin@elecmc.com>
Date: Fri, 14 Jun 2002 10:09:35 +0100
To: <xmlschema-dev@w3.org>
Message-ID: <PJEOKNCGPHICMMDPMNAJAEOPCDAA.colin@elecmc.com>


Hi,

Can anyone confirm whether or not it is valid to specify an "or" for a
selector in a keyref.
Tools seem to support it but I just want to be sure (in the past I have
tried key selectors using element[childelement]/value which are not
supported).

<xsd:keyref name="RefStaffToDetails" refer="KeyStaffbyURN">
	<xsd:selector
xpath="fulltimestaff/staffmember/@refURN|parttimestaff/staffmember/@refURN"/
>
	<xsd:field xpath="."/>
</xsd:keyref>

where the schema enforces a choice of fulltimestaff or parttimestaff

e.g. two instance snippets

<company>
	<fulltimestaff>
		<staffmember refURN="123"/>
	</fulltimestaff>
	<allstaffdetails>
		<staffmember URN="123">
			<name>fred</name>
		</staffmember>
	</allstaffdetails>
</company>

and

<company>
	<parttimestaff>
		<staffmember refURN="124"/>
	</parttimestaff>
	<allstaffdetails>
		<staffmember URN="124">
			<name>fredricka</name>
		</staffmember>
	</allstaffdetails>
</company>

Colin Mackenzie
Received on Friday, 14 June 2002 05:09:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:31 GMT