S
Steve B.
Hi,
I've a string that contains a Xsl transformation :
string tranform = @"
<xml version=""1.0"">
<xsl .....>
";
Notice that the first chars are \r\n
I write this string into a MemoryStream, then I create a new XmlReader like
this :
XmlReader reader = XmlReader.Create(myMemoryStream);
This line throw an exception : the char 0x00 is not valid.
If I slightly change the code :
string tranform = @"<xml version=""1.0"">
<xsl .....>
";
(the content starts with the declaratibe tag)
The code then works correctly.
So my question is : why does the first \r\n make the XmlReader throw an
Exception ? I thought spaces are ignored (W3C specs).
Thanks in advance for any clarifications
Steve
I've a string that contains a Xsl transformation :
string tranform = @"
<xml version=""1.0"">
<xsl .....>
";
Notice that the first chars are \r\n
I write this string into a MemoryStream, then I create a new XmlReader like
this :
XmlReader reader = XmlReader.Create(myMemoryStream);
This line throw an exception : the char 0x00 is not valid.
If I slightly change the code :
string tranform = @"<xml version=""1.0"">
<xsl .....>
";
(the content starts with the declaratibe tag)
The code then works correctly.
So my question is : why does the first \r\n make the XmlReader throw an
Exception ? I thought spaces are ignored (W3C specs).
Thanks in advance for any clarifications
Steve