Sample product catalogue XML with namespaces and CDATA
An XML product catalogue that uses a default namespace, a prefixed namespace, attributes, entity references, a CDATA section, a comment and an empty element.
Download
sample-product-catalog.xml
1.07 KB1,100 bytes
Download XML sampleDirect download. No sign-up and no waiting.
- Type
- application/xml
- SHA-256
dfcedeb315fe33ec13a8ff7d0d48207d1c6bfe96ddaa7bbade987afa0cd2daac- Direct URL
https://sampletestfiles.com/downloads/samples/sample-product-catalog.xml
Why test with this file
Exercises the parts of XML that simple string-based parsers get wrong.
| Products | 4 |
|---|---|
| Namespaces | 2 |
| Features | Attributes, entities, CDATA, comment, processing instruction, empty element |
| Encoding | UTF-8 |
What to check
After your application has processed sample-product-catalog.xml, confirm that:
- Elements in the inventory namespace are found by namespace, not by prefix.
- The CDATA note is returned as literal text, with its angle brackets intact.
- The empty stock element and the processing instruction do not break the parser.
How the file begins
The opening lines of sample-product-catalog.xml, exactly as they appear in the file.
<?xml version="1.0" encoding="UTF-8"?>
<?sample-instruction keep="true"?>
<!-- A sample catalogue for parser testing -->
<catalog xmlns="https://example.com/ns/catalog" xmlns:inv="https://example.com/ns/inventory" generated="2026-01-01">
<product id="P-100">
<name>Standard widget</name>
<price currency="USD">4.50</price>
<inv:stock unit="each">120</inv:stock>
<note>A plain widget & nothing more.</note>
</product>
<product id="P-200">
<name>Large widget</name>
<price currency="USD">9.75</price>
<inv:stock unit="each">40</inv:stock>Preview
Shows the file contents.
Technical details
| File name | sample-product-catalog.xml |
|---|---|
| Format | XML (Extensible Markup Language) |
| Extension | .xml |
| MIME type | application/xml |
| Size | 1,100 bytes (1.07 KB) |
| Kind | Text |
| Signature | 3C 3F 78 6D 6C |
| SHA-256 | dfcedeb315fe33ec13a8ff7d0d48207d1c6bfe96ddaa7bbade987afa0cd2daac |
| Created | 2026-10-10 |
| Validation | Exact size, signature bytes and structure checked when the file was generated |
| Preview | Available on this page |
| Source | Generated for this site; not copied from elsewhere |
| Licence | Free to use, modify and redistribute (terms) |
| Category | Data |
Validated for expected format and integrity. As with any download, scan the file with your own security tools before opening it. How files are made and checked
Download from the command line and verify
Fetch the file with curl, then compare its checksum with the SHA-256 value above.
curl -o sample-product-catalog.xml 'https://sampletestfiles.com/downloads/samples/sample-product-catalog.xml'
sha256sum sample-product-catalog.xml # Linux
shasum -a 256 sample-product-catalog.xml # macOSOn Windows, run Get-FileHash sample-product-catalog.xml -Algorithm SHA256 in PowerShell. A matching value proves that the download is complete and unaltered.
About XML
Structured, self-describing documents built from nested elements and attributes.
Where it fits
- File parser testing
Well-formed files and deliberate edge cases for testing code that reads CSV, JSON, XML, PDF and more.
- API testing
Payloads and attachments for testing REST endpoints that receive, return or transform files.