Introduction about XML

what is XML?

  • XML stands for eXtensible Markup Language
  • XML is a markup language similar to HTML
  • XML became designed to save and shipping records
  • XML turned into designed to be self-descriptive
  • XML is a W3C recommendation
  • XML Does now not DO some thing
  • maybe it's miles a touch tough to apprehend, however XML does no longer DO some thing.






This note is a note to Tove from Jani, saved as XML:

<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>take into account me this weekend!</body>
</note>

The XML above is pretty self-descriptive:


  • It has sender data.
  • It has receiver data
  • It has a heading
  • It has a message body.
  • but nonetheless, the XML above does now not DO some thing. XML is simply statistics wrapped in tags.


A person need to write a piece of software to send, receive, save, or show it:


notice
To: Tove

From: Jani

Reminder
consider me this weekend!

The difference between XML and HTML
XML and HTML were designed with exclusive goals:


  • XML turned into designed to hold facts - with attention on what records is
  • HTML became designed to display records - with recognition on how facts appears
  • XML tags are not predefined like HTML tags are
  • XML Does no longer Use Predefined Tags
  • The XML language has no predefined tags.


The tags in the instance above (like <to> and <from>) are not defined in any XML general. these tags are "invented" by the writer of the XML file.

HTML works with predefined tags like <p>, <h1>, <table>, etc.

With XML, the author ought to outline both the tags and the file structure.

XML is Extensible

most XML programs will work as predicted even though new statistics is brought (or removed).

imagine an application designed to display the original model of observe.xml (<to> <from> <heading> <data>).

Then consider a more moderen version of word.xml with brought <date> and <hour> factors, and a removed <heading>.

The way XML is built, older version of the application can still work:

<note>
  <date>2015-09-01</date>
  <hour>08:30</hour>
  <to>Tove</to>
  <from>Jani</from>
  <body>recall me this weekend!</body>
</note>

Share this

Related Posts

Previous
Next Post »