[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Need advise on filtering XSL

Subject: Re: Need advise on filtering XSL
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 28 Jan 2003 16:21:15 GMT
xsl dynamic translate text
  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.