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 / December 2004

Tip: Looking for answers? Try searching our database.

How to pass a Nodeset to an XPath extension function?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Damien Goutte-Gattat - 31 Dec 2004 09:19 GMT
I am using the .NET framework v2.0.40607 with Visual C# Express and I would
like to create some custom XPath functions to use directly in a XSLT
stylesheet.

I called System.Xml.Query.XmlArgumentList.AddExtensionObject(string, object)
to register the functions I've written.

The functions that take a String, Boolean or Number parameter work
perfectly. However, I do not know how to create a function that will accept a
Nodeset as a parameter.

I tried writting a function taking a XPathNavigator object, but it does not
work for all XPath queries that return a Nodeset: I get an error "Xml type
'item' does not support a conversion from a Clr
'MS.Internal.Xml.XmlQuerySequence', which contains multiple items, to a
single item."

Is this a bug or the normal, expected behavior? If it is normal, then how to
write a function that will accept a Nodeset parameter?

Any help will be appreciated. Thanks.
Damien Goutte-Gattat - 31 Dec 2004 09:55 GMT
I think I've figured out the solution.

I've written a function that takes an ARRAY of XPathNavigator, and it seems
to work. Each XPathNavigator object represents one of the node present in the
Nodeset.

> I am using the .NET framework v2.0.40607 with Visual C# Express and I would
> like to create some custom XPath functions to use directly in a XSLT
[quoted text clipped - 17 lines]
>
> Any help will be appreciated. Thanks.

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.