I'm confused by your question. You asked about how to pass in a sequence of two document nodes, now you are talking about passing in a sequence containing a comment and two elements. It's not clear to me what you are actually doing. If the expression
 
<xsl:copy-of select="$bookSets/Books[@Genre = $genreName]"/>
works, this suggests you are not passing in the sequence you describe, but rather a document or element node that contains this sequence as its children.
 
If you want to take the same approach as Stylus Studio you can always use the XPath API to evaluate an XPath expression and supply the result as the value of the XSLT parameter. But it won't be as efficient as constructing the value directly.
 
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: 02 January 2007 21:46
To: Mailing list for SAXON XSLT queries
Subject: Re: [saxon] DotNet setParameter w/ node-set

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