Title99/100
Validate XML
The title clearly communicates the tool’s action and subject. Keep it concise.
Description98/100
Validate an XML document with xmlvalid: well-formedness, an XSD, DTD or RelaxNG schema, and for e-invoices the Schematron business rules of EN 16931, Peppol BIS, XRechnung, Factur-X and national formats. Pass the document as `xml` (its text) or `url` (a public http(s) address), and a `schema`: a catalog slug from search_schemas, a saved schema ("@orders-v3"), or "auto" to use the e-invoice profile the document names. Without a schema only well-formedness is checked. Returns valid, errors and warnings with line, column, message, rule and a help_url explaining each. Counts as one API validation of the account's monthly quota.
The description explains the capability, when to use it, and what to expect.
Inputs94/100
Input documentation gives an agent enough context to populate the arguments.
xml
The XML document itself. Use url instead for a document on the web.
Clear enough to supply this argument.
url
A public http(s) URL of the document, fetched by xmlvalid.
Clear enough to supply this argument.
schema
A catalog slug (see search_schemas), "@<name>" for a saved schema, or "auto" for the e-invoice profile the document names. Leave out to check well-formedness only.
Clear enough to supply this argument.
name
A file name to show in the result, such as invoice-42.xml.
Clear enough to supply this argument.
rules_version
Pin Schematron rule sets to releases, as rule-set@version, comma-separated ([email protected]): the call fails with rules_version_mismatch when one has moved on. The result's rule_sets lists the releases that ran.
Clear enough to supply this argument.
wait
Seconds to wait for the result before returning a pending status to poll with get_validation; 30 when left out, 0 to return at once.
Clear enough to supply this argument.
Annotations100/100
All four behavior hints are declared.
{
"title": "Validate XML",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}Output schema84/100
The output schema explains the structured result.
View output schema
{
"type": "object",
"required": [
"id",
"status"
],
"properties": {
"id": {
"type": "string",
"description": "The validation id, for get_validation."
},
"error": {
"type": [
"string",
"null"
],
"description": "What went wrong on our side when status is failed."
},
"rules": {
"type": [
"object",
"null"
],
"properties": {
"name": {
"type": "string"
}
}
},
"result": {
"type": [
"object",
"null"
],
"required": [
"valid",
"errors",
"warnings"
],
"properties": {
"pdf": {
"type": "object",
"properties": {
"profile": {
"type": [
"string",
"null"
]
},
"guideline": {
"type": [
"string",
"null"
]
},
"attachment": {
"type": "string",
"description": "The XML file validated, such as factur-x.xml."
}
},
"description": "For a PDF, the invoice found in it."
},
"bytes": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"outcome"
],
"properties": {
"name": {
"type": "string"
},
"valid": {
"type": "boolean"
},
"outcome": {
"type": "string"
}
}
},
"description": "For an archive, one result per document."
},
"valid": {
"type": "boolean",
"description": "True for the outcomes valid and warnings."
},
"engine": {
"type": [
"object",
"null"
],
"properties": {
"libxml2": {
"type": "string"
},
"saxonjs": {
"type": [
"string",
"null"
]
},
"xmlvalid": {
"type": "string"
}
}
},
"errors": {
"type": "array",
"items": {
"type": "object",
"required": [
"line",
"message"
],
"properties": {
"line": {
"type": "integer",
"description": "0 when the message is about the whole document."
},
"path": {
"type": [
"string",
"null"
],
"description": "Where a business rule fired, as an XPath with the document's prefixes."
},
"rule": {
"type": [
"string",
"null"
],
"description": "The business rule that failed, such as BR-CO-15; explain it with explain_rule."
},
"type": {
"type": "string",
"description": "syntax, xsd, relaxng, dtd, schema, io, schematron (a business rule), archive or pdf."
},
"level": {
"enum": [
"warning",
"error",
"fatal"
],
"type": "string"
},
"column": {
"type": "integer",
"description": "0 when unknown."
},
"message": {
"type": "string"
},
"help_url": {
"type": [
"string",
"null"
],
"description": "A page explaining this kind of error and how to fix it."
},
"rule_url": {
"type": [
"string",
"null"
],
"description": "The rule's page on xmlvalid.com."
},
"message_en": {
"type": [
"string",
"null"
],
"description": "The message in English, for a rule its publisher wrote in another language."
}
}
},
"description": "The errors, the first 50 when errors_listed is set."
},
"sha256": {
"type": [
"string",
"null"
]
},
"outcome": {
"enum": [
"valid",
"warnings",
"invalid",
"schema",
"input",
"failed"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"line",
"message"
],
"properties": {
"line": {
"type": "integer",
"description": "0 when the message is about the whole document."
},
"path": {
"type": [
"string",
"null"
],
"description": "Where a business rule fired, as an XPath with the document's prefixes."
},
"rule": {
"type": [
"string",
"null"
],
"description": "The business rule that failed, such as BR-CO-15; explain it with explain_rule."
},
"type": {
"type": "string",
"description": "syntax, xsd, relaxng, dtd, schema, io, schematron (a business rule), archive or pdf."
},
"level": {
"enum": [
"warning",
"error",
"fatal"
],
"type": "string"
},
"column": {
"type": "integer",
"description": "0 when unknown."
},
"message": {
"type": "string"
},
"help_url": {
"type": [
"string",
"null"
],
"description": "A page explaining this kind of error and how to fix it."
},
"rule_url": {
"type": [
"string",
"null"
],
"description": "The rule's page on xmlvalid.com."
},
"message_en": {
"type": [
"string",
"null"
],
"description": "The message in English, for a rule its publisher wrote in another language."
}
}
},
"description": "The warnings, the first 50 when warnings_listed is set."
},
"documents": {
"type": "object",
"properties": {
"total": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"passed": {
"type": "integer"
},
"skipped": {
"type": "integer"
}
},
"description": "For an archive: errors and warnings are then in items."
},
"duration_ms": {
"type": "integer"
},
"errors_total": {
"type": "integer"
},
"errors_listed": {
"type": "integer",
"description": "Set when errors were cut to this many; errors_total counts them all."
},
"warnings_total": {
"type": "integer"
},
"warnings_listed": {
"type": "integer",
"description": "Set when warnings were cut to this many."
},
"errors_truncated": {
"type": "boolean",
"description": "More than the 500 errors the API keeps were found."
}
},
"description": "Null until the validation is done."
},
"schema": {
"type": [
"object",
"null"
],
"properties": {
"kind": {
"type": "string"
},
"name": {
"type": "string"
},
"saved": {
"type": "string",
"description": "The saved schema, as @<name>."
},
"catalog": {
"type": "string",
"description": "The catalog slug."
},
"detected": {
"type": "boolean",
"description": "True when schema \"auto\" picked this profile."
}
},
"description": "Null when only well-formedness was checked."
},
"status": {
"enum": [
"queued",
"running",
"done",
"failed",
"cancelled"
],
"type": "string",
"description": "queued or running: poll get_validation with the id; done: see result."
},
"document": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "integer"
},
"source": {
"enum": [
"upload",
"url",
"body"
],
"type": "string"
}
}
},
"progress": {
"type": "integer",
"maximum": 100,
"minimum": 0
},
"rule_sets": {
"type": "array",
"items": {
"type": "object",
"required": [
"key",
"name",
"version"
],
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"description": "The Schematron rule sets that ran after the schema check, at their releases."
},
"created_at": {
"type": "string"
},
"finished_at": {
"type": [
"string",
"null"
]
}
}
}