0
我想在下面的格式来创建数据饲料中使用XSLT reformating,SSRS XML导出
<rss version="2.0">
<channel>
<Title>FeedTitle</Title>
<link>http://www.mydomain.com</link>
<description>My Products</description>
<item>
<Id>10890</Id>
<Title>Benetton 01</Title>
</item>
<item>
<Id>10700</Id>
<Title>Benetton 02</Title>
</item>
</channel>
</rss>
,但报表服务导出选项已产生以下XML数据文件不上谷歌商家中心工作。
<Report xsi:schemaLocation="pg_google_data_feed http://reportserver?%2Fpg_google_data_feed&rs%3AFormat=XML&rc%3ASchema=True" Name="pg_google_data_feed">
<Title>FeedTitle</Title>
<link>http://www.mydomain.com</link>
<description>My Products</description>
<ProductList>
<Details_Collection>
<Details>
<Id>10890</Id>
<Title>Benetton 01</Title>
</Details>
<Details>
<Id>10700</Id>
<Title>Benetton 02</Title>
</Details>
</Details_Collection>
</ProductList>
</Report>
如果任何机构告诉我将XML数据重新格式化为另一个xml文件需要哪种类型的XSLT会非常有帮助。
编辑:
步骤中使用以下代码1中创建的XSLT文件。
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" encoding="utf-8" />
<xsl:template match="Details">
<Details>
<xsl:for-each select="@*">
<xsl:element name="{name(.)}">
<xsl:value-of select="." />
</xsl:element>
</xsl:for-each>
</Details>
</xsl:template>
</xsl:stylesheet>
第2步:设置报表的属性设置为 “datafeed.xslt”
而不应用XSLT到我的SSRS报告结果显示如下,
<Report xsi:schemaLocation="pg_google_data_feed http://reportserver?%2Fpg_google_data_feed&rs%3AFormat=XML&rc%3ASchema=True" Name="pg_google_data_feed">
<Title>FeedTitle</Title>
<link>http://www.mydomain.com</link>
<description>My Products</description>
<ProductList>
<Details_Collection>
<Details>
<Id>1000</Id>
</Details>
<Details>
<Id>1000</Id>
</Details>
</Details_Collection>
</ProductList>
</Report>
如果我连着上面提到的XSLT通过DataTransform属性的报告,我正在获得输出。
XML Parsing Error: syntax error
Location: file:///C:/Documents%20and%20Settings/Administrator/Desktop/pg_google_data_feed.xml
Line Number 1, Column 39:<?xml version="1.0" encoding="utf-8"?>1089010947109191093310895108921092406598115141151311512
--------------------------------------^
预先感谢您 Sudhakar
当你说“哪种类型的XSLT”是否指“哪个版本”?对于您的任务,XSLT 1.0应该可以正常工作,因为您只需要禁用一些标记并重命名其他标记。请首先咨询XSLT的一般指南(例如,从https://en.wikipedia.org/wiki/XSLT开始)。如果您遇到了具体的XSLT问题,您可以将其添加到上面的问题中,您将得到帮助。 –
实际上我需要xslt代码来抑制标记 Details_Collection>并将标记重命名为。如果您能为我提供xslt代码,我将不胜感激。谢谢! –
user2538900
然后我会做你的工作。 :-) –