all groups > sql server reporting services > november 2004 >
You're in the

sql server reporting services

group:

Applying XSL transformation to Report exported to XML


Applying XSL transformation to Report exported to XML khonerka
11/9/2004 12:58:01 PM
sql server reporting services:
I have tried this in 2 different wasy:
1. By typing "onlinebenefits.xsl" in the Data Transform text box of the Data
Output Tab in report properties. I preview the report then export to XML.
2. By using URL access -
"http://lidevsql/reportserver?/EMReports/Extracts/Extract&rs:Command=Render&rs:Format=XML&rc:FileExtension=xml&rc:XSLT=/EMReports/Extracts/onlinebenefits.xsl"

In both cases, I get the following result:
- <Enrollment
xsi:schemaLocation="http://ns.hr-xml.org/2004-08-02Enrollment.xsd"
creationDate="" xmlns:olb="Extract"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Organization organizationName="" organizationId="" />
</Enrollment>

Which is only the outermost element of what I'm expecting. The
organizationName and organizationId are not being mapped, and the rest of a
fairly involved xml is just not there.

Re: Applying XSL transformation to Report exported to XML Teo Lachev [MVP]
11/9/2004 9:01:23 PM
You have to explicitly set the Data schema textbox in the Data Output tab,
e.g. http://www.abc.com/myschema. If the "Data schema" setting is not
specified, the Report Server will auto-generate the XML document global
namespace to include the date when the report is processed.

--
Hope this helps.

---------------------------------------------
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---------------------------------------------

[quoted text, click to view]
"http://lidevsql/reportserver?/EMReports/Extracts/Extract&rs:Command=Render&
rs:Format=XML&rc:FileExtension=xml&rc:XSLT=/EMReports/Extracts/onlinebenefit
s.xsl"
[quoted text, click to view]

Re: Applying XSL transformation to Report exported to XML khonerka
11/10/2004 9:39:10 AM
I generated a schema from my input XML. I deployed that schema to the report
server in the same folder as my report. I tried several different settings in
the Data schema textbox ("ExtractMini.xsd",
"http://lidevsql/reportserver/EMreports/Extracts/ExtractMini.xsd",
"http://lidevsql/reportserver/EMreports/Extracts"), none of which generated
anything new. So, I still have the same problem. Do you have anything else I
can try?

[quoted text, click to view]
Re: Applying XSL transformation to Report exported to XML Teo Lachev [MVP]
11/11/2004 8:55:59 PM
Does it work when you assign the XSLT directly the report XML output. In
other words, export the report as XML, save to file, assing the XSLT and run
it. If this works, the XSLT in RS should work too.

--
Hope this helps.

---------------------------------------------
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---------------------------------------------

[quoted text, click to view]

Re: Applying XSL transformation to Report exported to XML khonerka
11/12/2004 6:22:02 AM
I am able to open the XML in Stylus Studio and apply the XSL transformation
without error. I am also able to do it in ASP .NET code. I just can't get it
to work directly through SQL Reporting Services.

[quoted text, click to view]
Re: Applying XSL transformation to Report exported to XML Teo Lachev [MVP]
11/13/2004 2:12:34 PM
This is probably because you haven't qualified your XSL with the Data Schema
namespace. In the code sample below note that the n1 namespace equals the
Data Schema setting and all elements are referenced by their fully qualified
name.


- <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:n1="http://www.awc.com/sales"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xsl:template match="/">
- <xsl:for-each select="n1:SalesPromotion/n1:Promotions/n1:Promotion">
- <item>
- <title>
<xsl:value-of select="./@Description" />
</title>
<link>http://www.adventure-workds.com/promotions</link>
- <description>
Great
<xsl:value-of select="./@Description" />
Items discounted
<xsl:value-of select="./@DiscountPct" />
percent! Offer expires on
<xsl:value-of select="./@StartDate" />
</description>
- <pubDate>
<xsl:value-of select="./@StartDate" />
</pubDate>
</item>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

--
Hope this helps.

---------------------------------------------
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---------------------------------------------

[quoted text, click to view]

Re: Applying XSL transformation to Report exported to XML khonerka
11/16/2004 7:33:08 AM
No, we are doing a similar thing. The XMLNS in the XML is set to "Extract".
In the XSL we are specifying xmlns:olb="Extract", then we are fully
qualifying references such as,
"olb:Report/olb:table1/olb:Employee_Collection/olb:Employee[1]/olb:OrgName".

Here is a snippet of the XML file:
<?xml version="1.0" ?>
- <Report xmlns="Extract"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="Extract
http://localhost/reportserver/folder?%2fExtract&rs%3aFormat=XML&rs%3aShowHideToggle%3aisnull=True&rc%3aSchema=True" Name="Extract">
- <table1>
- <Employee_Collection>
- <Employee>

Here is a snippet of the XSL file:
<?xml version="1.0" ?>
- <!-- This stylesheet transforms On Line Benefits XML content into valid
HR-XML content
-->
- <xsl:stylesheet version="1.0" xmlns="http://ns.hr-xml.org/2004-08-02"
xmlns:olb="Extract" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:datetime="xalan://org.apache.xalan.lib.ExsltDatetime"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
exclude-result-prefixes="datetime">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
- <!-- This key is used to support grouping of dependent data
-->
<xsl:key name="dependentGroup"
match="olb:Enrollment_Collection/olb:Enrollment/olb:Dependent_Collection/olb:Dependent[olb:DepRelation != 'Self']" use="olb:DepID" />
- <xsl:template match="/">
<xsl:call-template name="baseTemplate" />
</xsl:template>
- <!-- The base template transforms initial content and calls named
templates to expedite the transformation
-->
- <!-- The named templates represent elements defined in the HR-XML
schema
-->
- <xsl:template name="baseTemplate">
- <Enrollment>
- <xsl:attribute name="xsi:schemaLocation">
<xsl:text>http://ns.hr-xml.org/2004-08-02 Enrollment.xsd</xsl:text>
</xsl:attribute>
- <xsl:choose>
- <xsl:when test="function-available('datetime:dateTime')">
- <xsl:attribute name="creationDate">
<xsl:value-of select="datetime:dateTime()" />
</xsl:attribute>
</xsl:when>
</xsl:choose>
- <Organization>
- <xsl:attribute name="organizationName">
<xsl:value-of
select="olb:Report/olb:table1/olb:Employee_Collection/olb:Employee[1]/olb:OrgName" />
</xsl:attribute>
- <xsl:attribute name="organizationId">
<xsl:value-of
select="olb:Report/olb:table1/olb:Employee_Collection/olb:Employee[1]/olb:FederalTaxID" />
</xsl:attribute>
- <xsl:for-each
select="olb:Report/olb:table1/olb:Employee_Collection/olb:Employee">
- <Subscriber>


[quoted text, click to view]
AddThis Social Bookmark Button