| Data reader class to create an Array of
Record objects from an XML document based on mappings.
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 :
RecordDef recordDef = new RecordDef(new FieldDef[] {
new StringFieldDef("name", "name"), // "mapping" property not needed if it's the same as "name"
new StringFieldDef("occupation") // This field will use "occupation" as the mapping.
});
XmlReaderConfig config = new XmlReaderConfig();
config.setRecord("row");
config.setId("id");
config.setTotalRecords("results");
XmlReader reader = new XmlReader(config, recordDef);
This would consume XML like:
<?xml?>
<dataset>
<results>2
|