enxml(V;O)

Converts a 1010data XML value, or a list of values, into an XML string (xml → str). (Available as of version 11.07)

Syntax

enxml(V;O)

Input

Argument Type Description
V list-value A value or list of values to be converted into an XML string
O text One of the special options: '[no]strict'.
Note: In most cases of enxml(), the default option will handle the conversion properly, and therefore the option argument can be left blank.
  • 'strict' tells enxml() to be very strict about the > character in contents.
  • 'nostrict' tells enxml() not be be strict about the > character in contents. This is the default value.

Return Value

Returns an XML string of the value.

Example

The following code shows how to convert an XML value to a string. <example_xml> contains XML code, and enxml converts that code to a string. The scope widget then displays the original XML value and the value converted to an XML string.

<dynamic>
  <do>
    <set>
      <example_xml>
        <base table="default.lonely"/>
        <willbe name="one" value="1"/>
        <willbe name="two" value="2"/>
      </example_xml>
    </set>
    
    <set example_enxml="{enxml(@example_xml;)}"/>
    
  </do>
  <widget class_="scope" refreshon_="1" 
     show_="@example_xml,@example_enxml"/>
</dynamic>
The scope widget displays the XML value and the string conversion:

Note how the quotes within the example_xml code are escaped with the \ character within the example_enxml string.