xsl-list
[Top] [All Lists]

RE: Need advise on filtering XSL

2003-01-28 12:44:20
I want to ask a follow-up question related to the dynamic evaluation of the 
$filterstmt variable in my code. I have changed my XSL as suggested by Jarno 
below and it works just as expected (great, that is). Now when I apply a 
filtering expression like the one below, for about 3000 rows of data this 
operation takes about 2 minutes, which seems quite slow. Is this a problem with 
the xalan evaluate call? The data is in the structure that I outlined in my 
initial mail, and there are about 40 or so columns per row.

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

The machine that this is running on is an older Sun Ultra-4 running Solaris 8 
and having 3 GB of physical memory plus about 10 GB virtual memory. Everything 
is runner under Websphere 3.5 (soon to be Weblogic 6 or 7).

Thanks
Jan

-----Original Message-----
From: Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:xalan="http://xml.apache.org/xalan";
                exclude-result-prefixes="xalan">

<xsl:strip-space elements="DataSet ResultSet ResultSetMetaData DataRow column"/>

<xsl:param name="filterstmt"/>

<xsl:template match="DataSet">
  <xsl:copy>
    <xsl:copy-of select="ResultSetMetaData" />
    <xsl:choose>
      <xsl:when test="'ALL' = $filterstmt">
        <xsl:copy-of select="DataRow" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="DataRow[xalan:evaluate($filterstmt)]" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:copy>
</xsl:template>

</xsl:stylesheet>

This message is for the named person's use only. It may contain sensitive and 
private proprietary or legally privileged information. No confidentiality or 
privilege is waived or lost by any mistransmission. If you are not the intended 
recipient, please immediately delete it and all copies of it from your system, 
destroy any hard copies of it and notify the sender. You must not, directly or 
indirectly, use, disclose, distribute, print, or copy any part of this message 
if you are not the intended recipient. CREDIT SUISSE GROUP and each legal 
entity in the CREDIT SUISSE FIRST BOSTON or CREDIT SUISSE ASSET MANAGEMENT 
business units of CREDIT SUISSE FIRST BOSTON reserve the right to monitor all 
e-mail communications through its networks. Any views expressed in this message 
are those of the individual sender, except where the message states otherwise 
and the sender is authorized to state them to be the views of any such entity.
Unless otherwise stated, any pricing information given in this message is 
indicative  only, is subject to change and does not constitute an offer to deal 
at any price quoted. Any reference to the terms of executed transactions should 
be treated as  preliminary only and subject to our formal written confirmation.



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