xsl-list
[Top] [All Lists]

RE: [xsl] key based on items across several documents

2008-10-19 18:30:30
This can't be done, I'm afraid. The result of calling key() will only
contain nodes in the same document as the context node or (in XSLT 2.0 with
the 3-argument form of the function) in the subtree rooted at the node
supplied as the third argument. Yes, your match pattern is invalid too, both
in 1.0 and 2.0, but that's not the essence of the problem.

Michael Kay
http://www.saxonica.com/  

-----Original Message-----
From: Paul Kiel [mailto:paul(_at_)xmlhelpline(_dot_)com] 
Sent: 19 October 2008 23:18
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] key based on items across several documents

Greetings all,

I am trying to create a key based on items across several 
documents.  Here is a simplified version of what I'd like to do:

      <xsl:key name="ItemsWithName" match="$ItemFiles//item[(_at_)name]"
use="@name"/>

Creates a list of all <item>s that have an @name attribute, 
across several documents (The ItemFiles variable gathers 
nodes across documents based on input).  But it looks like I 
can't use variables in the match pattern part of the key 
element.  I knew this was true in xslt 1.0, having wanted to 
do this years ago, but also seems to be the case in xslt 2.0 
as well.  Have I been staring at this too long, or is there a 
way to do this that I'm not thinking of in xslt 2.0?

Thanks in advance,
Paul Kiel






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--