Reputation: 9120
I am writing an XSLT stylesheet to transform XML files, and I'd like to make sure that I've covered all possibilities.
Is there a way to check that the XSLT stylesheet is valid and complete wrt a given XSD schema? Of course, the input XML is required to validate against that schema. (There is "schema-aware XML processing" but that's not quite what I'm looking for.)
Upvotes: 0
Views: 635
Reputation: 111491
Wanting an XSLT stylesheet to be "valid and complete wrt a given XSD schema" sounds good but has a number of problems:
Also, the errors that commonly occur in stylesheets go beyond mere matters of omission. Pattern matching and XPath construction mistakes are more common that neglecting to cover transformation of an element allowed by an XSD.
OTOH, a tool, or an XSLT/XPath processor feature, that would report when a given XPath could not possibly match anything in any XML document valid against a given XSD would save countless people countless hours of head scratching.
Upvotes: 1