[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Nodesets as parameters

Subject: Nodesets as parameters
From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx>
Date: Tue, 23 Oct 2001 09:46:25 -0500
Hi all,

let me try this again.  I want to pass the XSL parser a parameter that is
nodeset.  I believe that in theory this should be possible?  I know
variables can be nodesets, I'm assuming parameters can also be nodesets?

Based on this assumption, I'm attempting to build a document fragment and
then call the parser:

                        org.apache.xalan.stree.DocumentFragmentImpl parmDoc
org.apache.xalan.stree.DocumentFragmentImpl( );
                        for( Enumeration pr = data.getValues();
pr.hasMoreElements(); )	// Get next parameter value
                            String prn = (String)pr.nextElement();
// Get the parameter name
                            Element parmE = parmDoc.createElement( prn );
// Create an element with that name
                            parmE.setAttribute( "value", data.getValue( prn
) );	// Set the value for the element
                            parmDoc.appendChild( parmE );
// Add the new element to the doc fragment
                        parmDoc.setComplete( true );

                        transformer.setParameter( "my-parms",
org.apache.xpath.objects.XNodeSet( parmDoc ) ); 

                        transformer.transform( xmlSource, new StreamResult(
response.getOutputStream( ) ) );

When I attempt to reference the resulting parameter the parse just hangs and
does not return.  

I suspect that either I should not be using a DocumentFragmentImpl or that
I'm missing something in the construction of the fragment.  The second
theory is somewhat validated by the fact that the call:


which should return the root value for the fragment returns a null value!
However, I see no way to add anything to the document fragment except by
using appendChild, so I don't see any way around this?

Anyone have any ideas?

Peter Hunsberger

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.