[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: dynamic variable name/implementation question
On 8/26/05, Nathan Young <natyoung@xxxxxxxxx> wrote: > Hi. > > I agree that the nodeset solution offered below is the most flexible > solution (you can pass one in or load one with the document() function). > Parsers differ in the way they handle this; using LibXML with perl I use > the document function but haven't figured out how to pass a DOM as a param. > > However, the way you describe passing things in using parameters > constrains you to a fixed set of params defined in your stylesheet so you > could go with a choose block in your template match. Not at all. The passed nodeset may contain elements with arbitrary names. you get access to whatever parameter you need with something like this: $pEnvironment[name() = 'myparamName'] In case you don't want the parameter name ('myparamName') fixed in the stylesheet, it itself may be passed as a parameter to the stylesheet. One way to implement dynamically created variables (such as in a simple calculator) is described here: http://www.mulberrytech.com/Extreme/Proceedings/html/2003/Novatchev01/EM L2003Novatchev01.html#t3.6 Cheers, Dimitre Novatchev
|
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
|