RestDataSource from loadXMLSchema()

Hi,

I’m trying to construct a RestDataSource by inheriting a DataSource created using loadXMLSchema() -

isc.XMLTools.loadXMLSchema("/group.xsd", function(schemaset) {
      var ds = schemaset.getSchema("group");
      ds.recordXPath = "//group";
      ds.dataURL = "/group";
      ds.getField("key").primaryKey = true;

      isc.RestDataSource.create({
        ID: "myRestDS",
        inheritsFrom: ds,
        dataFormat: "xml",
        recordXPath: "//group",

        fetchDataURL: "/group",
        //addDataURL: "/group",
        updateDataURL: "/group",
        removeDataURL: "/group"
      });
      
      alert(myRestDS.getField("key").valueXPath);

      isc.ListGrid.create({
            autoDraw:false,
            width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
            dataSource: myRestDS,
            autoFetchData: true
      });
}

when bound to either DataSource (myRestDS or isc.SchemaSet.get(“http://www.mydomain.com/group").getSchema("group”)), a HTTP GET request is generated, however myRestDS seems unable to parse the result, and no records are displayed in the ListGrid. Both requests respond with identical XML.

The alert in the code above displays ‘undefined’, and I would have thought that the fields in myRestDS would need to have the valueXPath defined. This seems like something that should be determinable from the schema.

Am I approaching this the right way? Thanks.

Ok, I have resolved the problem - RestDataSource is expecting XML that does not conform to the schema, but rather to the standard SmartClient response format with a status and data element - If I modify the schema to define this, and modify the XML I produce, to match the new schema, then the RestDataSource works ok. I am interested to understand why the valueXPath does not need to populated though - how does the RestDataSource parse the fields from the XML? Thanks.