RE: Passing parameters to xsl
Modifying the DOM is one way. Another that I use is dynamic entity references. Take a look at: http://xdev.datachannel.com/press/lounge.html The example is in Java & uses the DataChannel XML parser, but the ideas are applicable to other parsers & programming languages. Mike D DataChannel -----Original Message----- From: Joseph Alex [mailto:alex_jos@xxxxxxxxxxx] Sent: Saturday, May 01, 1999 5:53 AM To: xsl-list@xxxxxxxxxxxxxxxx Subject: Re: Passing parameters to xsl Hi, I had this problem sometime back and these are my solutions to this problem. Am not sure whether this would solve your problems or whether they are absolutely correct. Anyway here it goes.. I am using IE5, IIS etc, for both client and server side combination of XML and XSL using ASPs. Since the XSL is used only during transformation, you really can't pass parameters to XSL. The only way to counter this would be dynamically generate XSL based on the requirements or have multiple XSLs ready if that is feasible, both of which I have tried successfully. Another way which I used extensively in my program was to manipulate the XML DOM using the ASP scripts. Depending on the parameter or whatever, when ASP processes XML and XSL, I appended a child node to the XML DOM object and the XSL has the code in it to check which parameter it has etc and do the necessary action. And of course, XSL can certainly call the functions in the ASP later which could alter the DOM, or whatever. In fact, I implemented client side and server side sorting entirely doing this. Hope this helps. I don't think there is a more direct way to do this, if anybody knows of any, please let me know. THanks, Alex >From: Sunil Jain <sujain@xxxxxxxxx> >Reply-To: xsl-list@xxxxxxxxxxxxxxxx >To: XSL-List@xxxxxxxxxxxxxxxx >Subject: Passing parameters to xsl >Date: Fri, 30 Apr 1999 14:01:35 -0600 > >Hi, > >is there any way to pass paramters to xsl so that it will behave >differently based on input parameters. >for example if I have following xml : ><customers> > <customer id="1"> > <name/> > </customer> > <customer id="2"> > <name/> > </customer> > <customer id="3"> > <name/> > </customer> ></customer> > >Now I want to generate three different html based on the parameter (1,2,3) >one for each customer id(1,2,3) > >Thanks in advance for responses. > >Sunil. > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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