[Home] [By Thread] [By Date] [Recent Entries]
David Carlisle wrote:
<xsl:sequence select="$n,$n/ancestor::*[node-name(.)=$lists][1][node-name(.)=node-name($n)]/f:same(.)"/> It took my aging brain a bit to parse this out but I was able to adapt it to my code to get the correct answer. Here's how I understand this to work: 1. Construct a sequence consisting of the current node (which we know to be the starting list) and the results of steps 2-5: 2. Get the list of ancestors that are lists of any type: ancestor::*[node-name(.)=$lists] 3. Get the first (nearest) such ancestor: ancestor::*[node-name(.)=$lists][1] 4. For that nearest ancestor, see if its type is the same as the target type: [node-name(.)=node-name($n)] 5. If it is, apply f:same() to it: /f:same(.) 6. Return the result sequence Cheers, Eliot
|

Cart



