[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Passing a variable number of parameters?
> This leads me to the second part of my question, because > somebody could say "Why don't you try it out?". I need to > implement this in Javascript, and so far I haven't found a > way to create a NodeList that would be accepted by the XSL > processor (be it Gecko or MSIE) as valid parameter; I receive > "incompatibe type" errors. If you are struggling to create a node list to pass in as a parameter, two other solutions are: 1. Create an xml file out of your node-list and then reference that using the document() function. For example: params.xml <params> <param name="bar" value="baz"/> <param name="hello" value="world"/> </params/> Then use: <xsl:variable name="params" select="document('params.xml')"/> 2. Create your params as a well-formed string and then combine with the xml document (in also in string form) and then transform that. For example: var params = "<params> ..blah </params>"; var xmlDoc = "<root>" + params + original_xml_doc + "</root>"; (note the containing root element to keep everything well-formed) You can then access your parameters using: <xsl:variable name="params" select="/root/params"/> cheers andrew
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|