XML Data Set

Description

The Spry.Data.XMLDataSet class dervies from the HTTPSourceDataSet class so that it can load and process XML data. The XMLDataSet class makes use of XPath to identify the data within the XML data that should be flattened.

File

SpryData.js

Inheritance

Notifier -->DataSet --> HTTPSourceDataSet --> XMLDataSet

XMLDataSet constructor

Description

Spry.Data.XMLDataSet is the constructor function for the XML Data Set.

Format

Spry.Data.XMLDataSet(url, xpath, options)

Arguments

Returns

N/A

Example

var ds = new Spry.Data.XMLDataSet("foo.php?id=100", "/foo/bar", { useCache: false, loadInterval: 1000 });

Sample

N/A

getDocument

Description

This function returns the XML DOM document the data set used to extract its data.

Format

getDocument()

Arguments

N/A

Returns

Object or null. The XML DOM Document element or null;

Example

var doc = ds.geDocument();

getXPath

Description

This function returns the current XPath.

Format

getXPath()

Arguments

N/A

Returns

String or null. Returns the XPath that will be used to extract the XML nodes for flattening. This may also return a null if one is not present.

Example

var xpathString = ds.getXPath();

loadDataIntoDataSet

Description

This function is not meant to be called directly. The XMLDataSet overrides the version of this function to add the ability to flatten an XML DOM Document.

Format

loadDataIntoDataSet(xmlDOMDoc)

Arguments

xmlDOMDoc - The data to be flattened.

Returns

N/A

Example

N/A

sessionExpiredChecker

Description

This function is not meant to be called directly. The XMLDataSet overrides the version of this function to add the ability to look for a session expired message inside XML.

Format

sessionExpiredChecker(req)

Arguments

req - Object. An instance of a Spry.Utils.loadURL.Request object.

Returns

Boolean. If true the user's session has expired.

Example

N/A

setXPath

Description

This function sets the XPath for the data set. If data has already been loaded, the XMLDataSet automatically applies the new XPath to re-generate the data for the data set.

Format

setXPath()

Arguments

N/A

Returns

N/A

Example

 ds.setXPath("//items");

xhRequestProcessor

Description

This function is not meant to be called directly. The XMLDataSet overrides the version of this function so that it returns an XML DOM Document.

Format

getURL()

Arguments

N/A

Returns

Object. The XML DOM Document or null.

Example

N/A


Copyright © 2007. Adobe Systems Incorporated.
All rights reserved.