Why this example doesn't work?
public static NodeList test ( NodeList list )
I use Saxon 8.1.1
Thanks for reporting this. It seems there is an asymmetry between the code that converts from a Saxon node sequence to a DOM NodeList and the code that converts back again.
I guess you are supplying the source document in the form of a DOM, and Saxon is creating its own wrappers around these nodes. In this case the idea is that the NodeList passed to the function contains (or appears to contain) the original DOM nodes. However, a DOM NodeList that's returned from an extension function must contain nodes that implement Saxon's native NodeInfo interface.
I'll try to fix this so it works in the case where the extension function doesn't modify the NodeList. However, there will still be restrictions if it's modified. Frankly, Saxon and the DOM don't work all that happily together, because of differences between the DOM data model and the XPath data model (not to mention the fact that the XSLT processing model assumes nodes are immutable). It might be worth looking at what you are trying to achieve and seeing if there is a better way.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.