0
我想下面的谷歌基地XML转换:使用此XSLTXSLT转换
http://feeds.omgeu.com/data/xslt/savingsdirect.xml
:
http://feeds.omgeu.com/data/xslt/savingsdirect.xslt
我努力让这个正常工作。我已经声明了g:命名空间,但我似乎无法再取得进展。任何帮助赞赏。
谢谢
我想下面的谷歌基地XML转换:使用此XSLTXSLT转换
http://feeds.omgeu.com/data/xslt/savingsdirect.xml
:
http://feeds.omgeu.com/data/xslt/savingsdirect.xslt
我努力让这个正常工作。我已经声明了g:命名空间,但我似乎无法再取得进展。任何帮助赞赏。
谢谢
您解析的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">
非常感谢。这解决了它! –