Subject: selection with multiple keys From: DUDGEON@xxxxxxxxxxxxx Date: Thu, 20 Jan 2000 16:54:41 +0000 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: XSLT/XPATH jargon, Kay Michael | Thread | Re: selection with multiple keys, David_Marston |
RE: XSLT/XPATH jargon, Pawson, David | Date | RE: position() of the parent, Kay Michael |
Month |