An XML data set selects nodes from an XML document using XPath
expressions. The selected nodes are returned as XPathNavigator objects.
Namespace:
Gallio.Framework.DataAssembly: Gallio (in Gallio.dll) Version: 3.4.0.0 (3.4.11.0)
Syntax
| C# |
|---|
public class XmlDataSet : BaseDataSet |
| Visual Basic (Declaration) |
|---|
Public Class XmlDataSet _ Inherits BaseDataSet |
Remarks
Two XPath expressions are used.
- Item Path : An XPath expression that selects a set of nodes that are used to uniquely identify records. For example, the item path might be used to select the containing element of each Book element in an XML document of Books. The item path is specified in the constructor.
- Binding Path : An XPath expression that selects a node relative to the item path that contains a particular data value of interest. For example, the binding path might be used to select the Author attribute of a Book element in an XML document of Books. The binding path is specified by the DataBinding.
Examples
The XML may contain metadata at the row level by adding metadata elements in the http://www.gallio.org/ namespace containing metadata entries. In the following example, the row values would be selected using an Item Path of "//row" and a Binding Path of "@value". Additionally, some rows would have metadata as specified.
<data> <row value="somevalue"> <metadata xmlns="http://www.gallio.org/"> <entry key="Description" value="A row..." /> <entry key="Author" value="Me" /> </metadata> </row> <row value="anothervalue" /> </data>
