Validating xml schema
A common use case in Mule ESB flows is validating if an XML document is valid against a corresponding XSD, so we can make sure we are receiving the correct XML, and will forward it for the further processing.Syntax: The "standard" way of Validating XML schema in Mule is by using the schema-validation-filter and especially in combination with the message-filter.
In this case, the Schematron Schema is to be found in the same folder as the XML Document.I tryed to validate a XML file using a XSD schema with the example from here: Articles/xml/validationxpath/. The example works, but when I add the target Namespace attribute in the XSD file the validation fails with the message: Cannot find the declaration of element 'birthdate'. The DTD is retrieved automatically based on the DOCTYPE of the parsed document.All you have to do is use a parser that has DTD validation enabled: option, which loads the DTD and weaves attribute default values into the document.