Input Validation is the outer defensive perimeter for your web application.
This perimeter protects the core business logic, processing and output generation.
Xsl Compiled Transform transform = new Xsl Compiled Transform(true); transform.
Load("XSLTFile1.xslt", new Xslt Settings(true, true), null); Xml Reader input = Xml Reader. Transform(input, null, output); How can I verify my output xml file on XSD during xslt transformation?
Create("XMLFile1.xml"); Xml Writer output = Xml Writer. for example: if xslt tries to make another definite tag (with the same name) and XSD don't allow it - xslt transformator will not do it (or generates exception) XSLT 1.0 is not schema-aware.
No compliant XSLT 1.0 processor has any facility for specifying the schema for the desired output and for validationg the output.
In both cases, the variation possible in document was enormous.
This decade, I been twice involved in quite intense year-long projects to do exhaustive acceptance testing of XML transformations using Schematron. So the context here is the need for error-free transformations of large numbers of high-value complex documents, where the number of documents and the dollar values of the project are in the multiple millions.
In both cases, the tests can be summarized as figuring out what is invariant in any pairs of input/output documents: the basic thing is to count corresponding elements, and to compare corresponding data values.
Connected to this perimeter are separately guarded (and very suspicious looking) “allies” including the Model/Database and Filesystem.
Nobody wants to shoot them but if they press their luck..