"solex" <so***@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
I have a XSLT file that I am trying to use with the XSLTransform class but
it chokes on the first line:
<?xml version="1.0" encoding="ISO-8859-1"?> returning the error:
"System.Xml.XmlException: The data at the root level is invalid. Line 1,
position 44.
Try saving the .XSL file in ISO-8859-1 encoding. :-)
If you load it into Notepad and save it (using Save As..) as "ANSI", then
XslTransform takes no exception with it. On the other hand, if you load
it into Notepad and save it as "Unicode," then XslTransform will throw
precisely the XmlException you describe.
Note that if you've loaded this .XSL file into a .NET String at any point, it
is UTF-16 encoded, no matter what you say in the encoding declaration.
Derek Harmon