This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: parameters to xsl file


You should use xsl:variable tag and set the value of id from some script and
u can put the select statement as
<xsl:for-each select = "/root/program/@id=$variable">
That will do it.
Best of luck.
-----Original Message-----
From: Laura Jenkins [mailto:xsl_list@hotmail.com]
Sent: Monday, March 18, 2002 4:38 PM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] parameters to xsl file



hello

I have a doubt.
I have an xsl that has to run on a condition..
for example

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">

<xsl:for-each select = "/root/program/@id='VARYING_ID'">
.. DO SOME STUFF..
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
i have to run this xsl based on the id which could be varying..
and this id is not from xml file..
is there a way that i pass on this id as a parameter to xsl file(quite weird

??? ) like the command line argument??

or some way that xsl knows about this variable. i basically want the similar

behaviour of passing on a parameter to a batch file

i am thinking of a way that would be to give these varying ids( which are 
actuallyfixed in number ) in a property file kind of a file( which would be 
an xml file) and then make my xsl read this xml through import..

so if i have and xml file( the id defining xml file ) which looks like
<definingids>
<var id = 1>varid1</var>
<var id = 2>varid2</var>
<var id = 3>varid3</var>
</definingids>

and i run xsl for each definingids/var .. Is it a right approach or is there

any other way to do this?
laura

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]