我的Google网站地图通过XSLT可以很好地呈现,并且
XML
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>{site_url}</loc> <lastmod>{current_time format="%Y-%m-%d"}</lastmod> <changefreq>monthly</changefreq> <priority>0.5</priority> </url> </urlset>
XSL
<xsl:template match="/">
<html>
<body>
<h2>Sitemap</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Location</th>
<th>Last Modified</th>
<th>Update Frequency</th>
<th>Priority</th>
</tr>
<xsl:for-each select="urlset/url">
<tr>
<td><xsl:value-of select="loc"/></td>
<td><xsl:value-of select="lastmod"/></td>
<td><xsl:value-of select="changefreq"/></td>
<td><xsl:value-of select="priority"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
我的Google网站地图通过XSLT可以很好地呈现,并且
我的Google Sitemap通过 XSLT罚款而没有
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
但是在<urlset>
元素中 当包含时,我的foreach语句 不起作用,什么也没有渲染 模板
xpath将需要名称空间作为前缀,例如