Setting Environment Attributes for XML in ECMAScript

When you are using ECMAScript to handle XML, you can tailor how the parser renders your output. In particular, there are three global attributes you may be interested in setting. To set these, simply type or paste them in at the top of your JSX file with the values you want.

Global Environment Attributes

prettyIndent — Specifies the number of spaces each child of your XML will be indented when printed to the console.

Usage: XML.environment.@prettyIndent = 2;

prettyPrint — Specifies whether the your XML should be arranged with indents and line breaks when printed to the console.

Usage: XML.environment.@prettyPrint = true;

whitespace — Specifies whether whitespace characters should be removed from the beginning or end of any textnode. Whitespace is defined as:

Usage: XML.environment.@whitespace = false;

Related Topics

Getting Started with Script for Mapping