Thanks Michael


Looking at some examples on the web, It looks like the Unwrap method returns an instance of, instead of net.sf.saxon.dotnet.DotNetObjectValue, and doesn’t have a GetObject method.

I’m also confused about how you would declare the argumentType for an object passed from XSL to Saxon. Which XdmItemType would this use?







Is it possible to pass an object to an integrated extension function, which has been passed as a parameter using XdmAtomicValue.WrapExternalObject? Looking at the Saxon documentation, this doesn't seem possible as the types which integrated extensions can accept seem limited.






Just in case anyone else is confused (I spent a minute or two scratching
my head), we're talking about the .NET API here.

I think you can use an XdmAtomicValue that was constructed using


in the same way as any other XdmAtomicValue. Presumably the issue is,
within the body of your ExtensionFunctionCall, how do you get the
external object back from the IXdmEnumerator that's supplied to the call?

It's a little clumsy, but I think it can be done.

First you call MoveNext() and Current() on the IXdmEnumerator, and cast
the result to XdmAtomicValue. Then the Unwrap method (inherited from
XdmValue) returns an instance of net.sf.saxon.dotnet.DotNetObjectValue.
(To refer to this, you'll need to add a reference to the underlying
Saxon DLL). This extends net.sf.saxon.value.ObjectValue, which has a
method getObject, which should return you the object you started with.

I'll add a tweak so XdmAtomicValue.Value does the right thing.

Michael Kay

Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
saxon-help mailing list archived at



This is a confidential email. Tesco may monitor and record all emails. The views expressed in this email are those of the sender and not Tesco.

Tesco Stores Limited
Company Number: 519500
Registered in England
Registered Office: Tesco House, Delamare Road, Cheshunt, Hertfordshire EN8 9SL
VAT Registration Number: GB 220 4302 31