RE: [xsl] group data in XSL

Subject: RE: [xsl] group data in XSL
From: Tham Tinh <khautinh@xxxxxxxxx>
Date: Wed, 18 Aug 2004 16:05:08 -0700 (PDT)
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