Hi Mr. Kay, and others,

I've implemented your suggestion of passing in a XdmValue(IEnumerable) as a parameter and it appears that this way has a different result then when passing in the following parameter value in a Stylus Studio scenario:
    document(" file:///c:/Resources/blah1.xml") | document("file:///c:/Resources/blah2.xml")

For example let's say a node-sequence is created that consists of a comment node, and two elements named "Books".  And this node-sequence is set to the parameter "bookSets"
    <!-- this XML was created by Joe -->
    <Books Genre="Mystery">...</Books>
    <Books Genre="Science Fiction">...</Books>

The following two copy-of elements show how I have to reference the node-sequence differently between Saxon.Net and Saxon via Stylus Studio.

With Saxon.Net...
    <xsl:copy-of select="$bookSets/Books[@Genre = $genreName]"/>

With Saxon via Stylus Studio...
    <xsl:copy-of select="$bookSets[@Genre = $genreName]"/>

Notice the addition "/Books" with the XPath for Saxon.Net.  It is as if the context is slightly different.  Do you have any suggestions on how I can set the parameter in a consistent way between the two different versions?

Thanks,
John




On 12/27/06, Michael Kay <mike@saxonica.com> 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.
 
Regards,
 
Michael Kay
http://www.saxonica.com/
 


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of John Cavalieri
Sent: 27 December 2006 21:08
To: saxon-help@lists.sourceforge.net
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(?????

Thanks,
John

--
John Cavalieri
john.cavalieri at gmail.com

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help





--
John Cavalieri
john.cavalieri@gmail.com