Community articleUFLGetLiteralEx function
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Description

This function retrieves the literal of a node. The literal is returned in the specified character set.
Note: It is not necessary to call this function when you are using XForms. Use the UFLExtractXFormsInstance function instead.

Function

   r_short UFLGetLiteralEx(
      formNodeP aNode,
      r_charP theCharSet,
      r_charP *theLiteral
   );


Parameters

Table 1. Function parameters
ExpressionTypeDescription
aNode formNodePThe formNodeP to retrieve the literal from.
theCharSetr_charPThe character set you want to use to view the literal string. Use null for ANSI/Unicode.
theLiteral r_charP*A pointer that stores the literal string. If the literal is empty or does not exist, the string is set to NULL. This string must be freed by the caller.


Returns

OK on success or an error code on failure.

Example

The following example uses UFLDereferenceEx to locate a specific node. UFLGetLiteralEx is then used to get the literal value for that node.
   if ((tempNode = UFLDereferenceEx(form, NULL, "PAGE1.MALERADIO.value", 0,
      UFL_OPTION_REFERENCE, NULL)) == NULL)
   {
      fprintf(stderr, "Could not locate MALERADIO node.\n");
      return(NOTOK);
   }
 
   error = UFLGetLiteralEx(tempNode, NULL, &temp);
   if (error != OK)
   {
      fprintf(stderr, "Could not get literal of MALERADIO value node. Error
         code: %hd.\n", error);
      return(NOTOK);
   }


Parent topic:
FormNodeP functions