You are on page 1of 2

HTML vs XML

XML In Comparison With HTML

General Comparison:
HTML XML
HTML is an abbreviation for HyperText stands for eXtensible Markup Language Markup Language. HTML was designed to display data with focus While XML was designed to be a software and on how data looks. 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 While XML is used basically to transport data rendered on the client side. between the application and the database. HTML is about displaying data, hence static. But XML is about carrying information, hence dynamic. HTML does not preserve white space While XML does.

Tag Comparison:
HTML
HTML has its own predefined tags

XML

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 for some specific tags, if But XML makes it mandatory for the user the the user does not use the closing tags. close each tag that has been used. Like <p> and <br>. Like <p> this is a paragraph</p> HTML tags are case insensitive. XML tags are case sensitive. The tag <Letter> is different from the tag <letter>. <Message>This is incorrect</message> <message>This is correct</message> In HTML, you might see improperly nested In XML, all elements must be properly nested elements: within each other: <b><i>This text is bold and italic</b></i> <b><i>This text is bold and italic</i></b>

HTML vs XML

HTML does not require any parent. The XML documents must contain one element interface is designed in the body tag. that is the parent of all other elements. This <body> element is called the root element. .. </body <root> <child> <subchild>.....</subchild> </child> </root> In XML, the attribute values must always be within the inverted commas. <note date="12/11/2007"> <to>Tove</to> <from>Jaun</from> </note> HTML truncates multiple white-space With XML, the white-space in a document is characters to one single white-space: not truncated. HTML: Hello Girl Output: Hello Girl HTML stores a new line as br. XML : Hello Girl Output: Hello Girl XML stores a new line as LF.

You might also like