dataschema-xml.js revision 8392a541bf432ed8d6e1985b6306b83dc898768d
/**
* Provides a DataSchema implementation which can be used to work with XML data.
*
* @module dataschema
* @submodule dataschema-xml
*/
/**
* XML subclass for the DataSchema Utility.
* @class DataSchema.XML
* @extends DataSchema.Base
* @static
*/
SchemaXML = {
/////////////////////////////////////////////////////////////////////////////
//
// DataSchema.XML static methods
//
/////////////////////////////////////////////////////////////////////////////
/**
* Applies a given schema to given XML data.
*
* @method apply
* @param schema {Object} Schema to apply.
* @param data {XMLDoc} XML document.
* @return {Object} Schema-parsed data.
* @static
*/
// Parse results data
// Parse meta data
}
else {
}
return data_out;
},
/**
* Get an XPath-specified value for a given field from an XML node or document.
*
* @method _getLocationValue
* @param field {String | Object} Field definition.
* @param context {Object} XML node or document to search within.
* @return {Object} Data value or null.
* @static
* @protected
*/
try {
// Standards mode
result = xmldoc.evaluate(locator, context, xmldoc.createNSResolver(!context.ownerDocument ? context.documentElement : context.ownerDocument.documentElement), 0, null);
}
}
// IE mode
else {
}
}
catch(e) {
}
},
/**
* Parses results data according to schema
*
* @method _parseMeta
* @param xmldoc_in {Object} XML document parse.
* @param data_out {Object} In-progress schema-parsed data to update.
* @return {Object} Schema-parsed data.
* @static
* @protected
*/
var key,
for(key in metaFields) {
}
}
}
return data_out;
},
/**
* Schema-parsed list of results from full data
*
* @method _parseResults
* @param schema {Object} Schema to parse against.
* @param xmldoc_in {Object} XML document parse.
* @param data_out {Object} In-progress schema-parsed data to update.
* @return {Object} Schema-parsed data.
* @static
* @protected
*/
results = [],
// Loop through each result node
result = {};
// Find each field value
}
}
}
else {
}
}
return data_out;
}
};