XML
Beginner
1 min read
What Is XML and Why It Matters
Example
<?xml version="1.0" encoding="UTF-8"?>
<!-- A simple well-formed XML document describing a bookstore -->
<bookstore>
<book category="fiction">
<title lang="en">The Great Gatsby</title>
<author>F. Scott Fitzgerald</author>
<year>1925</year>
<price currency="USD">12.99</price>
</book>
<book category="non-fiction">
<title lang="en">Clean Code</title>
<author>Robert C. Martin</author>
<year>2008</year>
<price currency="USD">35.00</price>
</book>
<!--
Rules that make this document well-formed:
1. Single root element <bookstore>
2. Every tag is properly closed
3. Elements are correctly nested (no overlapping)
4. Attribute values are enclosed in quotes
5. XML declaration at the top (optional but recommended)
-->
</bookstore>