2014-06-13 57 views

回答

1

您解析的Feed是Atom。看到文档元素的定义:

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0"> 

但是你的XSLT是缺少命名空间。您必须在XSLT中定义它:

<xsl:stylesheet 
    version="2.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:fn="http://www.w3.org/2005/xpath-functions" 
    xmlns:omg="http://feeds.omgadmin.co.uk/feeds/ns/1.0/" 
    xmlns:rss="http://feeds.omgeu.com/ns/1.0/" 
    xmlns:g="http://base.google.com/ns/1.0" 
    xmlns:atom="http://www.w3.org/2005/Atom"> 

并使用它从XML中获取Atom节点。

<xsl:template name="itemTemplate" match="atom:entry"> 
+0

非常感谢。这解决了它! –