there is no function in DT thru 9.1 that would do this for XML documents. there is an assertion for JSON document schema validation.
I have added my own capability to do xml document schema validation using the Xerces support in groovy as a VSM step
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
XMLShema is a variable that holds the text of the XSD file
XMLData is a variable that holds the text of the XML document to validate
try
{
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
Schema schema = factory.newSchema(new StreamSource(new StringReader(XMLSchema)));
Validator validator = schema.newValidator();
Source source = new StreamSource(new StringReader(XMLData));
validator.validate(source);
_logger.info("schema check successful");
}
catch (SAXParseException ex)
etc..
in XML, the schema is an XSD. I wrote a java utility to extract the XSD from the WSDL so that the users would not have to do this.