我正在尝试创建和应用图像模板,但没有得到任何显示。我是新手,但我已经尝试了一段时间,似乎找不到我在哪里犯了错。这是我创建的图像模板的视图,并尝试在根模板中应用。
<body>
<div id="logo">
<xsl:apply-templates select="rss/channel/image" />
</div>
<xsl:template match="image">
<a href="{image/link}">
<img src="{image/url}" alt="{image/title}" width="{image/width}" height="{image/height}" longdesc="{image/description}" />
</a>
</xsl:template>发布于 2013-07-13 01:46:02
您应该发布一个XML结构的示例,但是您可能希望
<xsl:template match="image">
<a href="{link}">
<img src="{url}" alt="{title}" width="{width}" height="{height}" longdesc="{description}" />
</a>
</xsl:template>假设你有
<image>
<title>image title<title>
<url>foo.png</url>
<width>200</width>
...
</image>https://stackoverflow.com/questions/17620874
复制相似问题