已經通過StackOverflow和其他網站查看此答案。基本:使用XML和XSLT顯示圖像
大多數問題涉及我沒有使用的代碼,我正在尋找一個簡單形式的問題的答案。我想要回答最基本的,最基本的,做這種事情的方法。這兩個文件沒有比我在這裏發佈的更多。所有文件,xml,xsl和圖像都在同一個目錄中。
我的XML代碼。
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="image_experiment.xsl"?>
<root>
<my_content>
<p>IMAGE FOR TESTING XML ONLY</p>
<image>
sizes_1-6.gif
</image>
</my_content>
</root>
我的XSL文件
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="root">
<xsl:template match="image">
<img src="{@image}"/>
<xsl:apply-templates/>
</xsl:template>
</xsl:template>
</xsl:stylesheet>
那麼什麼是你的問題,以顯示實際圖像的XSLT? – stuartd