我正在尝试使用XSL将rss源转换为Access数据库,这是我的代码:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<rss>
<xsl:apply-templates select="rss/channel"/>
</rss>
</xsl:template>
<xsl:template match="rss/channel">
<xsl:variable name="title" select="title"/>
<xsl:variable name="link" select="link"/>
<xsl:variable name="description" select="description"/>
<channelTitle>
<xsl:value-of select="title"/>
</channelTitle>
<channelDesc>
<xsl:value-of select="description"/>
</channelDesc>
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
<xsl:variable name="item_link" select="link"/>
<xsl:variable name="item_title" select="description"/>
<item>
<xsl:for-each select="item_link">
<xsl:value-of select="title"/>
</xsl:for-each>
</item>
</xsl:template>
</xsl:stylesheet>
基本上我想要做的是循环显示所有项目并在每个条目上显示通道(我不知道如何在访问中创建rss的通道和项目元素之间的关系:S )
如果有人能指出我正确的方向那么一切都会好的
感谢