Community articleUFLIsXFDL function
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This function determines whether a node belongs to the XFDL namespace.
Each namespace is defined in the form by a namespace declaration, as shown:

Each namespace declaration defines both a prefix and a URI for the namespace. In this sample, the prefix for the XFDL namespace is xfdl and the URI is
Tags within the form are assigned specific namespaces by using the defined prefix. For example, to declare that an option is in the custom namespace, use the prefix custom as shown:
   <field sid="testField">


   r_error UFLIsXFDL(
      formNodeP theFormNode,
      r_boolean *theStatus


Table 1. Function parameters
theFormNodeformNodePThe node to check.
theStatusr_boolean*A pointer that will contain the node's status. OK indicates that it is in the XFDL namespace, NOTOK indicates that it is not.


OK on success or an error code on failure.


The following function uses recursion to traverse the entire node structure and destroys all nodes that are not in the XFDL namespace. This function assumes that you are passing in the root node of the form.
   r_error deleteCustomInfo(formNodeP theNode)
   r_boolean theStatus;
   formNodeP tempNode, tempNode2;
      /* Use recursion to step through each node in the form. */
      tempNode = UFLGetChildren(theNode);
      while(tempNode != null)
         tempNode2 = UFLGetNext(tempNode);
         if (deleteCustomInfo(tempNode) != OK)
            fprintf(stderr, "deleteCustomInfo returned an error.");
         tempNode = tempNode2;
      /* Determine whether the node is in the XFDL namespace. */
      if (UFLIsXFDL(theNode, &theStatus) != OK)
         fprintf(stderr, "Could not determine if node is XFDL.");
      /* If the node is not in the XFDL namespace, delete it. */
      if (*theStatus != OK)
         if (   UFLDestroy(theNode) != OK)
            fprintf(stderr, "Could not delete node.");

Parent topic:
FormNodeP functions