Example: lr_xml_delete

The following example searches the input string xml_input for the tag "<extension>" and deletes it. The resulting string is contained in the ResultParam parameter, Result.

For more examples of the use of lr_xml_delete, see Deleting elements in Example Scripts for XML Queries.

#include "as_web.h"

char * xml_input =
               " <name>John Smith</name>"

Action() {
    lr_save_string(xml_input, "XML_Input_Param"); // Save input as parameter
        LAST );
    lr_output_message(lr_eval_string("String after deletion: {Result}"));
    return 0;

Example: Output:
Action.c(25): String after deletion: <acme_org><accounts_dept><employee> <name>John Smith</name><cubicle>227</cubicle></employee> </accounts_dept></acme_org>