HELP: Indentation of XML tags for human readability TYPE: OBJECT SYNTAX: PRETTYPRINT(MAXWSP=num,WSPERR=WRITE/ABORT,INDSIZ=num,INDCHR=SPACE/TABULATOR,NOCMNT,BUFSIZ=num,INICNT=num,WLLFMD)
The pretty printing method creates an XML document that is very suitable to be read by humans. All XML elements start on its own line and are properly indented occording to its hierarchical position, unless they are surrounded by text data. Elements containing actual text (i.e. they do not only contain whitespace and newlines) have all their whitespace and newline characters preserved.
Example: If the original XML document is the following one:<?xml version="1.0"?> <!DOCTYPE root [ <!ELEMENT root (someelement)> ]> <root> <somelement attribute1="value1" attribute2="value2"> some text </somelement> <somelement> <!-- comment --> text in non-root element <leaf>this is a leaf</leaf></somelement></root>
then pretty printing will result in the following document:
<?xml version="1.0"?> <!DOCTYPE root [ <!ELEMENT root (someelement)> ]> <root> <somelement attribute1="value1" attribute2="value2"> some text </somelement> <somelement> <!-- comment --> text in non-root element <leaf>this is a leaf</leaf> </somelement> </root>
NUMBER: MAXWSP=num - Size of internal whitespace cache (only used when method is minimize or pretty printing) [4096]
NUMBER: WSPERR=WRITE/ABORT - Action when the whitespace cache overflows [WRITEOUT]
WRITE - Write out cached whitespace on full buffer, causing less nicely formatted output
ABORT - Abort XML writing when the whitespace buffer is full, output formatting has priority
NUMBER: INDSIZ=num - Number of indentation characters per indentation level [2 (SPACE) or 1 (TAB)]
NUMBER: INDCHR=SPACE/TABULATOR - Indentation character used to indent XML tags [SPACE]
SPACE - Use the space character as indentation character
TABULATOR - Use the tabulator character as indentation character
SWITCH: NOCMNT - Do not write out XML comments [FALSE]
NUMBER: BUFSIZ=num - Initial buffer size for preallocation [65536]
NUMBER: INICNT=num - Initial amount of elements for preallocation [128]
SWITCH: WLLFMD - Verify that the written XML document is well-formed [FALSE]