
Reasons for the XMLNuke AnyDataSet and Data Access
How to use the Iterator and the variations of AnyDataSet to access various types of data
Table of contents 1. Introductory Concepts 2. The Context class 3. The FilenameProcessor Class 4. The LanguageCollection Class 5. AnyDataSet and Data Access 6. The "Util" NameSpace 7. Structure of Directories
On this page AnyDataSet Iterating an AnyDataSet - IIterator
AnyDataSet
AnyDataSet is a module to store a small quantity of data. The file structure of an AnyDataSet is very similar to the structure of a relational storage, but the physical persistence occurs in an XML document. However, this does not follow a rigid orientation of data definition, so that every entry can have their own field structure.
Example of an XML from an AnyDataSet
<anydataset>
<row>
<field name="key1">Value 1</field>
<field name="key2">Value 2</field>
<field name="key3">Value 3</field>
</row>
<row>
<field name="key1">Value 1</field>
<field name="key2">Value 2</field>
</row>
</anydataset>
Iterating an AnyDataSet - IIterator
The AnyDataSet has a mechanism to iterate through the structure called an Iterator. This is very interesting because it establishes a standard method to iterate through the entire data structure in a singular way.
Currently, all of the objects to access data through XMLNuke implement the same Iterator interface; in other words, it doesn?t matter if you access a database or an XML file, since the method of obtaining this data will always be the same!
Currently, XMLNuke implements the following methods of accessing data:
- XML Files - AnyDataSet
- Database, various sources - DBDataSet (see more)
- CSV Files, local and remote - TextFileDataSet
- Array and Vectors - ArrayDataSet
- DataSet .NET object - DSDataSet
All of these cases have a method which returns an Iterator type object and that makes it possible for one method to iterate through the most varied types of databases in the same way.
For example, an XmlEditList object can be set up by any data source, whether a database, an XML file or an array, for example.
For more information on how to access the AnyDataSet, access the technical reference.
|