Home >>XML Tutorial >XML Database

XML Database

XML Database

XML database is a software system used to store huge amounts of information in XML format for data persistence. This provides a secure location for storing XML documents.

Using XQuery, you can query, export, and serialize your stored data into desired format. XML databases are typically correlated with databases which are document oriented.

Types of XML databases

There are two types of XML databases.

  1. XML-enabled database
  2. Native XML database (NXD)

XML-enable Database

XML-enabled database functions as a relational database. It is like an extension given for XML document conversion. Data are contained in table in this database, in the form of rows and columns.

XML enabled database is nothing more than an extension provided for XML document conversion. It is a relational database, where the data is contained in row and column tables. The tables comprise record collection that in effect consists of fields.

Native XML Database

Native XML database is used to store big data. Native XML schema is based on container format, instead of table format. The XPath expressions can be used to query data.

Native XML database is preferred over XML-enabled database, because XML documents are highly capable of being stored, maintained and queried.

Let's take an example of XML database:


<?xml version="1.0"?>  
<contact-info>  
<contact1>  
<name>suresh</name>  
<company>phptpoint</company>  
<phone>(0120) 7834528</phone>  
</contact1>  
<contact2>  
<name>mukesh </name>  
<company>phptpoint</company>  
<phone>9065285320</phone>  
</contact2>  
</contact-info> 

In the illustration above, a table called contacts is created and the contacts are held (contact1 and contact2). Each one contains the name, company and phone of the 3 entities.