Continuing on Error
In cases where no value is found by a Query, you can use the NotFound parameter to control the consequent behavior of the script. The value of NotFound can be one of:
Error: the default value, causing an error and script execution to cease
Continue: execution continues, and no error is issued. A warning message is sent to the Execution Log window.
The following example attempts to insert an XML fragment into an XML string, but the query fails because it cannot find the tag /acme_org/department/employee. The script would terminate at this point if the default NotFound behavior of Error was in effect. However, the lr_xml_insert call specifies NotFound=Continue, and script execution continues to the next statement, lr_output_message.
char *xml_input =
" <name>John Smith</name>"
"NotFound=Continue", LAST );
Action.c(15): Warning: "lr_xml_insert" found no matches
Action.c(21): Reached here