XML Database is used to store huge amount of information in the XML format. As the use of XML is increasing in every field, it is required to have a secured place to store the XML documents. The data stored in the database can be queried using XQuery, serialized, and exported into a desired format.
XML Database Types
There are two major types of XML databases −
- XML- enabled
- Native XML (NXD)
XML – Enabled Database
XML enabled database is nothing but the extension provided for the conversion of XML document. This is a relational database, where data is stored in tables consisting of rows and columns. The tables contain set of records, which in turn consist of fields.
Native XML Database
Native XML database is based on the container rather than table format. It can store large amount of XML document and data. Native XML database is queried by the XPath-expressions.
Native XML database has an advantage over the XML-enabled database. It is highly capable to store, query and maintain the XML document than XML-enabled database.
Example
Following example demonstrates XML database −
<?xml version = "1.0"?> <contact-info> <contact1> <name>Dinesh choudhary</name> <company>adgob.in</company> <phone> 91-8480000488 </phone> </contact1> <contact2> <name>Pragatika Mishra</name> <company>adgob.in</company> <phone> 91-8480000488 </phone> </contact2> </contact-info>
Here, a table of contacts is created that holds the records of contacts (contact1 and contact2), which in turn consists of three entities − name, company and phone.