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

Passing variable number of parameters to xsl file

Subject: Passing variable number of parameters to xsl file
From: Kim <kimba_40@xxxxxxxxx>
Date: Wed, 20 Mar 2002 23:51:48 -0800 (PST)
passing variables to xsl files
Hi, I need to be able to support a variable number of parameters.  I am
currently using Xalan v2.2.

For example, the user would invoke Xalan with parameters:
  
	-PARAM paramName1 paramValue1 -PARAM paramName2 paramValue2  ...
-PARAM paramNameN paramValueN
	(specific example: -PARAM autobrand1 ford -PARAM autobrand2 lexus
-PARAM tire1 goodyear -PARAM tire2 michellan)

where N could be for example 1...500.

Couple of Questions:

1) Is there a way to get the param count other than having it passed in
as something like: -PARAM numParams 500?
2) What I need to do is test a node's value against all of the
parameter values passed in.  Note that for each invocation N could be:
0, 1, 2, ..500.

I want to do something like:

	if (nodeValue match any of the paramValues of passed in)
	then
  		doSomething();
	endif

for each parameter "family" (ex. autobrand and tire mentioned above)

without being forced to have a set of fixed static hardcoded test
statements in the xsl like:

	if (nodeValue match $paramName1)
		doSomething()
	else if  (nodeValue match $paramName2)
		doSomething()
		...
	else if (nodeValue match $paramNameN)
		doSomething()
	endif

where doSomething() is the exact same function for all
nodeValue/paramValue matches.

I have some ideas concerning using key, <xsl:choose>, <xsl:when>,
temporary tree, <or> features, but am not sure which path is best to
proceed on.

Thank you,



=====
Kim

*************************
May the force be with you.
*************************

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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


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.