I have implemented a custom XPath function that is used to retrieve an
XPathNodeIterator over an XmlDocument (other than the primary document
being queried) specified by filename. This function works in an
expression like:
/a:Doc/a:Value + custom:GetDoc('doc2.xml')/b:Doc/b:Value
But the custom function will not even be invoked if used in an
expression like:
/a:Doc/a:Value[. = custom:GetDoc('doc2.xml')/b:Doc/b:Value]
These expressions are being compiled and then evaluated against an
XPathNavigator over XmlDocument. I've found that within the
CompiledXPathExpr's query tree, the FunctionQuery object that
represents the function call differs between the two expressions - in
the first, the private field "function" contains a reference to an
instance of my IXsltContextFunction class, and in the second
"function" is null.
In both cases, the FunctionQuery object contains information about the
function, such as its QName and arguments. Has anyone seen behavior
like this before?
(This is using .Net framework 3.0)
phil k chan - 20 Sep 2007 16:12 GMT
Nevermind - It turns out I was passing in the wrong context node
iterator to the nav.Evaluate method.
> I have implemented a custom XPath function that is used to retrieve an
> XPathNodeIterator over an XmlDocument (other than the primary document
[quoted text clipped - 21 lines]
>
> (This is using .Net framework 3.0)
phil k chan - 20 Sep 2007 16:13 GMT
Nevermind - It turns out I was passing in the wrong context node
iterator to the nav.Evaluate method.
> I have implemented a custom XPath function that is used to retrieve an
> XPathNodeIterator over an XmlDocument (other than the primary document
[quoted text clipped - 21 lines]
>
> (This is using .Net framework 3.0)