Sample XML
A well-formed XML catalogue with nested elements and attributes — for testing XML parsers and XPath queries.
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<product id="1">
<name>Widget</name>
<price currency="USD">9.99</price>
<tags><tag>tools</tag><tag>hardware</tag></tags>
</product>
<product id="2">
<name>Gadget</name>
<price currency="USD">19.99</price>
<tags><tag>electronics</tag></tags>
</product>
</catalog>
Specifications
- Elements
- catalog › product › name/price/tags
- Attributes
- true
- Declaration
- UTF-8
What is a .xml file?
XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.
How to use this file
Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.
Related files
- csv10,000-Row CSVA CSV with 10,000 data rows — for testing streaming parsers, memory handling, and import performance.
- csvClean CSVA clean, well-formed CSV with a header and 20 rows — the baseline case for CSV parser testing.
- csvE-commerce Customers (CSV, 500 rows)A realistic e-commerce customer directory (500 rows) — part of a relational dataset (products, customers, orders) with CSV, JSON, SQL, and Parquet twins for testing joins, imports, and conversion.
- jsonE-commerce Customers (JSON, 500 records)The e-commerce customers table as a JSON array — the format twin of the CSV, for import and conversion testing.
- sqlE-commerce Database Schema (SQL)A relational SQL schema (products, customers, orders with primary and foreign keys) plus sample INSERTs — the DDL twin of the e-commerce dataset, for testing schema import and migrations.
- csvE-commerce Orders (CSV, 2000 rows)A realistic e-commerce order lines (customer_id → customers, product_id → products) (2000 rows) — part of a relational dataset (products, customers, orders) with CSV, JSON, SQL, and Parquet twins for testing joins, imports, and conversion.
Generated by generation/data_structured.py. Free for any use, no attribution required — license.