📄 bixmldataset.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--
Generated using api.website.xsl version 2003-07-17
-->
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>BiXmlDataSet</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript">
function showDerivedClasses() {
var ul = document.getElementById("api-derived-classes");
var lis = ul.childNodes;
var l = lis.length;
for (var i = 1; i < l; i++)
lis[i].style.display = "";
lis[0].style.display = "none";
}
</script></head>
<body>
<h1 id="BiXmlDataSet">BiXmlDataSet</h1>
<p>
This class maps an xml file outputted from an .NET DataSet or an ADODB
RecordSet to a <code><a href="BiDataSet.html">BiDataSet</a></code>.
</p>
<p>This class extends
<code><a href="BiDataSet.html">BiDataSet</a></code>
and therefore all methods and fields available for
<code><a href="BiDataSet.html">BiDataSet</a></code>
are also available for <code>BiXmlDataSet</code>.</p>
<ul class="partial-class-tree">
<li><code><a href="BiObject.html">BiObject</a></code><ul>
<li><code><a href="BiEventTarget.html">BiEventTarget</a></code><ul><li><code><a href="BiDataSet.html">BiDataSet</a></code><ul><li><code>BiXmlDataSet</code><ul id="api-derived-classes"></ul></li></ul></li></ul></li></ul>
</li>
</ul>
<h2>Constructor</h2>
<p><code>
new BiXmlDataSet(<span class="methodArgument">oSource</span>)</code></p>
<h3>Parameters</h3>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>oSource</code></td>
<td><code class="type">
String / <code><a href="BiUri.html">BiUri</a></code> /
<code><a href="BiXmlDocument.html">BiXmlDocument</a></code> / XML Element
</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The source of the XML file/element. This can take quite a few
different formats. If the argument is a String or a <code><a href="BiUri.html">BiUri</a></code>
the XML document will be loaded asynchronously using an internal
<code><a href="BiXmlLoader.html">BiXmlLoader</a></code>. If the argument
is an <code><a href="BiXmlDocument.html">BiXmlDocument</a></code> or an XML
element that will be used as the source.
</td>
</tr>
</tbody>
</table>
<h2>Properties</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="get-header">get</td>
<td class="set-header">set</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><a name="encodedName"></a><code>encodedName</code></td>
<td><code class="type">String</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"></td>
<td>
The encoded name of the data set
</td>
</tr>
<tr>
<td><a name="rootNode"></a><code>rootNode</code></td>
<td><code class="type"><code><a href="BiXmlDocument.html">BiXmlDocument</a></code> / XML element</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"></td>
<td>
The root XML node used to define the data set
</td>
</tr>
</tbody>
</table>
<h2>Methods</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="#fromXmlNode">fromXmlNode</a></code></td>
<td>
Creates the tables, rows and columns from an XML node. This node
can be a <code><a href="BiXmlDocument.html">BiXmlDocument</a></code> or an
XML element.
</td>
</tr>
<tr>
<td><code><a href="#getColumnNamesPath">getColumnNamesPath</a></code></td>
<td>
Returns the XPath expression needed to get the names of the
columns of the data table.
</td>
</tr>
<tr>
<td><code><a href="#getColumnTypesPath">getColumnTypesPath</a></code></td>
<td>
Returns the XPath expression needed to get the types of the
columns. This should return the XML Schema type.
</td>
</tr>
<tr>
<td><code><a href="#getDataSetNamePath">getDataSetNamePath</a></code></td>
<td>
Returns the XPath expression needed to get the name of the data
set.
</td>
</tr>
<tr>
<td><code><a href="#getRowsPath">getRowsPath</a></code></td>
<td>
Returns the XPath expression needed to get the rows of the table
</td>
</tr>
<tr>
<td><code><a href="#getTableNamesPath">getTableNamesPath</a></code></td>
<td>
Returns the XPath expression needed to get the names of the
tables in the data set.
</td>
</tr>
</tbody>
</table>
<h2>Events</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="bubbles-header">Bubbles</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><a name="dataready"></a><code>dataready</code></td>
<td><code class="type"><code><a href="BiEvent.html">BiEvent</a></code></code></td>
<td class="bubbles-column"><img src="check.png" alt="checked"></td>
<td>
This is dispatched when the data set uses external data and the
data has been loaded.
</td>
</tr>
</tbody>
</table>
<h2>Static Methods</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="#decodeName">decodeName</a></code></td>
<td>
Decodes a string from the format used by the XML element tag
names.
</td>
</tr>
<tr>
<td><code><a href="#encodeName">encodeName</a></code></td>
<td>
Encodes a string to the desired format used for the XML element tag
names.
</td>
</tr>
</tbody>
</table>
<h2>Static Fields</h2>
<p>None.</p>
<h2>Remarks</h2>
<p>
XML data sets are read only.<br>
<br>
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.
</p>
<h2>Method Details</h2>
<h3><a name="fromXmlNode"></a>fromXmlNode</h3>
<p>
Creates the tables, rows and columns from an XML node. This node
can be a <code><a href="BiXmlDocument.html">BiXmlDocument</a></code> or an
XML element.
</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.fromXmlNode(<span class="methodArgument">oNode</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>oNode</code></td>
<td><code class="type"><code><a href="BiXmlDocument.html">BiXmlDocument</a></code> / XML element</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The node to populate the data set from
</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">void</code></p>
<h3><a name="getColumnNamesPath"></a>getColumnNamesPath</h3>
<p>
Returns the XPath expression needed to get the names of the
columns of the data table.
</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getColumnNamesPath(<span class="methodArgument">sTableXmlName</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sTableXmlName</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The (encoded) name of the table
</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="getColumnTypesPath"></a>getColumnTypesPath</h3>
<p>
Returns the XPath expression needed to get the types of the
columns. This should return the XML Schema type.
</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getColumnTypesPath(<span class="methodArgument">sTableXmlName</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sTableXmlName</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The (encoded) name of the table
</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="getDataSetNamePath"></a>getDataSetNamePath</h3>
<p>
Returns the XPath expression needed to get the name of the data
set.
</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getDataSetNamePath()</pre>
<h4>Parameters</h4>
<p>No arguments.</p>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="getRowsPath"></a>getRowsPath</h3>
<p>
Returns the XPath expression needed to get the rows of the table
</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getRowsPath(<span class="methodArgument">sTableXmlName</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sTableXmlName</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The (encoded) name of the table to get the rows for
</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="getTableNamesPath"></a>getTableNamesPath</h3>
<p>
Returns the XPath expression needed to get the names of the
tables in the data set.
</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getTableNamesPath(<span class="methodArgument">sDataSetXmlName</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sDataSetXmlName</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The (encoded) name of the data set
</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h2>Static Method Details</h2>
<h3><a name="decodeName"></a>decodeName</h3>
<p>
Decodes a string from the format used by the XML element tag
names.
</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiXmlDataSet.decodeName(<span class="methodArgument">s</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>s</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The string to decode.
</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="encodeName"></a>encodeName</h3>
<p>
Encodes a string to the desired format used for the XML element tag
names.
</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiXmlDataSet.encodeName(<span class="methodArgument">s</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>s</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>
The string to encode.
</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -