|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: comparison of attribute values
jdunning wrote:
Hi, What I would like to do is to insert a row into a table if there is a difference in an attribute value anywhere in the document; for example, this data should produce 2 columns (USD and EUR): It's a grouping problem. <xsl:key name="fee-currency" match="*[@currency and substring(local-name(),1,3)='fee']"
use="@currency"/> <xsl:template match="fees">
<table>
<tr>
<xsl:for-each select="key('fee-currency')/@currency">
<td><xsl:value-of select="."/></td>
</xsl:for-each>
</tr>
<xsl:for-each select="*/*[substring(local-name(),1,3)='fee']">
<tr>
<xsl:variable name="fee" select="."/>
<xsl:for-each select="key('fee-currency')/@currency">
<td>
<xsl:if test="$fee/@currency=.">
<xsl:value-of select="$fee/amount"/>
</xsl:if>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</xsl:template>(Beware: untested) Are you sure your fees are nemed fee1, fee2 rather than <fee name="fee1"> etc? J.Pietschmann 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
|

Cart








