我有這樣的XSLT代碼XSLT創建一個新的XML文件
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title></title>
<link rel="stylesheet" href="css/xsl_style.css" type="text/css"/>
</head>
<body>
<div class="tableStyle" >
<table id="products_table">
<tbody>
<tr bgcolor="#B5E4EA">
<td>A/A</td>
<td>Product Name</td>
<td>Price</td>
<td>Corpration</td>
<td>Category</td>
</tr>
<xsl:variable name="allProducts" select="auction_products/product" />
<xsl:for-each select="$allProducts">
<xsl:sort select="category"/>
<xsl:variable name="pos" select="position()" />
<tr>
<td><xsl:value-of select="$allProducts[$pos]/count_products"/></td>
<td><a href="offer.php"><xsl:value-of select="product_name"/></a></td>
<td><a href="offer.php"><xsl:value-of select="price"/></a></td>
<td><a href="offer.php"><xsl:value-of select="corporation"/></a></td>
<td><a href="offer.php"><xsl:value-of select="category"/></a></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
,我想通過創建XSLT一個新的XML文件不可能做排序data.Is在XSLT版本1?我嘗試了xsl:document
但我沒有成功。
http://stackoverflow.com/questions/4036233/splitting-xml-into-multiple-files-with-xslt –
可能的重複我嘗試該解決方案,但沒有工作..我不想做它與xslt版本2. – user3071235
XSLT處理器不會因爲您「需要」某些內容而更改。正如Dimitre所說,這不能在純粹的XSLT 1.0中完成 - 只能使用EXSLT或XSLT 2.0('result-document')。 –