# XML exc c14n validate

`xml-exc-c14n-validate` · version 1.0.0 · Structured formats · free, no key needed

Check whether XML is already in Exclusive XML Canonicalization 1.0 form.

**Use when you need to: validate exclusive xml canonical form · check xml is already exclusive c14n · exclusive canonicalization idempotence test.**

## Decide before calling

Read the [versioned contract](/v1/tools/xml-exc-c14n-validate/versions/1.0.0) and the supported scope below. Reuse `xml-exc-c14n-validate@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `xml-exc-c14n-validate@1.0.0` for validate exclusive xml canonical form. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- validate exclusive xml canonical form
- check xml is already exclusive c14n
- exclusive canonicalization idempotence test
- detect non canonical exclusive xml
- is xml in w3c exc-c14n form
- reject xml declaration in canonical form check
- check exclusive canonical attribute order
- exclusive c14n well formed canonical check

## Not supported

- xml schema validation
- xml signature verification
- repairing non-canonical xml
- inclusive c14n comparison

## Behavior

- Returns valid true and reason ok only when xml is byte-for-byte the Exclusive XML Canonicalization 1.0 form of itself under the same with_comments and inclusive_prefixes options.
- A well-formed document that differs, including an XML declaration, a BOM, CRLF, a self-closing tag, a reordered attribute, or an unused namespace declaration, returns valid false and reason not_exclusive_canonical.
- Omitted with_comments means false and omitted inclusive_prefixes means an empty list. Those defaults are part of the comparison.
- Malformed XML throws invalid_input. That includes a comment whose content contains "--" or ends with "-"; those are not reported as valid false. DTD syntax and XML 1.1 throw unsupported_input. A declared limit throws limit_exceeded.
- valid true is paired with reason ok, and valid false is paired with reason not_exclusive_canonical. This check does not repair the document and does not verify a signature.
- Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity.

## Input

- `xml` (string, required): min length 1; max length 8192
- `with_comments` (boolean, optional)
- `inclusive_prefixes` (array of string, optional): max items 16; each min length 1; each max length 128; each pattern `^(#default|[A-Za-z_][A-Za-z0-9._-]*)$`

## Output

- `valid` (boolean, required)
- `reason` (one of "ok", "not_exclusive_canonical", required)

## Limits

- max input bytes: 8192
- max canonical bytes: 8192
- max output bytes: 49152
- max depth: 32
- max nodes: 1024
- max attributes per element: 32
- max inclusive prefixes: 16
- max name bytes: 128

## Example

Request input:

```json
{
  "xml": "<n1:elem1 xmlns:n1=\"http://b.example\">\n    content\n</n1:elem1>"
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reason": "ok"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "xml-exc-c14n-validate",
  "version": "1.0.0",
  "input": {
    "xml": "<n1:elem1 xmlns:n1=\"http://b.example\">\n    content\n</n1:elem1>"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/xml-exc-c14n-validate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"xml":"<n1:elem1 xmlns:n1=\"http://b.example\">\n    content\n</n1:elem1>"}'
```

The machine-readable contract is at [/v1/tools/xml-exc-c14n-validate/versions/1.0.0](/v1/tools/xml-exc-c14n-validate/versions/1.0.0).

### CLI

```sh
node cli.mjs run xml-exc-c14n-validate 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [XML exc c14n canonicalize](/tools/xml-exc-c14n-canonicalize): Exclusive XML Canonicalization 1.0 of a whole document, with an optional inclusive prefix list.
- [XML exc c14n subtree](/tools/xml-exc-c14n-subtree): Exclusive XML Canonicalization 1.0 of one selected element and its descendants.
- [Xpath10 paths](/tools/xpath10-paths): List the canonical XPath 1.0 path of each node in a location-path node-set, in document order.
- [Gitconfig key list](/tools/gitconfig-key-list): List git config keys in file order with qualified names and occurrences.
- [Gitconfig format](/tools/gitconfig-format): Format git config sections as canonical text with escapes and subsections.
- [JSON to XML](/tools/json-to-xml): Convert JSON data to an XML string.
