[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

Subject: How to robustly handle mutiple condition inputs in Xslt format( Previously Re:Re:How to create variable element from a couple of strings).
From: "Yang" <sfyang@xxxxxxxxxxxxx>
Date: Fri, 25 May 2001 16:37:33 +0800
xslt condition statement
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


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.