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.