# XML and JSON Schema validation

*MuleSoft Developer II Study Guide · Implement performant and reliable Mule applications · Last updated November 7, 2026 · https://www.certifyforce.com/study-guide/mulesoft-developer-ii/implement-performant-and-reliable-mule-applications/xml-and-json-schema-validation*

Select XML and JSON validation inputs, schema resources and parser controls, then read the applicable structured violation report without confusing documents with contracts.

- Certification: Salesforce MuleSoft Developer II
- Exam section: Implement performant and reliable Mule applications
- Study guide: https://www.certifyforce.com/study-guide/mulesoft-developer-ii

**Official exam objective:**

> Validate messages against XML- or JSON-Schema documents.

## What the exam expects

- Validate an instance document against the intended XML or JSON contract.
- Resolve schema resources and choose explicit document inputs.
- Set JSON parsing options and an applicable schema dialect.
- Preserve useful violations while keeping XML entity expansion safe.

An **instance** is the document being checked; a **schema** defines its constraints; a **dialect** identifies a JSON Schema draft; a **redirect** maps a schema URI; a **violation report** explains failed constraints. Module versions matter: JSON2.3 introduced direct schema text and JSON2.4 added Draft6/7 support, both before the exam baseline. Later patch fixes must not be assumed for earlier installations. [JSON releases](https://docs.mulesoft.com/release-notes/connector/json-module-release-notes)

## Key facts

| Fact | Detail | Source |
|---|---|---|
| XML document input | Content overrides the payload default. | [XML validation](https://docs.mulesoft.com/xml-module/latest/xml-schema-validation) |
| Multiple XSD locations | Use commas in Schemas; check resolution compatibility separately. | [XML reference](https://docs.mulesoft.com/xml-module/latest/xml-reference) |
| JSON contract input | Choose a Schema location or direct Schema Content. | [JSON validation](https://docs.mulesoft.com/json-module/latest/json-schema-validation) |
| Offline references | Package schemas and configure URI redirects. | [JSON validation](https://docs.mulesoft.com/json-module/latest/json-schema-validation) |
| Repeated keys | Set Allow Duplicate Keys to false to reject them. | [JSON reference](https://docs.mulesoft.com/json-module/latest/json-reference) |
| Decimal reading | Allow Arbitrary Precision selects the numeric-reading mode. | [JSON reference](https://docs.mulesoft.com/json-module/latest/json-reference) |
| Dialect selection | Declare the intended supported `$schema` in the schema node. | [JSON reference](https://docs.mulesoft.com/json-module/latest/json-reference) |
| XML entity protection | NEVER is the documented expansion setting for these risks. | [XML reference](https://docs.mulesoft.com/xml-module/latest/xml-reference) |
| XML violations | Iterate the report's line, column and description objects. | [XML validation](https://docs.mulesoft.com/xml-module/latest/xml-schema-validation) |
| JSON violations | Preserve the structured error-message payload. | [JSON validation](https://docs.mulesoft.com/json-module/latest/json-schema-validation) |

## Check yourself

- Why should support keep schema and instance pointers distinct in a Draft4 report?
- When locating an affected value in the input document, which pointer do you use?
- What does `keyword` identify in the illustrated report?

## Sources

- [XML schema validation](https://docs.mulesoft.com/xml-module/latest/xml-schema-validation)
- [XML Module reference](https://docs.mulesoft.com/xml-module/latest/xml-reference)
- [JSON schema validation](https://docs.mulesoft.com/json-module/latest/json-schema-validation)
- [JSON Module reference](https://docs.mulesoft.com/json-module/latest/json-reference)
- [JSON Module release notes](https://docs.mulesoft.com/release-notes/connector/json-module-release-notes)
- [XML Module release notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-xml)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 12 linked practice questions, and unlimited timed mock exams are included with the MuleSoft Developer II pack (USD $19): https://www.certifyforce.com/practice-exams
