What is XML ?
Extensible Markup Language (XML) is the markup language data (meta-markup language) that provides a format for describing structured data. This facilitates more precise declarations of content and more significant results of search through multiple platforms. XML will also allow the emergence of a new generation of applications, manipulation and visualization of data via Internet.
XML allows the definition of an infinite number of tags. As in HTML, where the tags can be used to define the formatting characters and paragraphs, XML provides a system to create tags for structured data.
An XML element can be declared as data sales prices, price rates, a title of book, the amount of rain, or any other item of data. As XML tags are adopted by intranets of organizations, and also via the Internet, there will be a corresponding ability to search for and manipulate data regardless of where the applications are found. Once the data has been found, it can be distributed by the network and displayed in a browser like Internet Explorer 5 in several ways, or that data can be transferred to other applications for processing and future viewing.
Introduction to XML - Extensible Markup Language
WebSite now almost all are of pages in HTML (HyperText Markup Language). The term hypertext is defined as texts that have links to other texts. Already the term markup language annotations to define the structure of a text. The design of HTML documents have two important characteristics:
1. Html documents are made to provide logical structure of information for the presentation of pages of the global network of computers.
2. The language contains a set of HTML tags with a fixed number to define the document structure, and each tag has already defined its semantics. The CSS (Cascading Style Sheets) allows the separation of the logical structure of the appearance of the page. But, although the layout can be separately defined in CSS, the HTML is designed specifically for hypertext, and not to information in general!
XML - Extensible Markup Language is not a substitute for HTML - Hypertext Markup Language. Both are designed to provide the below goals.
- The main function of XML is to transport and store data including the format.
- The main function of HTML is to display data, including the display of data.
Comparison between XML and HTML
HTML and XML are cousins. They derive from the same inspiration, the SGML. They identify elements in a page, and both use similar syntax. If you are familiar with HTML, it will be more easy to work with the XML. The big difference between HTML and XML is that HTML describes the appearance and actions on a page in the network as XML does not describe or appearance and actions, but what each piece of data is or is. In other words, XML describes the content of the document.
As HTML, XML also makes use of tags (words encapsulated by signs < & > ) and attributes (set with name = value ), but while HTML specifies each direction for the tags and attributes (and often the way in which the text between them will be displayed in a browser). The XML tags are only use to delimit pieces of data, and leaves the interpretation of data to be held fully to the application that is reading. In short, while in an HTML document <p> a tag indicates a paragraph in the XML tag that can indicate a price, a parameter, a person, or anything else you can imagine (including something that has nothing to do with a p such as authors of books).
The XML files are text files, but are not intended for reading by a human being as is HTML. The XML documents are text files that they facilitate the developers or developers' debugging "applications more easily, so a simple text editor, can be used to correct an error in an XML file. But the rules for formatting XML documents are much stricter than for HTML documents. A forgotten tag or an attribute without quotes makes the document unusable, while in HTML it is tolerated. The official XML specifications require that applications can not try to guess what is wrong in a file (in HTML that happens), but must interpret it to stop and report the error.
Features
1). Structured representation of data :
XML provides a structured representation of data that was shown to be extensively implementable and easy to be developed. Industrial implementations in language SGML (Standard Generalized Markup Language) showed the intrinsic quality and strength of industrial tree structured format of XML documents. XML is a subset of SGML that is optimized for distribution via the web, and is defined by the Word Wide Web Consortium (W3C), ensuring that structured data will be uniform and independent of applications and vendors. XML provides a standard that can encode the content for a variety of applications from simple to the most complex, including:
- A simple document.
- A record structured as a purchase order for products.
- An object with methods and data objects such as Java or ActiveX controls.
- A record of data. An example would be the result of a query to databases.
- Layout and user interface applications.
- Entities and types of layout patterns.
- All links between information and people on the web.
An important feature is that once the data has been received by the customer, this data can be manipulated, edited and viewed without the need to react the server. Thus, the servers have less overhead, reducing the need for computing and reducing also the request for bandwidth for communications between client and server. XML is considered of great importance in the Internet and intranets in large because of interoperability provides the ability of computers to have a flexible and open standard, independent of device. The applications can be built and updated more quickly and also allow multiple ways of viewing the structured data.
2). Separation between data and presentation :
The most important feature of XML comes to separate the user interface (presentation) of structured data. The HTML specifies how the document should be displayed on the screen by a browser. But the XML defines the content of the document. For example, HTML tags are used to define size and color of font, and paragraph formatting. In XML you use the tags to describe data, such as tags, topic, title, author, content, references, dates, etc. XML also has resources such as style sheets defined in Extensible Style Language (XSL) and Cascading Style Sheets (CSS) for presentation of data in a browser. XML separates data from presentation and process, which allows you to view and process the data as you wish, using different style sheets and applications.
Structure of document
An XML document is a labeled tree where a node is outside of :-
Data of characters (a string of text)
Processing instructions (annotations for the processor), typically in the header of the document
A comment (not together with semantics)
A declaration of entity (simple macros)
We DTD (Document Type Declaration)
An internal node is an element, which is labeled with:
A name or
A set of attributes, each consisting of a name and value.
Typically, comments, statements of entities and DTD information is not explicitly represented in the tree.
Example :
HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Mac</to>
<from>James</from>
<heading>Alert</heading>
<body>Call me on sunday</body>
</note>
The first line in the above example is called declaration. It denotes the version of XML and the used encoding. The next line "note" indicates the root element of the document. Like the above codes denotes that the documents is reminder note. The next 4 lines are called child elements. And of course the last line denotes the end.
HTML Code:
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
The above is an sample of tree view of XML language.
Bookmarks