我正在尝试使用 xslt 访问每个节点的属性。但它没有用。需要为每个旅馆房间打印 shru 值。有人可以帮我吗???我
以下是我的 XML 响应。
<HotelRoom SHRUI="AqZE8Cw72fDfNL6X0hqQTQ==" availCount="10" onRequest="N">
<Board type="SIMPLE" code="BB-E10" shortname="BB">BED AND BREAKFAST</Board>
<RoomType type="SIMPLE" code="SGL-E10" characteristic="ST">SINGLE STANDARD</RoomType>
<Price>
<Amount>549.360</Amount>
</Price>
</HotelRoom>
下面是我的 XSLT。
<xsl:for-each select="hm:HotelRoom ">
<shrui>
<xsl:value-of select="hm:HotelRoom/@SHRUI"/>
</shrui>
<board>
<xsl:value-of select="hm:Board"/>
</board>
<roomtype>
<xsl:value-of select="hm:RoomType"/>
</roomtype>
<roomcode>
<xsl:value-of select="hm:RoomType/@code"/>
</roomcode>
<boardcode>
<xsl:value-of select="hm:Board/@code"/>
</boardcode>
<xsl:for-each select="hm:Price ">
<amount>
<xsl:value-of select="hm:Amount"/>
</amount>
</xsl:for-each>
</xsl:for-each>