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

Re: dynamic variable name/implementation question

Subject: Re: dynamic variable name/implementation question
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 26 Aug 2005 06:39:00 +1000
perl dynamic variable names
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

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.