Hi, I'm writing a String containing XML data to my browser. The XML data is well formed and the page opens up correctly but when I try to read this data from another page I get the following error: '>' is an unexpected token. The expected token is '"' or '''. Line 2, position 63.
Here is the code in the page serving the XML:
Response.Clear( );
Response.ClearC ontent();
Response.ClearH eaders();
Response.Conten tType = "text/xml";
Response.Conten tEncoding = Encoding.UTF8;
String returnXML = "<LIST><ITEM><C ODE>24</CODE></ITEM></LIST>";
Response.Write( returnXML);
When I hit the above page directly there are no issues and the XML is displayed nicely in a tree.
Here is the code from the page trying to read the XML data:
DataSet dataSet = new DataSet();
dataSet.ReadXml ("http://localhost:2593/MyApp/EmitXMLToBrowse r.aspx");
this.GridView1. DataSource = dataSet;
this.GridView1. DataMember = "ITEM";
this.GridView1. DataBind();
thats when I get the following error: '>' is an unexpected token. The expected token is '"' or '''. Line 2, position 63.
Note: if I try to save returnXML to a file and read that file in dataSet.ReadXML , there are no issues.
Any idea what is the issue here?
Thanks
Here is the code in the page serving the XML:
Response.Clear( );
Response.ClearC ontent();
Response.ClearH eaders();
Response.Conten tType = "text/xml";
Response.Conten tEncoding = Encoding.UTF8;
String returnXML = "<LIST><ITEM><C ODE>24</CODE></ITEM></LIST>";
Response.Write( returnXML);
When I hit the above page directly there are no issues and the XML is displayed nicely in a tree.
Here is the code from the page trying to read the XML data:
DataSet dataSet = new DataSet();
dataSet.ReadXml ("http://localhost:2593/MyApp/EmitXMLToBrowse r.aspx");
this.GridView1. DataSource = dataSet;
this.GridView1. DataMember = "ITEM";
this.GridView1. DataBind();
thats when I get the following error: '>' is an unexpected token. The expected token is '"' or '''. Line 2, position 63.
Note: if I try to save returnXML to a file and read that file in dataSet.ReadXML , there are no issues.
Any idea what is the issue here?
Thanks
Comment