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

NameTypeOptionalDefaultDescripton
oSourceObjectThe 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

NameTypegetsetDescripton
dataSetNamePathStringcheckedReturns the XPath expression needed to get the name of the data set.
encodedNameStringcheckedThe encoded name of the data set
rootNodeNodecheckedcheckedThe root XML node used to define the data set. This is either a BiXmlDocument or an XML element.
uriBiUricheckedcheckedThis property can be used to load an external XML document and use that as the source for the XML data set

Methods

NameDescription
fromXmlNodeCreates the tables, rows and columns from an XML node. This node can be a BiXmlDocument or an XML element.
getColumnNamesPathReturns the XPath expression needed to get the names of the columns of the data table.
getColumnTypesPathReturns the XPath expression needed to get the types of the columns. This should return the XML Schema type.
getRowsPathReturns the XPath expression needed to get the rows of the table
getTableNamesPathReturns the XPath expression needed to get the names of the tables in the data set.

Events

NameTypeBubblesDescripton
datareadyBiEventThis is dispatched when the data set uses external data and the data has been loaded.

Static Methods

NameDescription
decodeNameDecodes a string from the format used by the XML element tag names.
encodeNameEncodes 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

NameTypeOptionalDefaultDescripton
oNodeNodeThe 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

NameTypeOptionalDefaultDescripton
sTableXmlNameStringThe (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

NameTypeOptionalDefaultDescripton
sTableXmlNameStringThe (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

NameTypeOptionalDefaultDescripton
sTableXmlNameStringThe (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

NameTypeOptionalDefaultDescripton
sDataSetXmlNameStringThe (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

NameTypeOptionalDefaultDescripton
sStringThe 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

NameTypeOptionalDefaultDescripton
sStringThe string to encode.

Return Type

String