dexml(S;O)

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

Syntax

dexml(S;O)

Input

Argument Type Description
S text An XML string
O text A list of one or more special options: '[no]case', '[no]stripa', '[no]stripc', '[no]tabs', '[no]normnl', '[no]nlattrs', 'nlcontents', '[no]cdata', '[no]comments', '[no]decl', '[no]doctype''[no]uqa', '[no]dups', '[no]lenient', '[no]strict', '[no]escquote'.
Note: In most cases of dexml(), the default options will handle the conversion properly, and therefore the option argument(s) can be left blank.
  • 'case' converts all tags and attributes to lower case. This is the default option.
  • 'nocase' does not convert tags and attributes to lower case.
  • 'stripa' strips leading/trailing whitespace in attribute values. This is the default option.
  • 'nostripa' does not strip leading/trailing whitespace in attribute values.
  • 'stripc' strips leading/trailing whitespace in content text. This is the default option.
  • 'nostripc' does not strip leading/trailing whitespace in content text.
  • 'tabs' allows tabs even outside of CDATA (in other words, don't change tabs to spaces).
  • 'notabs' changes tabs to spaces. This is the default option.
  • 'normnl' normalizes newlines everywhere as required by spec. This is the default option.
  • 'nonormnl' does not normalize newlines everywhere.
  • 'nlattrs' allows newlines inside attributes (doesn't change to spaces). This is the default option.
  • 'nonlattrs' changes newlines inside attributes to spaces.
  • 'nlcontents' allows newlines in contents outside of CDATA (doesn't change to spaces). This is the default option.
  • 'cdata' allows CDATA sections. This is the default option.
  • 'nocdata' does not allow CDATA sections.
  • 'comments' allows XML standard comments. This is the default value.
  • 'nocomments' does not allow XML standard comments.
  • 'decl' allows XML standard <?xml..?> declaration at the beginning of the document. This is the default option.
  • 'nodecl' does not allow the XML standard declaration.
  • 'dropdecl' allows XML standard declaration, but drops it from the result.
  • 'doctype' allows XML standard <!DOCTYPE...> declaration at the beginning of the document. This is the default option.
  • 'nodoctype' does not allow <!DOCTYPE...> declaration.
  • 'dropdoctype' allows <!DOCTYPE...> declaration, but drops it from the result.
  • 'uqa' allows unquoted attributes (such as <foo bar=123>). This is the default option.
  • 'nouqa' does not allow unquoted attributes.
  • 'dups' allows duplicate attributes (such as <foo bar=123 bar=456>).
  • 'nodups' does not allow duplicate attributes. This is the default option.
  • 'lenient' tells dexml() to be lenient about the & character. This is the default option.
  • 'nolenient' tells dexml() not to be lenient about the & character.
  • 'strict' prohibits > character in contents.
  • 'nostrict' is not strict about the > character. This is the default option.
  • 'escquote' passes " through in double-quoted attribute values, allowing the quote character to be used without resorting to &quot;. This is the default option.
  • 'noescquote' does not allow " to pass through.

Return Value

Returns a 1010data value or list of values represented by the XML string. If the function cannot convert the XML string, dexml throws an error message.

Example

The following example shows how dexml converts a string into XML. The scope widget then displays the XML string and the string converted to XML.

<dynamic>
  <do>
    <set example_string="<table>1,2,3;</table>"/>
    <set example_dexml="{dexml(@example_string;)}"/>
  </do>
  <widget class_="scope" refreshon_="1" show_="@example_string,@example_dexml"/>
</dynamic>
The scope widget displays the string and the conversion to an XML value: