我有以下 XML:
<item>
<title>Testing WebForm</title>
<link>http://linkurlhere.com</link>
<description>
<div class="field field-name-body field-type-text-with-summary
field-label-hidden"><div class="field-items"><div class="field-item even"
property="content:encoded"><div style="background-color: white; width: 100%;">
<div id="prize" style="background-color: yellow; color: #660000; font-weight:
bold; width: 200px;">Prize here</div>
</div>
<div id="startDate">Start Date: January 1, 2013</div>
<div id="endDate">End Date: January 1, 2014</div>
<p></p>
<p>Thanks for playing please take the survey - mock intro</p>
</div></div></div></description>
</item>
我需要显示<description>
节点的 div id=prize。
有没有办法使用 xsl:value-of 访问它?
这些项目将有 n 个,所以我想将它们放在 xsl:for-each 中
所以它看起来像这样:
<xsl:for-each select="item">
display value of <description><div id="prize">content</div></description>
</xsl:for-each>
任何想法将不胜感激。