# Sunday, November 10, 2013



Stylus Studio X15 build 1910m takes an additional step toward supporting XML Schema 1.1. Here an example which shows how to use XML Schema 1.1 in Stylus Studio.

The following schema makes use of assertions, a schema feature introduced in version 1.1, which allows to assert XPath 2.0 expressions against the content model. Here we assert that the element "root" has to have a text node's length greater than 0.









Here we attempt to validate a document against the schema which is properly reported as not valid.







But what if we want to validate and to transform in a single step, taking advantage of Saxon Schema Aware?

The following screenshot shows the Saxon processor settings  in the XSLT Editor scenario dialog, which now features an additional combo-box to pick the validation mode.








If you do not want to link all your XML documents to the schema but still run validation you can make use of the schema cache which can be associated to a Stylus Studio project folder.










Now we just need to add our XSLT transformation to the project folder and, in the next execution, we can see the processor loading the schema automatically and flag the validation error







In addition to validate the XML input document we can also validate the transformation output. Here you can see the post Validation settings in the XSLT scenario dialog, which starting with build 1910m allows to select Saxonica Validator XSD 1.1.  

Post validation also can take advantage of the project folder schema schema cache discussed above.