Skip to main content

Short note: XML

Short answer

XML is an extensible W3C markup language that describes data using user-defined tags, with strict well-formed syntax and validation via DTD or Schema. It is platform-independent and used for data exchange, configuration and AJAX, though more verbose and slower to parse than JSON.

Write a short note on XML.

XML (eXtensible Markup Language) is a W3C standard markup language for describing and carrying data. Unlike HTML, which defines how data is displayed, XML defines what the data is. Users create their own tags, so it is "extensible".

Features

  • Self-describing, text-based and platform independent.
  • Strict syntax: one root element, every tag closed, correct nesting, case sensitive, attribute values in quotes. A document that follows this is well-formed.
  • A document can be checked against a DTD or XML Schema (XSD); then it is valid.
  • Display can be separated from data using CSS or XSLT.
  • Parsed using DOM or SAX.

Example

<?xml version="1.0"?>
<student id="101">
  <name>Sita Sharma</name>
  <semester>8</semester>
  <subject>Internet and Intranet</subject>
</student>

Uses

  • Data exchange between different systems (web services, SOAP).
  • Configuration files, RSS/Atom feeds, SVG, office documents.
  • Together with JavaScript in AJAX.

Advantages and limits

  • Easy to read, flexible, supports Unicode, and works on any platform.
  • Verbose compared with JSON, and parsing is slower for large files.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Internet and Intranet chapter 6 questions →