xsl-list
[Top] [All Lists]

Re: [xsl] Passing variables into XSLT via parameters ... can't get it to work

2006-05-24 01:54:02

$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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--