Use the DataSchema Utility to translate data in various input formats into a standard record-based structure like this:
{
results: [
{ fieldA: valueA1, fieldB: valueB2, ... },
{ fieldA: valueA2, fieldB: valueB2, ... },
...
],
meta: {
whatever : "you",
configured: "to capture",
...
}
}
Y.DataSchema.Array
- (dataschema-array
) Input is an ArrayY.DataSchema.JSON
- (dataschema-json
) Input is an Object or JSON stringY.DataSchema.XML
- (dataschema-xml
) Input is an XML nodeY.DataSchema.Text
- (dataschema-text
) Input is a delimited text string
The important method for each processor is the apply(schema, data)
method, so
for example:
var results = Y.DataSchema.JSON.apply({ schema config }, dataObject);
See the user guide for details about schema definitions for each processor.