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

filtering XML file using starts-with

Subject: filtering XML file using starts-with
From: "Dan" <dan@xxxxxxxxxxxxxxx>
Date: Thu, 18 Dec 2003 08:06:14 -0600
xsl starts with
I have an XML file with a very simple tree structure but many many rows of data.  I need to be able to filter this file based on the first few characters of one field (Module) such that if the filter criteria is 10 all rows where module is 10 or 101 or 1034 or 105673 etc etc are returned.  I think I can do with this with the starts-with function, but I am not sure how ot include this criteria in my match statement?  Here is the XSL file I am using, any suggestions are greatly appreciated.  Also, any recomendations ona good reference book or site fo this kind of thing would be a huge help.  Thanx.


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--Declare Variables -->
<xsl:param name="OrderedBy" select="'Module'"/>
<xsl:param name="OrderedType" select="'ascending'"/>
<xsl:param name="sModule" select="''"/>
<xsl:param name="sIncumbentID" select="''"/>
<xsl:param name="sMember" select="''"/>
<xsl:param name="sApproval" select="''"/>
<xsl:param name="sInputType" select="''"/> 

<xsl:template match="/">
	<xsl:starts-with(Module, $sModule)>
	<xsl:for-each select="Sales/Summary">
	<xsl:sort select="*[name()=$OrderedBy]" order="{$OrderedType}" data-type="text"/>
	<tr>
	  <td><xsl:value-of select="Employee"/><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:value-of select="Module"/><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (ResignTotalQuota, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (ResignTotalObjective, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:value-of select="PercentResignTotal"/>%</td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (NewTotalQuota, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (NewTotalObjective, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:value-of select="PercentNewTotal"/>%</td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (StrategicTotalQuota, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (StrategicTotalObjective, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:value-of select="PercentStrategicTotal"/>%</td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (TotalTotalQuota, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:text>&#x24;</xsl:text><xsl:value-of select="format-number (TotalTotalObjective, '###,###,###,###.00')" /><xsl:text>&#xA0;</xsl:text></td>
	  <td><xsl:value-of select="PercentTotalTotal"/>%</td>
	</tr>
	</xsl:for-each>
	<tr>
		<td colspan="20" border="0"><xsl:value-of select="count(ServiceOrder)"/></td>
	</tr>
</xsl:template></xsl:stylesheet>

 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.