XML Introduction

Estudies4you
INTRODUCTION TO XML

INTRODUCTION TO XML

Learning Objectives
By the end of this topic, you will be able to:
  • A Understand XML DTD
  • Explain how to validate XML Document using XML DTD
  • Understand XML Schema
  • Explain how to validate XML Document using XML Schema
HTML vs XML
  • HTML stands for Hyper Text Markup Language and is designed to display data
  • XML stands for Extensible Markup Language and is designed to transport and store data, not to display data
  • XML tags are not predefined. You can define your own tags. The tags used in HTML (and the structure of HTML) are predefined. HTML documents can only use tags defined in the HTML standard (like <p>, <hl>, etc.)
  • XML is designed to be self-descriptive
  • XML is a W3C Recommendation
HTML and XML Use
HTML is about displaying information
XML is about carrying information
  • XML is not a replacement for HTML
  • XML and HTML were designed with different goals:
    • XML was designed to transport and store data, with focus on what data is
    • HTML was designed to display data, with focus on how data looks
XML-An Example
XML was created to structure, store, and transport information.
<note>
<to> Raju </to>
 <from>Ravi</from>
<heading>Reminder</heading>
<body>Don't forget to meet me this weekend!</body>
</note>
  • The XML code (for note here) is quite self descriptive
  • It has sender and receiver information, it also has a heading and a message body
  • But still, this XML document does not DO anything
  • It is just pure information wrapped in tags. Someone must write a piece of software to send, receive or display it
XML Tags
XML is nothing special. It is just plain text. Software that can handle plain text can also handle XML. However, XML-aware applications can handle the XML tags specially.
<note>
<to> Raju </to>
<from>Ravi</from>
…………………………….
</note>
  • XML language has no predefined tags. With XML you invent your own tags. The functional meaning of the tags depends on the nature of the application
  • The tags in the example (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document


To Top