Example of parsing an XML data

The input E4X string in parse mode contains a single JavaScript expression that is evaluated at runtime and parsed into an E4X XML object. This is typically used to parse a single string or variable into XML.

The variable column is used in parse mode to supply variables that will be assigned the node's value when the XML is parsed. Variables have these properties:
  • The variable name can be specified with or without the E4X curly braces. Both of these are acceptable:
    • a
    • {a}

    It is not necessary to define the variable name beforehand. The variable will be updated if it is defined. If the variable has not been defined previously, it will be defined as a local variable, with the value set by the node.

  • The variable will be converted into an XML list, which is similar to an array, if the variable is specified as string but the schema node property indicates maxoccurs = unbounded and there are multiple occurrences of the node in the parsed XML. Here is an example of a parsed XML:
    <foo>
        <bar>baz 1</bar>
        <bar>baz 2</bar>
    </foo>
    

    In the example, the variable baz is defined as string in the Start node. The variable baz will be converted to an XML list when the XML is parsed.