XML stands for Extensible Markup Language , is a very flexible and versatile markup build for the web developer . The main design goals of XML is to emphasise on simplicity, generality, and usability across the internet world.
It is a textual data format with strong support through unicode for different natural language . XML is designed to store and transport data ,in addition to this it is self descriptive.
The Difference Between XML and HTML
|Designed to Carry data.||Designed to display data|
|No predefined tag||Has Predefined tags.|
XML documents creates a tree structure that begins at “the root” and branches to “the leaves”.
A XML report is constantly enlightening. The tree structure is regularly alluded to as XML Tree and assumes a significant job to depict any XML report without any problem.
The tree structure contains root (parent) components, child components, etc. By utilizing tree structure, you can become acquainted with every succeeding branch and sub-branches beginning from the root. The parsing begins at the root, at that point descends the main branch to a component, take the primary branch from that point, etc to the leaf hubs.
XML Schema definition
XML Schema is normally known as XML Schema Definition (XSD). It is utilized to depict and approve the structure and the substance of XML information. XML mapping characterizes the components, characteristics and information types. Pattern component bolsters Namespaces. It is like a database pattern that depicts the information in a database.
As we seen in the above elements are building blocks of XML , the syntax of defining each element is as follows the first one is simple one:
Complex type can. be defined as follows:
XML is very efficient in database , we use it for report generation , Since XML is dynamic and user defined tags structure is very compatible for databse.
XML Database is utilized to store immense measure of data in the XML position. As the utilization of XML is expanding in each field, it is required to have a tied down spot to store the XML records. The information put away in the database can be questioned utilizing XQuery, serialized, and sent out into an ideal arrangement.
XML database Types
- XML enabled
- Native XML(NXD)
XML empowered database is only the expansion accommodated the change of XML report. This is a social database, where information is put away in tables comprising of lines and segments. The tables contain set of precedents, which thus comprise of fields.
Native XML database depends on the compartment as opposed to table arrangement. It can store enormous measure of XML record and information. Native XML database is questioned by the XPath-articulations.
NativeXML database has a preferred position over the XML-empowered database. It is profoundly fit to store, inquiry and keep up the XML report than XML-empowered database.
In the above example , a table of contacts is created which holds the records of contacts (contact1 and contact2), which in turn consists of three entities − name, company and phone.
In my previous post ,when I am explaining DOM , mentioned XML DOM ,here I will be explaining the DOM in complete.
The Document Object Model (DOM) is the pillar of XML. XML documents have a hierarchy of informational units called nodes, DOM is a way of explaining those nodes and the relationships between them.
A DOM document is a collection of nodes or the pieces of data organised in a hierarchy. This hierarchy allows a developer to navigate through the tree looking structure for specific information. Because it is based on a hierarchy of information, the DOM is said to be tree based.
The XML DOM, on the other hand, also provides an API that allows a developer to add, edit, move, or remove nodes in the tree at any moment in order to create an application.
XML DOM example
Code for address.xml are as follows :
The above example will produce the output look like:
XML DOM example
Name : Renuka Rajendra B
Phone : 123456789
I will conclude the discussion on XML here. Still we need to discuss XML namespace , XML XSLT and XQuery : I will discuss these in future posts.