I have the following XML
<?xml version="1.0" encoding="UTF-8"?>
<DataSet xmlns="
http://tempuri.org/ ">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="
http://www.w3.org/2001/XMLSchema " xmlns:msdata="urn:schemas-
microsoft-
com:xml-ms
data">- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="t
rue">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table1">
<xs:complexType>
<xs:sequence>
<xs:element name="bfw_uid" type="xs:string" minOccurs="0" />
<xs:element name="Status" type="xs:int" minOccurs="0" />
<xs:element name="ExpirationDate" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-
microsoft-
com:xml-ms
data" xmlns:diffgr="urn:schemas-
microsoft-
com:xml-di
ffgram-v1"
>
<NewDataSet xmlns="">
<Table1 diffgr:id="Table11" msdata:rowOrder="0" diffgr:hasChanges="inserte
d">
<bfw_uid>c0a8cc3f:1def3f51
166b4f90a6
-7fd6</bfw
_uid>
<Status>1</Status>
<ExpirationDate>2008-12-05
T00:00:00+
05:30</Exp
irationDat
e>
</Table1>
<Table1 diffgr:id="Table12" msdata:rowOrder="1" diffgr:hasChanges="inserte
d">
<bfw_uid>c0a8cc3f:1def3f51
166b4f90a6
-7fdc</bfw
_uid>
<Status>1</Status>
<ExpirationDate>2008-12-05
T16:39:08+
05:30</Exp
irationDat
e>
</Table1>
<Table1 diffgr:id="Table13" msdata:rowOrder="2" diffgr:hasChanges="inserte
d">
<bfw_uid>c0a8cc3f:1def3f51
166b4f90a6
-7fdb</bfw
_uid>
<Status>1</Status>
<ExpirationDate>2008-12-05
T16:39:08+
05:30</Exp
irationDat
e>
</Table1>
</NewDataSet>
</diffgr:diffgram>
</DataSet>
I am transforming it to an XML using this XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform " version="2.0">
<xsl:template match="NewDataSet" >
<NewDataSet>
<xsl:apply-templates />
</NewDataSet>
</xsl:template>
<xsl:template match="Table1">
<Table1>
<xsl:apply-templates />
</Table1>
</xsl:template>
<xsl:template match="bfw_uid">
<bfw_uid>
<xsl:value-of select="text()"></xsl:valu
e-of>
</bfw_uid>
</xsl:template>
<xsl:template match="Status">
<Status>
<xsl:value-of select="text()"></xsl:valu
e-of>
</Status>
</xsl:template>
<xsl:template match="ExpirationDate">
<ExpirationDate>
<xsl:value-of select="text()"></xsl:valu
e-of>
</ExpirationDate>
</xsl:template>
</xsl:stylesheet>
But surprisingly the transformation gives a -(hyphen) as the first character. Can some one please tell me why that is happening. The output that I get is
<?xml version="1.0" encoding="UTF-8"?>
-
<NewDataSet>
<Table1>
<bfw_uid>c0a8cc3f:1def3f51166b4f90a6-7fd6</bfw_uid>
<Status>1</Status>
<ExpirationDate>2008-12-05T00:00:00+05:30</ExpirationDate>
</Table1>
<Table1>
<bfw_uid>c0a8cc3f:1def3f51166b4f90a6-7fdc</bfw_uid>
<Status>1</Status>
<ExpirationDate>2008-12-05T16:39:08+05:30</ExpirationDate>
</Table1>
<Table1>
<bfw_uid>c0a8cc3f:1def3f51166b4f90a6-7fdb</bfw_uid>
<Status>1</Status>
<ExpirationDate>2008-12-05T16:39:08+05:30</ExpirationDate>
</Table1>
</NewDataSet>
Select all
Open in new window
...xmlns:msdata="urn:schem