Yes, you are correct. The caching mechanism doesn't take into account the XML document context, just match criteria, which makes caching not suitable when you base your values on the XML context.
I'm not sure how to build the cache key in this case. We can't use $contextElementXPathExpression
because it's an expression like /root/note
. Altering the XML structure will lead to bad proposals. We might build a key in which we use the other attributes , like in your example n="dataFieldA"
. But it will still cache badly for situations in which, from the XSLT, you make conditions based on ancestors or siblings.
I will add an issue to further discus this.
Currently, as a workaround, you can use our Java based API to implement a Content Completion Handler
that knows how to properly cache the values.