Re: [xsl] group data in XSL

Subject: Re: [xsl] group data in XSL
From: Josh Canfield <joshcanfield@xxxxxxxxx>
Date: Wed, 18 Aug 2004 21:28:33 -0700
You are declaring xsl version 1.0, but using xsl:for-each-group which
is an XSL 2.0 element. As far as I am aware Saxon 8 is the only XSLT
2.0 compliant processor, and this will not work in ASP.Net.

The errors you are reporting don't seem to be related to this problem
though, and are problably not generated by the code that you have
provided.

Try using the 1.0 solution provided by Vasu Chakkera.

Josh

On Wed, 18 Aug 2004 16:05:08 -0700 (PDT), Tham Tinh <khautinh@xxxxxxxxx> wrote:
> Please Help.
> 
> Error still when I put my xml.xml and xsl.xslt
> together in ASP.NET and use with xml control.
> 
> I saved the following code as xsl.xslt
> 
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>        <xsl:template match="/">
>                <xsl:for-each-group select="/dsWMSRpt/WMSReport"
> group-by="ReportUnitTitle">
>                                Administration Code: <xsl:value-of
> select="AdministrationCode"/>
>                                Report Title:        <xsl:value-of
> select="ReportUnitTitle"/>
>                                <!--xsl:for-each
> select="current-group()/PositionNumber"-->
>                                        Position Number: <xsl:value-of
> select="PositionNumber"/>
>                                <!--/xsl:for-each-->
>                </xsl:for-each-group>
>        </xsl:template>
> </xsl:stylesheet>
> 
> And the following as xml.xml
> 
> 
> <?xml version="1.0" standalone="yes"?>
> 
> <dsWMSRpt>
>        <WMSReport>
>                <AdministrationCode>ABC</AdministrationCode>
>                <ReportUnitTitle>Financial Div</ReportUnitTitle>
>                <PositionNumber> 0934</PositionNumber>
>        </WMSReport>
>        <WMSReport>
>                <AdministrationCode>ABC</AdministrationCode>
>                <ReportUnitTitle>Part Div</ReportUnitTitle>
>                <PositionNumber> 4563</PositionNumber>
>        </WMSReport>
>        <WMSReport>
>                <AdministrationCode>ABC</AdministrationCode>
>                <ReportUnitTitle>Financial Div</ReportUnitTitle>
>                <PositionNumber> K948</PositionNumber>
>        </WMSReport>
>        <WMSReport>
>                <AdministrationCode>ABC</AdministrationCode>
>                <ReportUnitTitle>Human Resource
> Div</ReportUnitTitle>
>                <PositionNumber> 6453</PositionNumber>
>        </WMSReport>
>        <WMSReport>
>                <AdministrationCode>ABC</AdministrationCode>
>                <ReportUnitTitle>HumanResource
> Div</ReportUnitTitle>
>                <PositionNumber> 9655</PositionNumber>
>        </WMSReport>
>        <WMSReport>
>                <AdministrationCode>ABC</AdministrationCode>
>                <ReportUnitTitle>Sale Div</ReportUnitTitle>
>                <PositionNumber> SDWE</PositionNumber>
>        </WMSReport>
>        <WMSReport>
>                <AdministrationCode>ABC</AdministrationCode>
>                <ReportUnitTitle>Sale Div</ReportUnitTitle>
>                <PositionNumber> 4577</PositionNumber>
>        </WMSReport>
> </dsWMSRpt>
> 
> Error:
> 
> Server Error in '/TransformationTest' Application.
> The XML declaration is unexpected. Line 1, position 4.
> 
> Description: An unhandled exception occurred during
> the execution of the current web request. Please
> review the stack trace for more information about the
> error and where it originated in the code.
> 
> Exception Details: System.Xml.XmlException: The XML
> declaration is unexpected. Line 1, position 4.
> 
> 
> =====
> "It is essential to know that to be a happy person, a happy family, a happy society, it is very crucial to have a good heart, that is very crucial,"
> Dalai Lama
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> 
> 
> http://promotions.yahoo.com/new_mail

Current Thread