XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Sharry StowellSubject: XSL Params inside When Test
Author: Sharry Stowell
Date: 20 Apr 2006 04:08 PM
Just wanna say, great program 'Stylus Studio' guys. Keep up the good work. :)

Hi, i have the following when statement, inside the test I'm tring to use '$rowNo' parameter inside the string, because I'm using a recursive loop. Everything else works great but I want to be able to join, 1, 2 & 3 together.

1) <xsl:when test="contains(substring(//helper/row/row
2) $rowNo
3) /text(), $helperNo,2), '--')">

<xsl:when test="contains(substring(//helper/row/row$rowNo/text(), $helperNo,2), '--')">

I've tried concat (dont work, comes up with NaN2 in the output):

<xsl:when test="contains(concat(substring(//helper/row/row,$rowNo,/text(), $helperNo,2)), '--')">

-----------------------------------------
Input:
//helper/row

<row num="1">
<row1>01020304--0506070809--10111213</row1>
<row2>14--------15----------16------</row2>
<row3>17------18------------19------</row3>
<row4>20------21--------2223--------</row4>
<row5>------24--------25------------</row5>
</row>


------------------

Any help much much appreicated.


Tried the following too:

<xsl:variable name="starter" select="'substring(//helper/row/row'" />
<xsl:variable name="finisher" select="'/text()'" />
<xsl:variable name="finisher2" select="',$helperNo,2)'" />

...
<xsl:value-of select="$starter+$rowNo+$finisher+$finisher2"/>
...


Doesn't work either! :(

PLEASE PLEASE PLEASE - Just want to know if this is possible really (and how if available).

Thank you.

Postnext
Minollo I.Subject: XSL Params inside When Test
Author: Minollo I.
Date: 20 Apr 2006 04:41 PM
You may want to try something like...

<xsl:when test="contains(substring(//helper/row/*[name() = concat('row',$rowNo)]/text(), $helperNo,2), '--')">

Posttop
Sharry StowellSubject: XSL Params inside When Test
Author: Sharry Stowell
Date: 20 Apr 2006 05:55 PM
Thanks Minollo, so will this do the same thing as:

1st loop)<xsl:when test="substring(//helper/row/row1/text(), $helperNo,2)"/>
2nd loop)<xsl:when test="substring(//helper/row/row2/text(), $helperNo,2)"/>
etc

Sorry my XSL/XPATH knowledge of predicates are not that strong.

Thanks

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.