Introducing XML
XML is a text-based markup language that enables you to share data in a structured format by using meaningful tags. The term "extensible" implies that you can extend you ability to describe a document by defining meaningful tags for your application. XML is a cross-platform, hardware and software independent markup language. It enables computers to transfer structured data between heterogeneous systems. XML is used as a common data interchange format in a number of applications. In the example of the B2B e-commerce model, XML can be used to exchange data between the trading partners, thus eliminating the problems faced by EDI.
Web Architecture Using XML
In a traditional Web architecture, a client sends a request to the server in a predefined format and receives the appropriate response. The advantage of using XML in Web architecture is that the structure of the request can be obtained from the server at runtime. This is possible because the data stored in an XML document does not assume its intended use. Different applications can extract data according to their customized needs. Since XML is used to exchange data between various Web applications, the coupling between the server application and the client application is relatively loose.
XML can encode non-relational data, as well as, relational data structures. This enables the server application to extract data from any data source, and helps the programmers to quickly build applications for the manipulation of that data.
Difference Between SGML, HTML, and XML
In addition to XML, markup languages such as Standard Generalized Markup Language (SGML) and Hypertext Markup Language (HTML) are also available.
SGML was released in 1980. It allows documents to describe their grammar by specifying the tag set used in the document and the structural relationship that these tags represent. This makes it possible to define individual formats for documents, handle large and complex documents, and manage large information repositories. However, SGML is complex and difficult for developers to master.
HTML was created by Tim Berners-Lee in 1989 as a simple and effective way of generating clear and readable documents. HTML enables you to create documents and Web pages that can be read by all Web browsers. It uses a set of tags in conformance with the SGML specification.
The World Wide Web Consortium (W3C) developed XML to enables the expansion of Web technologies into the new domains of document processing and data interchange. XML is a subset of SGML. It is designed to ease data exchange over the Internet.
Though HTML and XML are markup languages, they have different purposes. HTML is used for data presentation, whereas XML is used for data description and definition.
Advantages of XML
Some of the advantages of XML are :
- Domain-specific vocabulary
- Data interchange
- Smart searches
- Granular updates
- User-selected view of data
- Message transformation
Domain-specific Vocabulary
HTML uses a set of predefined tags to present data in various formats. While working with HTML, you are restricted to the use of only these tags. On the other hand, XML does not have any predefined tags. You can create new tags based on the requirements of the application, that is, you can create domain-specific vocabulary in XML.
Data Interchange
Data interchange is essential to carry out business transactions. You need to establish standard interfaces among related enterprises in which the data is stored in disparate forms to facilitate data interchange. XML produces files that are unambiguous, easy to generate, and easy to read. It provides a structure to store data in textual format, which can then be used as a standard format or protocol for data interchange. This eliminates the differences in the systems that exchange data.
Granular Updates
Document updates in HTML are slow as the entire document needs to be refreshed from the server. In comparison with this, only the changed content needs to be downloaded in XML documents, thus making updates faster. For example, if you need to update stock prices on a Web page, it will take more time to update an HTML document, as the entire page would have to be reloaded. With XML, only the prices can be updated.
User-Selected View of Data
In HTML, you need to create separate HTML pages to display the same information in different formats. This is because an HTML page contains data, as well as, instruction to the browser for the presentation of data. On the other hand, XML concentrates on the data and not on its presentation. You can display XML documents in the required format by using Cascading Style Sheets (CSS) and Extensible Style Sheet Language (XSL). This separation of data from its presentation has various advantages. For example, you can download an XML document once and apply different formatting styles by using CSS or XSL.
A user can select one, several, or all records, and sort by different attributes, format data based on a condition, or switch to the graphical view without requesting the XML document from the server for each operation. The same data can be presented differently, perhaps as a subset, depending on the viewer's role with respect to the data. For example, the accounts department may be able to access financial information, whereas a buyer may not be able to access the same information.
HTML does not allow conditional formatting of a document. For example, it is not possible using HTML to display the name of the product with the highest sales figure in green and the lowest sales figure in red. You can implement conditional formatting of data by using XML.
NOTE
XML uses two types of style sheets, CSS and XSL, to format data. A style sheet contains instruction for the Web browser on how to translate the source document structure into a presentation structure.
Message Transformation
In XML, a message can be stored in the form of a document, object data, or data from a database. XML messages are designed in such a way that they reflect the information content and not the intended use of the messages. XML design provides flexibility while storing data as it does not impose any restriction on the field size and the order in which the data is stored. Data can be extracted based on the needs of the client application.
No comments:
Post a Comment