Stephen Cranefield ([EMAIL PROTECTED]) writes:
>Does Xalan-Java apply keys to additional source documents loaded using
>the document() function?
>In an article at
>
http://www-106.ibm.com/developerworks/library/ws-trans/index.html?dwzone=ws
,
>Uche Ogbuji states that "every time an additional source document is
>loaded with the XSLT document() function, all keys are applied to it
>as well".
I think Uche might be going out on a limb with that statement. I don't
believe that the spec says that merely calling document() is sufficient
to cause the scan for "use" nodes in a key. You may have to actually
select a node that matches the "use" pattern for it to be detected.
(The above doesn't even take into account that lazy evaluation is
allowed, which may obscure the issue.) You didn't show us where you
invoked document(), so we can't judge whether Xalan had encountered
the @name nodes in the other file.
I presume that you read the keying-other-documents stuff at the end of
Section 12.2 of the XSLT spec. It shows use of keys on other documents,
but relies on xsl:for-each to switch the current node list. This is
reinforced by the sneaky phrase in the first paragraph under the key()
function that says "it returns a node-set containing nodes in the same
document as the context node...." You might not be invoking key() at a
place where the current/context node is inside the reserved_words.xml
file.
We may have a bug in this area, but I can't tell from what you sent.
At the time key() is invoked, the context node must be set to a node
in the document you want to search, as key() is only going to search
that one document. Your question has made me think of some tricky
non-mainstream test cases!
.................David Marston