This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Looping over a CSV in XSL
- From: Joerg Pietschmann <joerg dot pietschmann at zkb dot ch>
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 20 Nov 2001 10:37:33 +0100
- Subject: Re: [xsl] Looping over a CSV in XSL
- Organization: ZKB
- Reply-to: xsl-list at lists dot mulberrytech dot com
"Khan, Amir" <amkhan@lehman.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