Show Table of Contents
11.2. Message Validation
Here is a sample that depicts message validation.
Message Content:
<MyBook xmlns="example"> <Chapter1/> <Chapter2/> </MyBook>
This is the associated XML Schema definition:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="example"
xmlns:orders="example">
<element name="MyBook" type="example:MyBook"/>
<complexType name="MyBook">
<sequence>
<element name="Chapter1" type="string"/>
</sequence>
</complexType>
</schema>
The XML content is still well-formed, but it has a
Chapter2 element that is not declared as the child of MyBook element in the XML schema. Hence the content cannot be validated against the schema.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.