Loading XML Objects into the Database

In this document, we will load some data into the database "my-database". We have prepared the sample data files atkins.xml and bloggs.xml for you, so that you do not have to bother about creating XML files yourself. Each of these files contains one instance of the doctype patient, which is defined in the previously mentioned schema HospitalSchema. The sample data files are located in the directory <TaminoDocRootDir>/examples/patient.

Start of instruction setTo load XML objects into the database

  1. In the Tamino X-Plorer, navigate to the collection Hospital and select it.

  2. From the Instance menu, choose Insert Instance.

    The Insert Instance dialog box is displayed:

    graphics/insert1.png

  3. On the From XML File tab, choose the browse button (graphics/icon.png) and browse to the sample data file atkins.xml, which is located in the documentation examples directory <TaminoDocRootDir>/examples/patient. Choose the Insert button to load the file into the database "my-database".

    In the navigation tree, the loaded data instance is displayed in the following way:

    graphics/insert2.png

The data for patient Atkins is represented in the navigation tree by the number "1" underneath the patient node. If you select it, you can see the corresponding XML data in the plain text view in the Content pane:

graphics/insert2a.png

(The icons in the Content pane allow you to choose between plain text view, HTML view and tree view.)

In the properties pane, metadata is displayed:

graphics/insert3.png

For XQuery examples that will follow in the section Retrieving Objects from the Database Using XQuery, now go back to step 1 and also load the XML data set for Mr. Bloggs with the filename bloggs.xml.

The method described here is one of many ways of loading data into Tamino. Another way of loading objects that are structured according to a schema is to use a client programming interface. Tamino offers client APIs for Java and C. Tamino also offers a programming interface on the basis of the X-Machine programming language. To access the documentation for these APIs, refer to the documentation overview page. An additional method is to use the Tamino Data Loader. Refer to the Tamino Data Loader documentation for details.