Description
The implementation of the key and id functions in XSLTC assumes that there is only one input document. When more than one input document is involved, the functions should return nodes only in the same document as the context node. However, XSLTC ends up to put all the matching nodes with a particular key value or all the nodes with the same ID value in the same table, regardless of the source document. The table entries are DTM node identifiers, rather than node handles, so it's not possible to tell which document they actually came from. When either function is evaluated, it will treat all the node identifiers as if they represented nodes in the same document as the context node, so they might return seemingly random nodes or even produce an ArrayIndexOutOfBoundsException.