ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
Re: [xsl] Looping over a CSV in XSL
by Joerg Pietschmann other posts by this author
Nov 20 2001 9:37AM messages near this date
Re: [xsl] msxml. how to distribute it? | [xsl] apply-templates - wrap
"Khan, Amir" <amkhan@[...].com>  wrote:
>  I have a problem such that I call a transform engine and for the XSL I set
>  one of the parameters to be a CSV.

If you want only test whether a string in a token in the CSV you can
skip all the fancy parsing an stick to using contains(), you'll only
have to include the delimiters to avoid spurious substring matches:

  <xsl:variable name="normalized-csv"
    select="concat(',',translate($param,' ',''),',')"/> 

  <xsl:if test="contains($normalized-csv,concat(',',$value,','))"> 
   ...

You'll have to prepend/append a comma so that the test will also
find the first and the last value in the CSV.

HTH
J.Pietschmann

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved