XSD Validator Online
Validate XML against an XML Schema (XSD 1.0, libxml2): errors with line, XPath and message; multi-file schemas with xs:include / xs:import in a ZIP.
Result
Press “Run” to see the result.
Send the XML and its schema and get every validation error with line, col, xpath and the libxml2 message, plus a bilingual summary. The stage tells where it failed: xsd_parse (the schema is not well-formed), xsd_compile (the schema itself is wrong, e.g. an unknown type or a missing include), xml_parse (the document is not well-formed) or validate.
Schemas split over several files (xs:include, xs:import, e.g. UBL 2.1, ISO 20022, Vietnamese e-invoice and tax XSD packages) are supported: upload them as a ZIP in schema_zip and name the entry point with schema_main, or pass schemas as a { "file.xsd": "<xs:schema…>" } object. Files are resolved by their name or path inside the ZIP; nothing is fetched from the network.
Engine: libxml2 (MIT) compiled to WebAssembly, running in a separate APIBox Worker. XML Schema 1.0 only (no XSD 1.1 assertions); Schematron rules are not evaluated. External entities are never loaded. XML and schema up to 10 MB each (less on the free plan).
Use this in your code
curl -X POST "https://apibox.io.vn/v1/xsd-validate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"xml":"<invoice><no>A1</no><total>100</total></invoice>","xsd":"<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><xs:element name=\"invoice\"><xs:complexType><xs:sequence><xs:element name=\"no\" type=\"xs:int\"/><xs:element name=\"total\" type=\"xs:decimal\"/></xs:sequence></xs:complexType></xs:element></xs:schema>"}'const res = await fetch('https://apibox.io.vn/v1/xsd-validate', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"xml": "<invoice><no>A1</no><total>100</total></invoice>",
"xsd": "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><xs:element name=\"invoice\"><xs:complexType><xs:sequence><xs:element name=\"no\" type=\"xs:int\"/><xs:element name=\"total\" type=\"xs:decimal\"/></xs:sequence></xs:complexType></xs:element></xs:schema>"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/xsd-validate",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"xml": "<invoice><no>A1</no><total>100</total></invoice>", "xsd": "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><xs:element name=\"invoice\"><xs:complexType><xs:sequence><xs:element name=\"no\" type=\"xs:int\"/><xs:element name=\"total\" type=\"xs:decimal\"/></xs:sequence></xs:complexType></xs:element></xs:schema>"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/xsd-validate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"xml":"<invoice><no>A1</no><total>100</total></invoice>","xsd":"<xs:schema xmlns:xs=\\"http://www.w3.org/2001/XMLSchema\\"><xs:element name=\\"invoice\\"><xs:complexType><xs:sequence><xs:element name=\\"no\\" type=\\"xs:int\\"/><xs:element name=\\"total\\" type=\\"xs:decimal\\"/></xs:sequence></xs:complexType></xs:element></xs:schema>"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
Which XSD version is supported?
XML Schema 1.0 (libxml2). XSD 1.1 features such as xs:assert are refused with a clear error.
My schema imports other files. What do I send?
A ZIP with all .xsd files in schema_zip and the main file name in schema_main; includes are resolved by name or relative path.
Is there a built-in schema library?
Not yet: send the schema you were given. Official schemas change often and their licences differ, so APIBox does not redistribute them.