Somewhere in the body of your function, which you haven't shown us, is an expression whose value depends on the context item, which as I imagine you know, is undefined within a function body. If you show us your code then we can help you find where the dependency lies.


Michael Kay

From: []
Sent: 05 June 2009 18:25
Subject: [saxon] "The context item is undefined at this point" error message

I’m getting a similar error to what has been reported in the past.


I’m using Oxygen 10.2 with Saxon SA-


I define a function

<xsl:function name="lib:my_name" as="item()*">


There are <xsl:sequence> elements in “when” clauses in the function body, and an <xsl:if test="exists($data)"> that surrounds the ‘meat’ of the function body.


If the sequence elements are commented out, I don’t get the "The context item is undefined at this point" error message.  But when they are uncommented, I get the error message.  The “if” may prevent anything at all from being returned, which is what the “item()*” is supposed to allow.




Thanks, Mike

This email and any attachments are only for use by the intended recipient(s) and may contain legally privileged, confidential, proprietary or otherwise private information. Any unauthorized use, reproduction, dissemination, distribution or other disclosure of the contents of this e-mail or its attachments is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete the original.