This statement has the following parameter:
Parameter | Description |
---|---|
Flags | A numeric literal or identifier of a numeric data item with a value that represents one or more states of whitespace preservation.
Valid flags and their numerical values are:
78 WHITESPACE-DEFAULT-FLAGS Value 0. *> keep all whitespace 78 WHITESPACE-STRIP-CONTROL Value 1. *> strip all (TAB, LF, CR) characters 78 WHITESPACE-PRESERVE-TAB Value 16. *> keep TAB characters when stripping 78 WHITESPACE-PRESERVE-LF Value 32. *> keep LF characters when stripping 78 WHITESPACE-PRESERVE-CR Value 64. *> keep CR characters when stripping 78 WHITESPACE-NORMALIZE Value 65536. *>collapse whitespace (space, LF, TAB, CR) The values for flags 1 to 64 can be added together to achieve combined behaviors. |
The XML SET WHITESPACE-FLAGS statement controls the preservation of whitespace during an XML IMPORT statement. The default behavior is to preserve all whitespace; that is, all space characters, line feeds (LF), carriage returns (CR), and tab characters (TAB). Use this statement to determine which elements are stripped out. You can combine the flag values (see Description above) to strip out more than one element; for example, set Flags to 65 preserve the CR elements, but strips out all LF and TAB elements.
You can also normalize whitespace (stripping out consecutive whitespace elements, replacing them with a single space character), but this action cannot be combined with any other action.
The XML TERMINATE statement will revert the whitespace setting back to its default behavior (all whitespace preserved). It does not revert back to its default behavior following an XML INITIALIZE statement.
The valid flags are defined in the COPY file lixmldef.cpy, and so this file must be in effect when using the statement.
The following example uses the values 1 and 16 to have the effect of only striping out the LF and CR elements, but preserving the TAB elements.
XML SET WHITESPACE-FLAGS 17