1
所以我從創建的XML文件創建網頁。它是來自Hearthstone的所有卡片及其屬性的列表。XSLT正在向HTML圖像元素添加附加字符
當涉及到圖像時,有人可以解釋爲什麼我的xsl轉換將字符數據添加到我的img內容輸出的尾部和尾部?它甚至在我使用本地圖像時也會這樣做。我正在使用jEdit。
XML:
<Image_URL>
<regular>
http://hydra-media.cursecdn.com/hearthstone.gamepedia.com/thumb/3/37/Abomination%28597%29.png/184px-Abomination%28597%29.png?version=9e47af5b792479ac6617cb30bf7da8a4
</regular>
<gold>
http://hydra-media.cursecdn.com/hearthstone.gamepedia.com/thumb/1/10/Abomination%28597%29_Gold.png/184px-Abomination%28597%29_Gold.png?version=a340c375a36e6c10eec4a747a3170901
</gold>
</Image_URL>
XSL:
<xsl:template match="regular">
<p>
<img src="{.}"/>
</p>
</xsl:template>
輸出:
<img src="%0A%09%09%09http://hydra-media.cursecdn.com/hearthstone.gamepedia.com/thumb/3/37/Abomination%28597%29.png/184px-Abomination%28597%29.png?version=9e47af5b792479ac6617cb30bf7da8a4%0A%09%09%09"></p>
大聲笑!咄!謝謝!我不知道我在感謝什麼。 – iJakeUjake 2014-12-08 03:21:33