Briefly discuss XML and its standards, identifying the difference between XML and HTML.
Provide three examples of how XML is used.
Build some example code using XML and the corresponding DTL for the tags used in the XML.
Please find a potential solution in the attached document.
Both HTML and XML are mark up languages used for web pages and web content. HTML has the main focus on document structure and designs, however XML focuses more on the semantics of the information and how to best describe it. Tags used in HTML are mostly generic such as Head for header, Body for body, however tags in XML are more descriptive. They are also known as meta-tags or metadata i.e. data about data. For example XML tags would look like this:
<NAME> J Virdi </NAME>
<AGE> 35 </AGE>
<PROFESSION> Business Analyst </PROFESSION>
An XML document does have a certain structure that it must conform to, and as can be seen in Listing 1, the first line
does not seem to be part of the content or associated markup. An XML document is structured into the following sections:
• XML declaration
• Document Type Declaration
• XML document body which contains markup and content
Three examples of how XML is used:
1. XML can be used for data simplification purposes in data storage and sharing.
2. XML can be used for data simplification in transporting data without worrying about compatibility issues.
3. XML is used for creating new Internet Languages such as XHTML, WSDL, RSS (for news feeds) etc..
Limitations of HTML:
• HTML tags do not describe the meaning of the data included in the tags.
• HTML tags are only usable for the structure, format, and display features rendered in a browser.
• HTML tags are fixed and predefined.
• Searching for particular or specific becomes time-consuming where HTML is used. A general search takes much longer as compared to XML.
Differences between HTML and XML; Why XML?
This solution discusses XML and its standards, identifying the difference between XML and HTML. It also provides examples of how XML is used and some example code using XML and the corresponding DTL for the tags used in the XML.