strip-space
Syntax
strip-space element-list;
Description
Remove whitespace-only child text nodes from the source tree element nodes listed, but not from the child text nodes of the element node children. To perform whitespace stripping on the child text nodes of the element node children, specify the child nodes as separate entries in the strip-space element list. Specifying an asterisk removes whitespace-only child elements from all elements. A text node is considered whitespace-only if it includes only spaces, tabs, newlines, and carriage returns.
This statement must be defined as a top-level statement in the script. The default is to preserve all whitespace-only elements.
Attributes
element-list |
List of element names separated by spaces. |
SLAX Example
The following example removes all whitespace-only text
nodes from the source tree except for child elements of <user-context>
:
version 1.1; preserve-space user-context; strip-space *; match / { ... }
Release Information
Statement introduced in version 1.0 of the SLAX language.