[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] <selector xpath="."/> doesn't work
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|