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

Re: Passing variables into XSLT via parameters ... can

Subject: Re: Passing variables into XSLT via parameters ... can't get it to work
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 24 May 2006 09:52:08 +0100
xslt passing string parameter
> $parameters is defined as a string passed in from the processor, and my 
> understanding was that I needed to coerce to a node set explicitly; 

you can't siumply coerce from a string to a node set you need to parse
the string with an XML parser. xx:node-set() does not take a string as
an input it takes a result tree fragment (which is more or less the same
thing as a node set in any case, and in XSLT2 _is_ the same thing, so
xx:node-set() is no longer needed in XSLT2)


> This may not be the ideal way to do it; What I was hoping to achieve was 
> a way to pass in arbitrary variables without having to hardcode variable 
> names into the stylesheet and preferably avoiding having to make 2 

That's fine but you need to pass in a node set (ie a parsed document0
not a string.

> I haven't seen any way to pass a parsed document node into libxslt, 
You can always just pass in the file name as a string parameter and then
use select="document($filename)/whatever"

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.