BiXmlDataSet

This class maps an xml file outputted from an ADO.NET DataSet to a BiDataSet.

This class extends BiDataSet and therefore all methods and fields available for BiDataSet are also available for BiXmlDataSet .

Constructor

new BiXmlDataSet ( oSource )

Parameters

Name Type Optional Default Descripton
oSource Object The source of the XML file/element. This can take quite a few different formats. If the argument is a String or a BiUri the XML document will be loaded asynchronously using an internal BiXmlLoader. If the argument is a BiXmlDocument or an XML element that will be used as the source.

Properties

Name Type get set Descripton
dataSetNamePath String checked Returns the XPath expression needed to get the name of the data set.
encodedName String checked The encoded name of the data set
rootNode Node checked checked The root XML node used to define the data set. This is either a BiXmlDocument or an XML element.
uri BiUri checked checked This property can be used to load an external XML document and use that as the source for the XML data set

Methods

Name Description
fromXmlNode Creates the tables, rows and columns from an XML node. This node can be a BiXmlDocument or an XML element.
getColumnNamesPath Returns the XPath expression needed to get the names of the columns of the data table.
getColumnTypesPath Returns the XPath expression needed to get the types of the columns. This should return the XML Schema type.
getRowsPath Returns the XPath expression needed to get the rows of the table
getTableNamesPath Returns the XPath expression needed to get the names of the tables in the data set.

Events

Name Type Bubbles Descripton
dataready BiEvent This is dispatched when the data set uses external data and the data has been loaded.

Static Methods

Name Description
decodeName Decodes a string from the format used by the XML element tag names.
encodeName Encodes a string to the desired format used for the XML element tag names.

Static Fields

None.

Remarks

XML data sets are read only. The methods getDataSetNamePath, getTableNamesPath, getColumnNamesPath, getColumnTypesPath and getRowsPath allows you to define how to find the different elements and attributes used to define the data of the data set. Override these to suit your need.

Method Details

fromXmlNode

Creates the tables, rows and columns from an XML node. This node can be a BiXmlDocument or an XML element.

Syntax

object.fromXmlNode
 (
 oNode
 )
 

Parameters

Name Type Optional Default Descripton
oNode Node The XML node to populate the data set from

Return Type

void

getColumnNamesPath

Returns the XPath expression needed to get the names of the columns of the data table.

Syntax

object.getColumnNamesPath
 (
 sTableXmlName
 )
 

Parameters

Name Type Optional Default Descripton
sTableXmlName String The (encoded) name of the table

Return Type

String

getColumnTypesPath

Returns the XPath expression needed to get the types of the columns. This should return the XML Schema type.

Syntax

object.getColumnTypesPath
 (
 sTableXmlName
 )
 

Parameters

Name Type Optional Default Descripton
sTableXmlName String The (encoded) name of the table

Return Type

String

getRowsPath

Returns the XPath expression needed to get the rows of the table

Syntax

object.getRowsPath
 (
 sTableXmlName
 )
 

Parameters

Name Type Optional Default Descripton
sTableXmlName String The (encoded) name of the table to get the rows for

Return Type

String

getTableNamesPath

Returns the XPath expression needed to get the names of the tables in the data set.

Syntax

object.getTableNamesPath
 (
 sDataSetXmlName
 )
 

Parameters

Name Type Optional Default Descripton
sDataSetXmlName String The (encoded) name of the data set

Return Type

String

Static Method Details

decodeName

Decodes a string from the format used by the XML element tag names.

Syntax

BiXmlDataSet
 .
 decodeName
 (
 s
 )
 

Parameters

Name Type Optional Default Descripton
s String The string to decode.

Return Type

String

encodeName

Encodes a string to the desired format used for the XML element tag names.

Syntax

BiXmlDataSet
 .
 encodeName
 (
 s
 )
 

Parameters

Name Type Optional Default Descripton
s String The string to encode.

Return Type

String