Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / September 2007

Tip: Looking for answers? Try searching our database.

Custom IXsltContextFunction behaves differently within a predicate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
phil k chan - 18 Sep 2007 17:04 GMT
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)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.