W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

Key/Keyref for Element names

From: Graham Mann <gmann@adobe.com>
Date: Fri, 28 Feb 2003 12:10:03 +0000
Message-Id: <5.2.0.9.2.20030228115514.029fe8a8@maileurope-nor.eur.adobe.com>
To: xmlschema-dev@w3.org

Hi,

I'm trying to make a Key that is the combination of an Elements Children's name and ID attribute.
These will then be used by a Keyref that has two attributes to do the match.

The ID is no problem - but I can't seem to get a permitted XPath expression to return a childs' name as a string.

<xs:keyref name="Element_rRef" refer="Element_ID">
        <xs:selector xpath=".//Pool/*"/>
                <xs:field xpath="@rRef"/>
                <xs:field xpath="@Name"/>
</xs:keyref>
This is OK 

<xs:key name="Element_ID">
        <xs:selector xpath="./*"/>
                <xs:field xpath="@ID"/>
                <xs:field xpath="{name()}"/>
</xs:key>

The second field is incorrect - but its the XPath function I'd like to use





Graham Mann
Adobe Systems Europe Ltd.
Received on Friday, 28 February 2003 07:17:39 GMT

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