Community articleUFLGetInfoEx 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

No abstract provided.



Description

This function retrieves the information about a formNodeP. If you do not want information about a particular property, set it to NULL.

Function

   r_short UFLGetInfoEx(
      formNodeP aNode,
      r_charP *theTypePtr,
      r_charP *theLiteralPtr,
      r_charP *theFormulaPtr,
      r_charP *theIdentifierPtr,
      r_charP theCharSet
   );


Parameters

Table 1. Function parameters
ExpressionTypeDescription
aNodeformNodePThe formNodeP to retrieve information about.
theTypePtrr_charP*A pointer that will store the type of the formNodeP.
If the type is empty or does not exist, the string is set to NULL. This string must be freed by the caller.
theLiteralPtrr_charP*A pointer that will store the literal of the formNodeP.
If the literal is empty or does not exist, the string is set to NULL. This string must be freed by the caller.
theFormulaPtrr_charP*A pointer that will store the formula of the formNodeP.
If the formula is empty or does not exist, the string is set to NULL. This string must be freed by the caller.
theIdentifierPtrr_charP*A pointer that will store the identifier of the formNodeP.
If the identifier is empty or does not exist, the string is set to NULL. This string must be freed by the caller.
theCharSetr_charPThe character set you want to use to view the results. Use NULL or ANSI for ANSI. Use Symbol for Symbol.


Returns

OK on success or an error code on failure.

Notes

If you are getting information about a node that is not in the XFDL namespace, UFLGetInfoEx may return values that include namespace prefixes as follows:
  • Any item node in a non-XFDL namespace will return a Type that includes a namespace prefix. For example, myNamespace:Field1.
  • Any option node in a non-XFDL namespace will return an Identifier that includes a namespace prefix. For example, myNamespace:value.

Example

In the following example, UFLDereferenceEx is used to locate a specific node. UFLGetInfoEx is then used to get the four values from that node. The four values are then printed out.
r_error checkTotalNode(formNodeP form)
{
formNodeP tempNode=NULL;
r_charP theType=NULL;
r_charP theLiteral=NULL;
r_charP theFormula=NULL;
r_charP theIdentifier=NULL;
r_error error = OK;
      if ((tempNode = UFLDereferenceEx(form, NULL, "PAGE1.TOTALFIELD",0,
         UFL_ITEM_REFERENCE, NULL)) == NULL
      {
         fprintf(stderr, "Could not locate TOTALFIELD node.\n");
         return(NOTOK);
      }
      error = UFLGetInfoEx(tempNode, &theType, &theLiteral, &theFormula,
         &theIdentifier, NULL);
      if (error != OK)
      {
         fprintf(stderr, "UFLGetInfoEx error %hd.\n", error);
         return(NOTOK);
      }
      /* Print the information */
      fprintf(stderr, "The type of this node is: %s.\n", theType);
      fprintf(stderr, "The literal of this node is: %s.\n", theLiteral);
      fprintf(stderr, "The formula of this node is: %s.\n", theFormula);
      fprintf(stderr, "The identifier of this node is: %s.\n",                            
         theIdentifier);
      /* Free memory. */
      cp_free(theType);
      cp_free(theLiteral);
      cp_free(theFormula);
      cp_free(theIdentifier);
      theType = NULL;
      theLiteral = NULL;
      theFormula = NULL;
      theIdentifier = NULL;      
      return(OK);
}


Parent topic:
FormNodeP functions