1つの受注を持つXMLがあり、受注は3つの受注です。私は後の午前出力は、繰り返しノードでのxslトランスフォームに失敗しました
|Line No | Description | Qty
-----------------------------
| 1 | Product A | 5
| 2 | Product B | 10
| 3 | Product C ! 7
-----------------------------
などの表では、しかし、私が達成何
|Line No | Description | Qty
-----------------------------
| 1 | Product A | 5
| 1 | Product A | 5
| 1 | Product A | 5
-----------------------------
(私はあまりテキストを供給している場合は申し訳ありませんが)、私は私のXML入力とフルの私のXSLなどが
です誰かが私の間違いを見つけたり、今後のアドバイスをすることができますか?
XML入力
<?xml version="1.0" encoding="UTF-8"?>
<SOQrySurcharge>
<SalesOrders Language="05" Language2="EN" CssStyle="" DecFormat="1" DateFormat="01" Role="01" Version="6.1.083" OperatorPrimaryRole=" ">
<Order>
<CustomerPoNumber>7000654438</CustomerPoNumber>
<SalesOrder>003411</SalesOrder>
</Order>
</SalesOrders>
<SorDetail Language="05" Language2="EN" CssStyle="" DecFormat="1" DateFormat="01" Role="01" Version="6.1.025" OperatorPrimaryRole=" " xmlns:SALARE="SALARE" xmlns:SALSLS="SALSLS" xmlns:TBLART="TBLART" xmlns:SALBRN="SALBRN" xmlns:TBLCUR="TBLCUR">
<SalesOrder>003411</SalesOrder>
<CustomerName>Siemens</CustomerName>
<HeaderText>
</HeaderText>
<SalesOrderLine>
<Merchandise>
<SalesOrderLine> 1</SalesOrderLine>
<MStockCode>11</MStockCode>
<MStockDes>Low Temp SG Surcharge</MStockDes>
<MShipQty> 4.100</MShipQty>
<MPrice> 121.72000</MPrice>
<OrderLineValue> 499.05</OrderLineValue>
</Merchandise>
</SalesOrderLine>
<SalesOrderLine>
<Merchandise>
<SalesOrderLine> 2</SalesOrderLine>
<MStockCode>1</MStockCode>
<MStockDes>Grey Iron Surcharge</MStockDes>
<MShipQty> 0.264</MShipQty>
<MPrice> 137.63000</MPrice>
<OrderLineValue> 36.33</OrderLineValue>
</Merchandise>
</SalesOrderLine>
<SalesOrderLine>
<Merchandise>
<SalesOrderLine> 3</SalesOrderLine>
<MStockCode>13</MStockCode>
<MStockDes>Ferritic SG + Mo Surcharge</MStockDes>
<MShipQty> 15.155</MShipQty>
<MPrice> 155.07000</MPrice>
</Merchandise>
</SalesOrderLine>
</SorDetail>
</SOQrySurcharge>
XSLスクリプト
<?xml version="1.0" encoding="Windows-1252" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:template match="/">
<html>
<head>
<title>Mestect Usage E-mail</title>
<style>
body {
}
h1 {
text-align: left;
color: #221076;
font-size: 40px;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
font-weight: bold;
}
.def-container {
border: 2px solid black;
margin: 0 0 3px 0;
width: 70%;
background-color: #FFA500;
}
.heading {
display: inline;
color: black;
font-size: medium;
font-family: Verdana, sans-serif;
font-weight: bold;
}
.headingvalue {
display: inline;
color: black;
font-size: medium;
font-family: Verdana, sans-serif;
}
</style>
</head>
<body>
<p> The following orders have been created by dataswitch in Syspro Company R</p>
<h1>Auto created Material Surcharges</h1>
<div class="def-container">
<div class="heading">Customer Purchase Order: </div>
<div class="headingvalue">
<xsl:value-of select="//CustomerPoNumber" />
</div>
<div class="heading">Customer: </div>
<div class="headingvalue">
<xsl:value-of select="//CustomerName" />
</div>
<div class="heading">Syspro Order: </div>
<div class="headingvalue">
<xsl:value-of select="//SalesOrder" />
</div>
<table border="1">
<tr>
<th>Surcharge Type</th>
<th>Surcharge Amount</th>
<th>Tonnes</th>
<th>Line Value</th>
</tr>
<xsl:for-each select="//Merchandise">
<tr>
<td>
<xsl:value-of select="//MStockDes" />
</td>
<td>
<xsl:value-of select="//MPrice" />
</td>
<td>
<xsl:value-of select="//MShipQty" />
</td>
<td>
<xsl:value-of select="//OrderLineValue" />
</td>
</tr>
</xsl:for-each>
</table>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
は最後に、あなたはこのような//Merchandise
などの表現を自由に使用することを行った結果
<html>
<head>
<title>Mestect Usage E-mail</title>
<style>
body {
}
h1 {
text-align: left;
color: #221076;
font-size: 40px;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
font-weight: bold;
}
.def-container {
border: 2px solid black;
margin: 0 0 3px 0;
width: 70%;
background-color: #FFA500;
}
.heading {
display: inline;
color: black;
font-size: medium;
font-family: Verdana, sans-serif;
font-weight: bold;
}
.headingvalue {
display: inline;
color: black;
font-size: medium;
font-family: Verdana, sans-serif;
}
</style>
</head>
<body>
<p> The following orders have been created by dataswitch in Syspro Company R</p>
<h1>Auto created Material Surcharges</h1>
<div class="def-container">
<div class="heading">Customer Purchase Order: </div>
<div class="headingvalue">7000654438</div>
<div class="heading">Customer: </div>
<div class="headingvalue">Siemens</div>
<div class="heading">Syspro Order: </div>
<div class="headingvalue">003411</div>
<table border="1">
<tr>
<th>Surcharge Type</th>
<th>Surcharge Amount</th>
<th>Tonnes</th>
<th>Line Value</th>
</tr>
<tr>
<td>Low Temp SG Surcharge</td>
<td> 121.72000</td>
<td> 4.100</td>
<td> 499.05</td>
</tr>
<tr>
<td>Low Temp SG Surcharge</td>
<td> 121.72000</td>
<td> 4.100</td>
<td> 499.05</td>
</tr>
<tr>
<td>Low Temp SG Surcharge</td>
<td> 121.72000</td>
<td> 4.100</td>
<td> 499.05</td>
</tr>
</table>
</div>
</body>
</html>
問題を実証するために必要な最低限の例を減らしてください - 参照:[mcve] –
ありがとうございました。初心者として、私はいつも重要なビットを残して怖がっていた..悲しい –