Derived validation rules from markup in XML doc - InfoPath Dev
in

InfoPath Dev

Derived validation rules from markup in XML doc

Last post 06-24-2006 03:11 PM by mdearlove3471. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-22-2006 04:12 AM

    Derived validation rules from markup in XML doc

    Hi All, from looking at the current configuration files that are used to impose validation on an InfoPath form. Most of the complex validation is held at code (2003 - JScript/VBScript) (2007 - .NET Code).

    Does anyone know if Infopath can :-

    Take an XML document from a webservice that holds data AND validation/relationship rules within the XML markup.

    The document is interpreted by the forms package and validation imposed without the need to reference anything pre-generated like a InfoPath form?

    This would mean that the webservice can send the validation rules with the data rather than just "here's" your data and lets hope that your forms package has the business rules setup within its presentation layer.

    I understand that you can do different kinds of validation at different levels of XML - e.g. datatype checking in the XSD, relationship code in the XSL and finally more business logic in .NET Code or scripting.

    Any suggestions of a forms package that can interpret XML that is markup in some way?

    Thanks

    Mark
  • 06-23-2006 04:12 PM In reply to

    Re: Derived validation rules from markup in XML doc

    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.
  • 06-24-2006 03:11 PM In reply to

    Re: Derived validation rules from markup in XML doc

    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.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.