To know the difference between HTML & XML, first of all we need to know what is HTML and XML.
What is HTML :- HTML(Hyper Text Markup Language ) is a markup language used for describing web pages.
What is XML :- XML(EXtensible Markup Language) is a software and hardware independent tool for storing and transporting data.
Following are the differences between HTML and XML :-
HTML :-
1. HTML is a markup language itself.
2. HTML is case insensitive.
3. HTML has it own predefined tags.
4. HTML is not strict if the user does not use the closing tags.
5. HTML is about displaying data,hence static.
6. HTML does not preserve white space.
<!DOCTYPE html>
<html>
<head>
<title>This is a title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>Document content goes here.....</p>
</body>
</html>
XML :-
1. XML provides a framework for defining markup languages.
2. XML is case sensitive.
3. Custom tags can be defined and the tags are invented by the author of the XML document.
4. XML makes it mandatory for the user the close each tag that has been used.
5. XML is about carrying information,hence dynamic.
6. XML preserves white space.
<?xml version="1.0"?>
<PARTS>
<TITLE>Computer Parts</TITLE>
<PART>
<ITEM>Hard disk drives external (HDDs)</ITEM>
<MANUFACTURER>Sony</MANUFACTURER>
<MODEL>P3B-F</MODEL>
<COST> 123.00</COST>
</PART>
<PART>
<ITEM>Video Card</ITEM>
<MANUFACTURER>ATI</MANUFACTURER>
<MODEL>All-in-Wonder Pro</MODEL>
<COST> 160.00</COST>
</PART>
<PART>
<ITEM>Sound Card</ITEM>
<MANUFACTURER>Creative Labs</MANUFACTURER>
<MODEL>Sound Blaster Live</MODEL>
<COST> 80.00</COST>
</PART>
<PART>
<ITEM inch Monitor</ITEM>
<MANUFACTURER>LG Electronics</MANUFACTURER>
<MODEL> 995E</MODEL>
<COST> 290.00</COST>
</PART>
</PARTS>
0 Comment(s)