It also appears that it might work with XmlTextReader.  I didn't realize that XmlTextReader can read fragments.

XmlReader paramReader = new XmlTextReader(xmlFragment, XmlNodeType.Element, null);
XdmNode myParamNode = _processor.NewDocumentBuilder().Build(paramReader);


On 12/27/06, Michael Kay <> wrote:
Create a DocumentBuilder, and call its Build method (any variant) to parse the XML document and return the resulting document node as an instance of XdmNode. An XdmNode is an XdmValue, so it can then be passed as the second parameter of transform.SetParameter().
If you want to pass a node-set (node-sequence, really) containing two document nodes, construct an XdmValue using the constructor XdmValue(IEnumerable), passing as the IEnumerable an array or list containing the two XdmNode objects.
Michael Kay

From: [] On Behalf Of John Cavalieri
Sent: 27 December 2006 21:08
Subject: [saxon] DotNet setParameter w/ node-set

Hi Mr. Kay and others,

I am stumped.  How do I pass a node-set using the setParamter method in DotNet? Something similar to the XPath expression "document".

XPath expression example:
    document(" file:///c:/Resources/blah1.xml") | document("file:///c:/Resources/blah2.xml")

This is as far I could get in C#
    XsltTransformer transform = _compiledXsl.Load();
    transform.SetParameter(new QName(null, "myParam"), XdmValue.Wrap(?????


John Cavalieri
john.cavalieri at

Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash

saxon-help mailing list

John Cavalieri