What Is XML?

XML (Extensible Markup Language) is a text-based markup language for representing structured data. Unlike HTML, XML does not define a fixed vocabulary of tags; an XML format defines element names appropriate to its own data.

XML is designed so data can be stored, exchanged and parsed consistently across systems. XML is used by formats and technologies such as RSS, SVG, SOAP documents, configuration files and many application-specific data feeds.

A simple XML example Top ↑

<?xml version="1.0" encoding="UTF-8"?>
<book id="B101">
  <title>Learning XML</title>
  <author>Sam Lee</author>
</book>

The element names describe the data. The application reading this document decides what those names mean.

Basic rules for well-formed XML Top ↑

  • An XML document has exactly one document/root element.
  • Start and end tags must match and are case-sensitive.
  • Elements must be properly nested.
  • Attribute values must be quoted.
  • Reserved characters such as < and & must be escaped when they are data rather than markup.

A document can be well-formed because it follows XML syntax, and it can additionally be valid when it conforms to rules defined by a schema or DTD.

XML vs HTML Top ↑

HTML defines elements such as <p>, <a> and <table> for web documents. XML lets a data format define its own element vocabulary. HTML parsing in text/html also has error-recovery rules and permits some omitted tags, while XML parsing requires well-formed syntax.

Is the XML declaration required? Top ↑

The declaration is optional in many XML documents, but when used it appears at the beginning and can specify the XML version and character encoding.

<?xml version="1.0" encoding="UTF-8"?>

Existing Plus2net XML sample Top ↑

Open sample XML file

Example showing the tree structure of an XML document
XML documents form a tree of nested elements beneath one document element.

Continue learning XML Top ↑

XML file structure and elements XML attributes

Frequently Asked Questions Top ↑

Is XML a programming language?
No. XML is a markup format used to represent structured data.

Are XML tags predefined?
XML itself does not define application-specific element names. A particular XML vocabulary or schema defines the names and rules it uses.

Is XML case-sensitive?
Yes. <Name> and <name> are different element names.





plus2net.com










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2026   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer