140 likes | 162 Views
Learn the difference between XML and HTML, the key features of XML as a markup language, its extensibility, design principles, and benefits. Understand how XML defines and carries data, its self-descriptive nature, modularity, and support for structured data. Grasp the importance of well-formed and valid XML documents according to W3C recommendations.
E N D
INTRODUCTION TO XML
Topics To Be Discussed………. • Introduction • Difference between XML and HTML • Features of XML
Introduction Mark up Language : A markup language is a set of rules/tags that define structure and format of text while processing text. Example of markup language is HTML. Limitations of markup language are: • It has limited predefined tags. • A document might not be portable to other applications because data is not self describing.
Extensible Markup Language • XML stands for Extensible Markup Language • XML is a text based markup language • XML is a markup language much like HTML • XML was designed to carry data, not to display data • XML tags are not predefined. You must define your own tags • XML is designed to be self-descriptive • XML is a W3C Recommendation
Difference between XML and HTML HTML was designed to display data with focus on how data looks while XML was designed to be a software and hardware independent tool used to transport and store data, with focus on what data is.HTML is a markup language itself while XML provides a framework for defining markup languages.
HTML is a presentation language while XML is neither a programming language nor a presentation language. HTML is case insensitive while XML is case sensitive. HTML is used for designing a web-page to be rendered on the client side while XML is used basically to transport data between the application and the database .
HTML has it own predefined tags while what makes XML flexible is that custom tags can be defined and the tags are invented by the author of the XML document. HTML is not strict if the user does not use the closing tags but XML makes it mandatory for the user the close each tag that has been used.HTML does not preserve white space while XML does.
HTML is about displaying data, hence static but XML is about carrying information, hence dynamic. Thus, it can be said that HTML and XML are not competitors but rather complement to each other and clearly serving altogether different purposes.
Features of XML Platform Independent : XML is based on Unicode. Therefore, it is platform independent, It is created using standard text files. These files are compatible with all platforms such Windows, Linux etc. Designed to carry data: XML was designed to carry data. It will not display data. XML was designed to describe data and to focus on what data is where . Self –Describing Data: The date in XML documents is self describing.
Free and Extensible: XML tags are not predefined, rather it is the author of the document who has to create or invent the tags as per their needs. Modularity: XML enables multiple DTD on one document or single DTD for multiple documents. Container Tags: XML allows user defined tags but they must be the container tags. All tags should have distinct start and close components.
Structured and integrated data: XML specifies not only data, but also structure of that data and how various elements are integrated into other elements. This is very important when you are dealing with complex and important data. Well-formed XML Documents: An XML document must follow the syntax and rules set by XML by W3C (World Wide Web Consortium) in the XML1.0 specifications. Each element must nest inside any enclosing elements property.
Valid XML Documents: An XML document is valid if there is a Document Type Definition(DTD) associated with it and if document compiles with that DTD. A document’s DTD specifies the correct syntax of the document. XML is W3C Recommendation: XML is supported and recommended by World Wide Web Consortium(W3C).