[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: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 28 Jan 2003 17:15:16 +0200
RE:  Need advise on filtering XSL
Hi,

> Hello all! This is my first post and unfortunately quite a 
> big one as well. I am looking at the following XSL that has 
> been written by someone else and am trying to understand 
> certain parts of it. First and foremost, as you can see in 
> the comments the output method has been set to text so that 
> < and > would be treated properly.

It appears the person who wrote this in the first place didn't know XSLT. Anyhow, the following will do the job

<?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>

Depending on what the value of $filterstmt is, you maybe be able to write the stylesheet without using the xalan:evaluate.

Cheers,

Jarno - Dulce Liquido: Psicosis

 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.