我想对 xml 进行排序
我的xml格式是
<OTA_HotelAvailRS xmlns="http://www.opentravel.org/OTA" EchoToken="" SequenceNmbr="1" Target="Production" TimeStamp="2012-09-28T08:29:44Z" Version="1">
<SummaryResponse>
<AdditionalDetails>
<AdditionalDetail Amount="212,20 EUR" Code="TotalPackagePrice" CurrencyCode="EUR" DecPart="20" IntPart="212" Type="PackageInformation"></AdditionalDetail>
</AdditionalDetails>
</SummaryResponse>
<SummaryResponse>
<AdditionalDetails>
<AdditionalDetail Amount="212,20 EUR" Code="TotalPackagePrice" CurrencyCode="EUR" DecPart="20" IntPart="500" Type="PackageInformation"></AdditionalDetail>
</AdditionalDetails>
</SummaryResponse>
</OTA_HotelAvailRS>
我正在使用的 XSL 是
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="OTA_HotelAvailRS">
<xsl:copy>
<xsl:apply-templates select="SummaryResponse/AdditionalDetails">
<xsl:sort select="AdditionalDetail/@IntPart" data-type="number" order="descending"/>
</xsl:apply-templates>
Value of :<xsl:value-of select="AdditionalDetail/@IntPart" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
我想使用 AdditionalDetail 的 IntPart 属性进行排序。
请有人帮助我