Hi
I have an xslt. The input to the xslt is a dataset. In that dataset, in one
of the datatables' column I am stroring xml data using XmlDocument.
Now, when I transform this xslt in c# I get the following error:
"Unexpected XML declaration. The XML declaration must be the first node in
the document, and no white space characters are allowed to appear before it."
Is there a workaround to this problem?
Thanks,
Anshul Bansal
Martin Honnen - 28 Jan 2008 11:56 GMT
> I have an xslt. The input to the xslt is a dataset. In that dataset, in one
> of the datatables' column I am stroring xml data using XmlDocument.
[quoted text clipped - 4 lines]
>
> Is there a workaround to this problem?
Well the rules are strict, the XML declaration needs to be the first
thing in an XML document (besides a posssible BOM). So what you
currently construct as XML is not XML and can't be parsed successfully
with an XML parser. You need to fix the way you construct the XML. As
you have not shown us how you construct the XML it is difficult to give
concrete advice.
Please provide some details on how you construct the XML from the
DataSet. The .NET framework provides XmlDataDocument for that.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/