message.formatXML¶
Signature: message.formatXML(indent)
Returns: void
Format the XML with consistent indentations of indent.
Note
This method only applies to XML formatted messages.
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| Integer | indent | the number of spaces to indent for each additional level |
Example¶
// Example: Format an XML message with consistent indentation.
// Sample XML message structure
message = qie.createXMLMessage(
"<person><name>John Doe</name><age>30</age><address><street>123 Main St</street><city>Metropolis</city><state>NY</state></address></person>"
);
// Format XML using 4-space indentation
var formattedXML = message.formatXML(4); // pretty-printed XML string