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.
There are two major types of XML databases −
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 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.
Following example demonstrates XML database −
<?xml version = "1.0"?> <contact-info> <contact1> <name>Tanmay Patil</name> <company>Howcodex</company> <phone>(011) 123-4567</phone> </contact1> <contact2> <name>Manisha Patil</name> <company>Howcodex</company> <phone>(011) 789-4567</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.