Community articleUFLCheckDataValidity function
Added by IBM contributorIBM on August 16, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars


This function tests the validity of the data in an XForms model. By default, the following aspects of XForms validity are analyzed:
  • XML schema validity
  • validity of the type Model Item Property (MIP)
  • xsi:type validity
  • XForms constraints
  • the required but empty condition
UFLCheckDataValidity can only be used when XForms processing is turned on. You cannot use this function on a form that has been opened using the UFLReadForm function with either the UFL_SERVER_SPEED_FLAGS flag or the UFL_XFORMS_OFF flag; use the 0 flag or the UFL_SERVER_SPEED_FLAGS_WITH_XFORMS flag to keep XForms processing turned on.


   r_error UFLCheckDataValidity(
      formNodeP theObject
      r_u_long validityFlags,
      rchar_P modelID,
      rchar_P dataRef,
      rchar_P **listOfFailures
      r_long *validationFailuresSize
      r_boolean *returnPtr


Table 1. Function parameters
theObjectformNodePThe formNodeP to check.
validityFlagsr_u_longSpecifies the behavior of the function. Must be one of the following values:
0 — Analyzes all relevant nodes as specified by modelID and dataRef parameters.
UFL_IGNORE_RELEVANCE — Analyzes all nodes, including nodes that are not relevant.
UFL_STOP_ON_FIRST_INVALID — Returns when the first failure is found.
UFL_IGNORE_MODEL_UPDATES — Ignores the flags that mark a model for a deferred update, and analyzes the data without updating the XForms model.
modelIDr_charPThe ID of the model that will be analyzed. If NULL or empty, the default model is analyzed.
dataRefr_charPAn XPath expression that specifies the nodeset that will be analyzed. If NULL or empty, all instances in the model are analyzed. The XPath evaluation context and namespace resolution come from the theObject formNodeP.
listOfFailuresr_charP*Contains a list of XPath expressions when the method returns. Each expression indicates a node that did not pass the validation test.
This parameter can also be NULL. If NULL, the function returns when the first failure is found.
validationFailuresSizer_longA pointer to a memory location that will contain the size of the listOfFailures list when the function returns.
returnPtrr_booleanA pointer to a memory location that will contain the result of the validity tests when the function returns.


OK on success or an error code on failure.


This function does not test for out-of-range conditions on xforms:select, xforms:select1, and xforms:range.
In an XForms model that has been flagged for update, the default behaviour of UFLCheckDataValidity is to xformsrebuild API 4 CCreate New Article, xformsrecalculate API 4 CCreate New Article, and xformsrevalidate API 4 CCreate New Article the model before analyzing the data.
Parent topic:
FormNodeP functions