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

Re: Key/Keyref for Element names

From: Graham Mann <gmann@adobe.com>
Date: Fri, 28 Feb 2003 14:54:12 +0000
Message-Id: <5.2.0.9.2.20030228144715.02d56c68@maileurope-nor.eur.adobe.com>
To: ht@cogsci.ed.ac.uk (Henry S. Thompson)
Cc: xmlschema-dev@w3.org

Hi,

Ta for the reply - I'll be happy just to use ID and rRef as the key/Keyref fields then.
I was just looking for a belt/braces solution.

The data consists of a Pool of reusable items and a set or work cases that selects items from the Pool 

<Pool>
        <ItemA ID... />
        <ItemB ID.../>
        ...
</Pool>
<Case1>
        <ItemList>
                <Item Name='ItemA' rRef='...' />
                ...
        </ItemList>
</Case1>
...
<CaseN> ... </CaseN>



At 28/02/2003 12:31  Friday, Henry S. Thompson wrote:
>Graham Mann <gmann@adobe.com> writes:
>
>> 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>
>
>Sorry, the current version of XML Schema doesn't support that kind of
>dependence.  It is somewhat unusual -- what does your data look like?
>
>ht
>-- 
>  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
>                      Half-time member of W3C Team
>     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
>            Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
>                     URL: http://www.ltg.ed.ac.uk/~ht/
> [mail really from me _always_ has this .sig -- mail without it is forged spam]


Graham Mann
Adobe Systems Europe Ltd.
Received on Friday, 28 February 2003 09:55:23 GMT

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