[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to robustly handle mutiple condition inputs in Xsl
Hi, Dimitre Your suggestion fullfills my intention indirectly. <xsl:value-of select="msxsl:node-set($tempVar)/variable[@name='x1']/@select"/> However, what I hope is able to dynamically generate a list of variable elements and they can be used liked regular variable expressions. May be the best approach I can do is to hard-wire these variables which are also pointed by mike brown. So I drive substring-before and substring-after function to explicitly list out the variables from the given **string*. such as: <xsl:variable name="x1" select="substring-before($string,',')" /> <xsl:variable name="x2" select="substring-before(substring-after($string,',' ),',')" /> <xsl:variable name="x3" select="substring-before(substring-after( substring-after($string, ',' ), ',' ),',')" /> <xsl:variable name="x4" select="substring-before(substring-after( substring-after( substring-after($string, ',' ), ',' ), ',' ), ',' )" /> ... <xsl:variable name="xn" select="substring-after(substring-after( substring-after( substring-after(--$string,-- ',' ), ',' ), ',' ), ',' )" /> But I am still looking for a better solution than this type of labour intensive work, if possible. The reason to keep variable value in a string is like this; I try to simulate the multiple WHERE terms in a db problem and wrapped all of the values from where condition into a string. It is then to be passed as a single augument of a Jscript funciton which will perform loading the xml and xsl file and a series of xproc.addParameter statement and then output the transform. All I want is to maintain a robust xslt code as much as possible. So any time when an new where condition term is required, the criteria value will be automatically wrapped into a string parameter , and I do not have to bother to make changes of the Jscript function in the terms of argument term and add a new addParameter statement etc. Is it a possible mission? Would you provide some insights how to handle multiple condition inputs robustly in a xslt format? Thanks for any help in advance. Sun-Fu Yang, sfyang@xxxxxxxxxxxxx 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
|