例如,下面的XML文件中:使用XSLT顛倒XML數據標籤?
<person>
<name>John</name>
<id>1</id>
<name>Diane</name>
<id>2</id>
<name>Chris</name>
<id>3</id>
</person>
在XSLT我的代碼:
<xsl:template match="person">
<xsl:apply-templates/>
</xsl:template>
所以,在HTML文件,它使得
John1Diane2Chris3
。
但是, 我需要下面的輸出: Diane2John1Chris3
我需要扭轉第一2個數據標記的順序。 以下是前2個標籤
<name>John</name>
<id>1</id>
<name>Diane</name>
<id>2</id>
任何創意人?
這是http://stackoverflow.com/questions/5572501/的重複how-to-reverse-xml-data-tags-using-xslt - 請參閱我的答案 – 2011-04-06 21:18:23