Description

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

Method

String getLiteralEx( );

Parameters

There are no parameters for this method.

Returns

A string containing the literal of the node, or null if the literal is empty or does not exist. On error, the custom error handler registered by the XFDL.registerAPIExceptionHandler method is called with the details of the error. If no handler is registered, the details of the error are displayed in a JavaScript alert() message.

Example

The following example uses dereferenceEx to locate a specific node. getLiteralEx is then used to get the literal value for that node.

function testGetLiteralEx(theForm) {

var valueNode;

var s, value;

s = "--- Results of getLiteralEx test ---\n";

valueNode = theForm.dereferenceEx(null, "PAGE1.FIELD4.value", 0,

FormNodeP.UFL_OPTION_REFERENCE, null);

if(valueNode == null) {

s += "Cannot find PAGE1.FIELD4.value";

} else {

value = valueNode.getLiteralEx();

s += " The value is: " + value + "\n";

}

alert(s);

}

A typical message displayed in the alert box by the sample code might be: