Subject:How to validate a source xml via XML Transformation Service? Author:Farshad Khoshpasand Date:03 Jan 2007 06:12 AM
Hi,
I am a Sonicsoftware user and what i am trying to achieve in Sonic Management Console is to create a XML Transformation Service, which must validate the incomming xml document before it attempts to transform it. I have also created a xslt script which must be used by this service.
I configured the Service instance by setting its validation flag to true as well as telling where to find the xsd file.
I used the <xsl:import> in my xslt script in order to make the xslt awre of a schema that must be used in order to validate the incomming xml document but it didn't work as i thought.
Now: I don't know what is wrong with this picture to be honest. Here is my example
Subject:How to validate a source xml via XML Transformation Service? Author:Farshad Khoshpasand Date:09 Jan 2007 08:41 AM
Hi Farshad,
> NOTE: The incoming XML document doesn't include any reference to any
> schema ".xsd" file.
You wouldn't be able to use the Transformation Service Validate option in this case. "Sonic ESB V6.1 Developer's Guide" page 167 says:
"Select True if you want to validate the incoming XML against a Document Type Definition (DTD) or schema before transforming it. If you select True, then incoming XML messages must specify and provide a DTD or schema against which to validate the XML. The transformation fails when you set this value to True and the incoming message does not specify a DTD or schema for the validation".
Would you be able to edit the incoming message to add the necessary schema bits before sending it to the Transformation Validating step?
Subject:How to validate a source xml via XML Transformation Service? Author:Farshad Khoshpasand Date:09 Jan 2007 08:42 AM
Thank you Aouali,
Yes I have already done it (by transforming the source xml to an exactly same xml plus reference to a schema location)and it works perfect.
But what I meant earlier was, if there is any way in which you tell the service to locate the schema to be used for validation process.
And now as I understand from your explanation, there is no way for the XML Transfromation Service instance to locate the schema when the source xml itself doesn't contain any reference to any schema.
The problem is now solved and that is the main issue here.