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

Re: Multiple Filtering of rows based on attributes val

Subject: Re: Multiple Filtering of rows based on attributes values
From: Jagdishwar B <jagdishwar.beemanati@xxxxxxxxx>
Date: Fri, 15 May 2009 18:49:03 +0530
Re:  Multiple Filtering of rows based on attributes val
Hi Kamlesh,

can you try below xslt:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl">
	<xsl:output indent="yes" method="xml" encoding="UTF-8"
omit-xml-declaration="yes"/>
	<xsl:template match="/">
		<SQLXMLExport>
			<xsl:apply-templates/>
		</SQLXMLExport>
	</xsl:template>
	<xsl:template match="Rows">
		<Rows>
			<xsl:apply-templates select="Row"/>
		</Rows>
	</xsl:template>
	<xsl:template match="Row">
		<xsl:copy-of select="."/>
		<xsl:if test="./Field[@alias='ITEM_CODE']='PENEMR'">
			<xsl:variable name="ProdDeptId" select="./Field[@alias='PROD_DEPT_ID']"/>
			<xsl:variable name="numberOfArtpays"
select="count(/Rows/Row[./Field[@alias='ITEM_CODE']='ARTPAY' and
./Field[@alias='PROD_DEPT_ID']=$ProdDeptId])"/>
			<xsl:choose>
				<xsl:when test="$numberOfArtpays=0">
				<xsl:comment>Inserting new Row element</xsl:comment>
					<Row>
						<Field alias="ITEM_CODE">ARTPAY</Field>
						<Field alias="PENSIONALBE">N</Field>
						<Field alias="PROD_DEPT_ID">
							<xsl:value-of select="$ProdDeptId"/>
						</Field>
					</Row>
				</xsl:when>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>

-- 

Jagdishwar B.

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.