Roo.data.DataReader
Roo.data.XmlReader 

		   

Class Roo.data.XmlReader

Package:Roo.data
Defined In: Roo/data/XmlReader.js.
Class:XmlReader
Extends: Roo.data.DataReader
Data reader class to create an Array of {link Roo.data.Record} objects from an XML document
based on mappings in a provided Roo.data.Record constructor.



Note that in order for the browser to parse a returned XML document, the Content-Type
header in the HTTP response must be set to "text/xml".


Example code:


var RecordDef = Roo.data.Record.create([
{name: 'name', mapping: 'name'}, // "mapping" property not needed if it's the same as "name"
{name: 'occupation'} // This field will use "occupation" as the mapping.
]);
var myReader = new Roo.data.XmlReader({
totalRecords: "results", // The element which contains the total dataset size (optional)
record: "row", // The repeated element which contains row information
id: "id" // The element within the row that provides an ID for the record (optional)
}, RecordDef);


This would consume an XML file like this:


<?xml?>
<dataset>
<results>2</results>
<row>
<id>1</id>
<name>Bill</name>
<occupation>Gardener</occupation>
</row>
<row>
<id>2</id>
<name>Ben</name>
<occupation>Horticulturalist</occupation>
</row>
</dataset>
Class Comments / Notes => [Add Your comment/notes about this class]
Config Options (Usually are also Properties)
Options Defined By
Public Properties - Has None
Public Methods
Method Defined By
Events - Has None
Documentation generated by Introspection Doc Generator on Fri Jul 13 2018 14:10:54 GMT+0800 (HKT) Based on JsDoc Toolkit