This page provides examples of XML (eXtensible Markup Language) content, specifically tailored for English users. XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
Basic Structure
Here's a basic structure of an XML document:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<element attribute="value">Content</element>
</root>
Example 1: Simple XML Document
This is a simple XML document that lists some books:
<?xml version="1.0" encoding="UTF-8"?>
<library>
<book>
<title>Harry Potter and the Sorcerer's Stone</title>
<author>J.K. Rowling</author>
</book>
<book>
<title>1984</title>
<author>George Orwell</author>
</book>
</library>
Example 2: XML with Attributes
XML elements can have attributes that provide additional information:
<?xml version="1.0" encoding="UTF-8"?>
<library>
<book id="1">
<title>Harry Potter and the Sorcerer's Stone</title>
<author>J.K. Rowling</author>
</book>
<book id="2">
<title>1984</title>
<author>George Orwell</author>
</book>
</library>
Resources
For more information on XML, you can visit our XML Tutorial page.
XML Schema