Hi Bas,
> Thank you very much for explaining the "key issue" of xsl keys to
> me. You were right, I had to compare the value of elementName (in
> the source document) with elementName/@refAttr (in the other
> document); not the source attribute refAttr.
>
> It miraculously works now. I had some trouble understanding the
> mechanism behind the "use" attribute.
Basically, the XSLT processor creates a look-up table for the
document. The processor goes through all the nodes in the document and
tests them to see if they match the pattern in the 'match' attribute
of xsl:key. If a node matches the pattern, then the processor creates
an entry in the look-up table.
The matching nodes are each assigned a key value, which you can then
use to look up the nodes that have that key value. The key value is
calculated by evaluating the expression in the 'use' attribute with
the matching node as the current node. So the expression in the 'use'
attribute usually takes you from the node that you're matching to the
value you can use to look up the node.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- cross-ref
- Bas Alberts - Wed, 8 Aug 2001 09:22:27 -0400 (EDT)
- <Possible follow-ups>
- Bas Alberts - Thu, 9 Aug 2001 11:28:10 -0400 (EDT)
- Jeni Tennison - Thu, 9 Aug 2001 12:51:04 -0400 (EDT) <=
- Carlos Sanchez - Thu, 16 Aug 2001 10:56:12 -0400 (EDT)
- Sunil Dua - Thu, 16 Aug 2001 11:50:09 -0400 (EDT)
- Choon Tan - Thu, 16 Aug 2001 13:12:55 -0400 (EDT)
- Evan Lenz - Mon, 20 Aug 2001 17:55:09 -0400 (EDT)
|
|