my XSLT should verify if this XML conforms to the above mentioned schema.
N.B. this schema can be flexible so could be the XML and the XSLT should stand by even in such scenario.
Subject:Verifying XML and XSD within XSLT Author:(Deleted User) Date:11 Dec 2007 10:50 AM
Hi,
there is no instruction in XSL to validate a piece of XML; but each processor can optionally validate its input, via specific options. For instance, if you display the Scenario Settings dialog for an XSLT document opened inside Stylus Studio, select Saxon as processor and click on the Settings button, you can specify to use the Schema-aware processor and tell him to perform a Strict source document validation.
Subject:Verifying XML and XSD within XSLT Author:Haseeb Hassan Date:12 Dec 2007 05:12 AM
Thanks for that but the thing is that you can not show an output using the depending on the success or failure of XML doc and schema. I need some reference regarding this.
Subject:Verifying XML and XSD within XSLT Author:(Deleted User) Date:12 Dec 2007 11:32 AM
Hi,
this is not possible in normal XSLT 1.0. Even in XSLT 2.0 and XQuery 1.0 (that support the concept of validating arbitrary nodes) a failed validation would stop the processing with a runtime error.
The only choice left would be writing inside Stylus Studio a pipeline that contains a Validate node followed by two XSLT nodes, one being executed when the document is valid and one when the document is invalid.