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

selection with multiple keys

Subject: selection with multiple keys
From: DUDGEON@xxxxxxxxxxxxx
Date: Thu, 20 Jan 2000 16:54:41 +0000
multiple keys
I've found keys, defined with xsl:key and selected with the key() function
real useful. However I'm having problems selecting using multiple keys.
Defining the keys works fine. But I can only select them one at a time. When
I try
<xsl:apply-templates select="key('PrID', 'key1|key2')"/>
this doesn't work. Not too much a suprise as for this construct the
'key1|key2' should be converted to a string and there is no such key (though
both do exist individually).

Next I tried
<xsl:apply-templates select="key('PrID', 'key1')|key('PrID', 'key2')"/>
and suprisingly no nodesets are selected, even though both would be selected
on their own.

Finally I tried using a node set as the second argument to key(), as the
XSLT standards says
'When the second argument to the key function is of type node-set, then the
result is the union of the result of applying the key function to the string
value of each of the nodes in the argument node-set.'
However this sort of expression also returns nothing:
<xsl:apply-templates select="key('PrID', /document/ruleset/rule/@id)"/>

where in my xml I have:
<document>
...
<ruleset>
    <rule id="key1"/>
    <rule id="key2"/>
</ruleset>
</document>

Any gurus out there with any ideas as to what's going wrong?

I'm running xalan 19.0.2 and xerces 1.0.1, if that makes any difference.


Many thanks

Tim

--------------------------------------------
Dr. Tim Dudgeon, Bioinformatics group leader
British Biotech Pharmaceuticals
Watlington Road, Oxford, OX4 5LY, UK
Tel: (44) 1865 748747
Fax: (44) 1865 781034
email: dudgeon@xxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.