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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.