Re: [xsl] Need advise on filtering XSL

Subject: Re: [xsl] Need advise on filtering XSL
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 28 Jan 2003 16:21:15 GMT
  this is stunning -- it works beautifully! FYI, the $filterstmt variable is of the following form and contains dynamic elements, which is why xalan:evaluate is used:

  (column[((@name='AccountNumber') and (contains(translate('735050C',
  'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
  translate(text(), 'abcdefghijklmnopqrstuvwxyz',
  'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))))]) 


it depends if the form is variable or if its just the column and text
that varies. In the latter case you don't need evaluate()

if the thing is to filter on a specified column, those entries whose
character data is a substring of a given string (case insensitive) then


<xsl:param name="colname" />
<xsl:param name="filterstr" />

then...

select="
DataRow[column[@name=$colname]
              [contains(translate($filterstr,'ABC..','abc..'),
                        translate(text(),'ABC..','abc..'))]
"


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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


Current Thread