Re: [xsl] Can I create a key on elements in a non-primary XML document?

Subject: Re: [xsl] Can I create a key on elements in a non-primary XML document?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 16 Mar 2025 14:25:54 -0000
On 16/03/2025 15:20, Roger L Costello costello@xxxxxxxxx wrote:
Is it possible to create and use a key for a non-primary XML document?


Yes, just understand that the key declaration doesn't name any document,
does not refer to any document so just declare as you would declare it
for a primary document.

Then (in XSLT 2 and later) pass the secondary document you want to use a
key on in the key function call as the third argument e.g.

B key('key-name', key-expression, $doc1)

or use e.g.

B $doc1 ! key('key-name', key-expression)

Current Thread