顧客ごとの請求書の合計を考え出す方法が必要です。(3つの請求書を追加し、それに応じて合計を表示します)、sum(/ * /(PriceUnit * Ordered))を試しましたが、機能しないエラーです。 、.---[請求書の合計=PriceUnit * Ordered] ,. 3つの請求書を合計して結果を表示します。私にとっては大変なので、助けてください
サンプル入力ドキュメント
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Nom.xslt"?>
<customers>
<customer>
<clientname>troy madison</clientname>
<invoices>
<invoiceDate>8/8/98</invoiceDate>
<product>
<PriceUnit>1000</PriceUnit>
<Ordered>2</Ordered>
</product>
<product>
<PriceUnit>5400</PriceUnit>
<Ordered>3</Ordered>
</product>
</invoices>
<invoices>
<invoiceDate>1/4/98</invoiceDate>
<product>
<PriceUnit>300</PriceUnit>
<Ordered>4</Ordered>
</product>
<product>
<PriceUnit>6000</PriceUnit>
<Ordered>1</Ordered>
</product>
</invoices>
<invoices>
<invoiceDate>03/5/99</invoiceDate>
<product>
<PriceUnit>549</PriceUnit>
<Ordered>1</Ordered>
</product>
<product>
<PriceUnit>320</PriceUnit>
<Ordered>2</Ordered>
</product>
</invoices>
</customer>
<customer>
<clientname>Morris</clientname>
<invoices>
<invoiceDate>1/1/00</invoiceDate>
<product>
<PriceUnit>59</PriceUnit>
<Ordered>3</Ordered>
</product>
<product>
<PriceUnit>55</PriceUnit>
<Ordered>1</Ordered>
</product>
</invoices>
<invoices>
<invoiceDate>11/1/01</invoiceDate>
<product>
<PriceUnit>10</PriceUnit>
<Ordered>2</Ordered>
</product>
<product>
<PriceUnit>54</PriceUnit>
<Ordered>1</Ordered>
</product>
</invoices>
<invoices>
<invoiceDate>03/2/01</invoiceDate>
<product>
<PriceUnit>30</PriceUnit>
<Ordered>1</Ordered>
</product>
<product>
<PriceUnit>299</PriceUnit>
<Ordered>1</Ordered>
</product>
</invoices>
</customer>
</customers>
期待される出力
[ここに期待される出力を一覧表示するOP。]
これまでに試したスタイルシート
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="customers">
<html>
<head>
<h1>CUSTOMER REFERENCE</h1>
</head>
<body bgcolor="#DAF52C">
<table border="1">
<tr>
<th width="50">NAME</th>
<th width="50">INVOICE DATE</th>
<th width="50">PRODUCT UNIT</th>
<th width="50">ORDERED </th>
<th width="50">PRODUCT UNIT</th>
<th width="50">ORDERED </th>
<th width="50">INVOICE DATE</th>
<th width="50">PRODUCT UNIT</th>
<th width="50">ORDERED </th>
<th width="50">PRODUCT UNIT</th>
<th width="50">ORDERED </th>
<th width="50">INVOICE DATE</th>
<th width="50">PRODUCT UNIT</th>
<th width="50">ORDERED </th>
<th width="50">PRODUCT UNIT</th>
<th width="50">ORDERED </th>
<th width="50">INVOICE TOTAL</th>
</tr>
<xsl:for-each select="customer">
<tr>
<td><xsl:value-of select="clientname"/></td>
<xsl:for-each select="invoices">
<td><xsl:value-of select="invoiceDate"/></td>
<xsl:for-each select="product">
<td><xsl:value-of select="PriceUnit"/></td>
<td><xsl:value-of select="Ordered"/></td>
</xsl:for-each>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>