Ext JS - Learning Center

Manual:Data:Readers:XmlReader

From Learn About the Ext JavaScript Library

Jump to: navigation, search

Ext Manual > Data > Readers >

Ext.data.XmlReader

Links

Note: in order for the browser to parse a returned XML document, the Content-Type in the HTTP response must be set to "text/xml".So when you use the xmlreader to parse some data generated by the server,you must change the content-type of the response http header.Otherwise the xmlreader will not parse it.
Here is some asp.net fragment code.

           StringBuilder xml=new StringBuilder();
           bu.Append("<dataset>");
           bu.Append("<results>1</results>");
           bu.Append("<row>");
           bu.Append("<id>1</id>");
           bu.Append("<name>Bill</name>");
           bu.Append("<occupation>Gardener</occupation>");
           bu.Append("</row>");
           bu.Append("</dataset>");
           this.Response.ContentType = "text/xml";//must do it
           RenderText(bu.ToString());

  • This page was last modified 19:40, 14 April 2008.
  • This page has been accessed 3,819 times.