[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

<selector xpath="."/> doesn't work


selector xpath
Hello,
I am using <key> and <keyref> in my XML Schema.

When I declare the <key> element globally ('AdminUnitKey_Global'), the key's
are set appropriatly.

When I want to declare the <key> element locally ('AdminUnitKey_Local'; by
using the expression <selector xpath="."/ under the <AdminUnit> element) the
key is not set and the schema does not validate because the <keyref> fails to
refer to some key.

I thought that xpath="." refers to the current element where the xpath
expression is set? Why doesn't that work with <key>?

Thanks, Markus

<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.opentourism.org"
xmlns="http://www.w3.org/2001/XMLSchema" xmlns:utour="http://www.opentourism.org"
elementFormDefault="unqualified">
	<element name="Country">
		<complexType>
			<sequence>
				<element name="CountryID" type="string"/>
				<element name="AdminUnit" minOccurs="0" maxOccurs="unbounded">
					<complexType>
						<sequence>
							<element name="AdminUnitName" type="string"/>
							<element name="SubAdminUnits" minOccurs="0" maxOccurs="unbounded">
								<complexType>
									<sequence>
										<element name="SubAdminUnitName" type="string"/>
									</sequence>
								</complexType>
							</element>
						</sequence>
					</complexType>
<!--
					<key name="AdminUnitKey_Local">
						<selector xpath="."/>
						<field xpath="AdminUnitName"/>
					</key>
					<keyref name="AdminUnitRef_Local" refer="utour:AdminUnitKey_Local">
						<selector xpath="SubAdminUnits"/>
						<field xpath="SubAdminUnitName"/>
					</keyref>
-->
				</element>
			</sequence>
		</complexType>
		<key name="AdminUnitKey_Global">
			<selector xpath="AdminUnit"/>
			<field xpath="AdminUnitName"/>
		</key>
		<keyref name="AdminUnitRef_Global" refer="utour:AdminUnitKey_Global">
			<selector xpath="AdminUnit/SubAdminUnits"/>
			<field xpath="SubAdminUnitName"/>
		</keyref>
	</element>
</schema>

-- 
Markus Seibold
------------------------------
Krebsgasse 6
D-93047 Regensburg
Germany
------------------------------
Email: markus.seibold@g...
Phone: +49 (941) 504 1009
Mobile: +49 (171) 212 6869
FAX: +49 (89) 1488 210457


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.