What is the difference between xml & html?


2 Answers

Ryan Viola Profile
Ryan Viola answered

XML is designed to transport and store data while HTML is designed to display data.

David Cornish Profile
David Cornish answered

HTML is a language made for representing formatted text. As the acronym goes, it's HyperText Markup Language. It's a language for marking formatted text. Because it's used in so many browsers and systems, it's extremely faulting-tolerant, allowing invalid tags and missing tags to just slide by.

XML is a language made for representing any sort of data in a (supposedly) human-readable format. Numbers, spreadsheets, video game levels, etc. It relies on similar tags to HTML but forgoes the fault tolerance. If any of the tags are mismatched or misspelled, the XML is rejected as “malformed.” Because storing data as text is large and inefficient, and the format is so brittle, few people use it anymore.

In short: HTML is for text in web browsers. XML is for fault intolerant human-readable data storage.

Answer Question