如何獲取xsl模板中xml節點的屬性xlink:href
的值?獲取使用xsl命名爲xlink:href的xml屬性
我有這樣的XML節點:「‘的XLink’沒有定義前綴」
<DCPType>
<HTTP>
<Get>
<OnlineResource test="hello" xlink:href="http://localhost/wms/default.aspx"
xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" />
</Get>
</HTTP>
</DCPType>
當我嘗試以下XSL,我得到一個錯誤說:
<xsl:value-of select="DCPType/HTTP/Get/OnlineResource/@xlink:href" />
當我試試這個簡單的屬性,它的工作原理:
<xsl:value-of select="DCPType/HTTP/Get/OnlineResource/@test" />
很好的問題(+1)。查看我的答案以獲得其他解決方案。 :) – 2010-05-06 13:05:16