xsl: key defines keys for any input document you use, whether it is the primary one or a secondary one you load with "document" or "doc" does not matter. But a key is built for each document and one call to the "key" function only finds nodes in one document so you need to make sure you use e.g. "key('key-name', 'foo')" with the right context node or you use e.g. "key('key-name', 'foo', doc('bar.xml'))" to provide the context.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
|