1
私たちはSSRSからXSLT/HTMLへのいくつかのレポートの移動に取り組んでいますが、私は以下のことを正しく行う方法に固執しています。基本的には<itemid>
と<location>
がたくさんありますが、どのようにループするのか分かりません。これをHTML/XSLTで行う方法は?
<CombinedResults>
<Results>
<Result>
<itemid> GAC Test 2</itemid>
<displayname> GAC Test 2</displayname>
<salesdescription/>
<inventorylocation>4</inventorylocation>
<locationquantityavailable>10</locationquantityavailable>
<locationquantitybackordered/>
</Result>
<Result>
<itemid> GAC Test 2</itemid>
<displayname> GAC Test 2</displayname>
<salesdescription/>
<inventorylocation>2</inventorylocation>
<locationquantityavailable>180</locationquantityavailable>
<locationquantitybackordered/>
</Result>
</Results>
</CombinedResults>
私のXSLTは、以下のように見えますが、唯一のではなく、すべての場所のための項目を示す、1つの項目と1場所を示しています:
<xsl:template match="/CombinedResults">
<html>
<head>
<link rel="stylesheet" type="text/css" href="SOMESTYLESHEET"/>
</head>
<body>
<table>
<tr>
<th>Item ID</th>
<th>Location Available</th>
</tr>
<tr>
<td><xsl:value-of select="Results/Result/itemid"/></td>
<td><xsl:value-of select="Results/Result/inventorylocation"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
私もしましたが、私のXML結果は以下のようになります私は近くにいると思ったが、うまくいかないと思った。
<xsl:template match="/CombinedResults">
<html>
<head>
<!-- URL must have ampersands replaced with & -->
<link rel="stylesheet" type="text/css" href="SOMECSS"/>
</head>
<body>
<table>
<tr>
<th>Item ID</th>
<th>Location Available</th>
</tr>
<tr>
<!--
<td><xsl:value-of select="Results/Result/itemid"/></td>
<td><xsl:value-of select="Results/Result/inventorylocation"/></td>
-->
<xsl:for-each select="Results/Result/">
<td><xsl:value-of select="itemid"/></td>
</xsl:for-each>
</tr>
</table>
</body>
</html>
</xsl:template>
何か助けてくれれば大歓迎です!
あなたのXMLには、 ''タグはありません... XMLとXSLTが実際に一致するようにしてください –
また、_desired_出力を表示してください –