[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|