Validating XML Data Using the Schema XPath and Validate XML Settings
This example demonstrates how to use the Schema XPath field to successfully validate XML data.



CustomersOrders_withXSD.xml,
is
not a regular schema file (.xsd) but an XML file being used as a schema file. The contents
of this file appear as follows:
In the above file, the root element of the schema is nested within the
RootElm
object. Therefore, the Schema XPath field value is
specified as //RootElm/*
to direct the
XML Generator
Snap to the schema object.
ContactName
field. 
ContactName
field is removed from the custom XML specified in the
XML editor and the Pipeline is re-validated, the Snap fails with the following error:


This explains the scenarios in which you need to provide the schema XPath and how you can validate XML data using schema from within any XML or XSD file with the help of the Schema XPath and Validate XML properties.
- Download and import the pipeline in to the SnapLogic Platform.
- Configure Snap accounts, as applicable.
- Provide pipeline parameters, as applicable.