I\'m parsing some XML in C#. I\'m getting it from a database, and so converting it to a MemoryStream before reading it with an XmlTextReader. The problem is that I get this
Another common source of this error is when the XmlReader attempts to read your scripts as xml. That's a good reason to start commenting out scripts after the script tags. They will still run:
<script language="javascript" type="text/javascript">
<!--
function myFunction() {
}
...
-->
</script>
Yes, you should delete the space between <? and xml.
<?xml version="1.0" encoding="utf-8" ?>
<form>
<e order="0" type="custom" name="test">
<fi type="text" />
<o />
</e>
<e order="1" type="zip" />
<e order="2" type="state" />
</form>
Here's the relevant XML spec.
My error in same case was that file wasn't saved as UTF-8.