Hi Greg, thanks for the reply. I am looking at using Schematron to enforce the business rules and embed it into the XSD using the "annotation" marker. I think that it may be wise to firm up the "contract" between the web service and client so that static XSD/Schematron patterns can be applied. A dynamic approach is very complex to implement.
Infopath is good at making definition of validation/rules easy but then there is a tie-in to Infopath. If the validation is in the webservice passing the XSD to some consumer - not necessarily Infopath then the options are wider for B2B etc..
quote:
Originally posted by Greg Collins
InfoPath autogenerates the schemas for your data connections. You can modify these, but if you ever update your data connections the schemas are regenerated.
Having said that--it sounds like you want something different than that--that you want to have dynamic validation.
The answer to can this be done is: Yes.
How? You'll have to write code to do it. You would establish a general OnAfterChange event handler on your root node for the data connection. This would be a catch-all because the event will bubble up to the root node.
In the root node OnAfterChange event handler you would discover which field had changed, then look into your dynamic validation XML and use that to information in your code to validate the field. You would add/remove your own errors based on your code and the validation rules passed in.
That's about the size of it. I don't believe that there is any other way to do this dynamically like it sounds like you want.