The PerlSAX handler (or filter) that will receive the PerlSAX events from this filter.
Tab (Default: one space)
The number of spaces per indent level for elements etc. in document content.
|o||Newline (Default: \x0A)|
This method determines whether children of a certain element may be reformatted. The default implementation checks the PreserveWS parameter of the specified start_element event and returns 0 if it is set or MAYBE otherwise. The value MAYBE \fIs0(2) indicates that further investigation is needed, e.g. by examining the element contents. A value of 1 means yes, indent the child nodes, no further investigation is needed.
NOTE: the PreserveWS parameter is set by the parent class, XML::Filter::DetectWS, when the element or one of its ancestors has the attribute xml:space=preserve.
Override this method to tweak the behavior of this class.
This method determines whether a certain element may be re-indented. The default implementation returns the value of the $parent_says_indent parameter, which was set to the value returned by indent_children for the parent element. In other words, the element will be re-indented if the parent element allows it.
Override this method to tweak the behavior of this class. Im not sure how useful this hook is. Please provide feedback!
The current implementation puts all incoming Perl SAX events in a queue for further processing. When determining which nodes should be re-indented, it sometimes needs information from previous events, hence the use of the queue.
The parameter (Compress => 1) is added to matching start_element and end_element events with no events in between This indicates to an XML printer that a compressed notation can be used, e.g <foo/>.
If an element allows reformatting of its contents (xml:space=preserve was not active and indent_children returned MAYBE), the element contents will be reformatted unless it only has one child node and that child is a regular text node (characters event.) In that case, the element will be printed as <foo>text contents</foo>.
If you want element nodes with just one text child to be reindented as well, simply override indent_children to return 1 instead of MAYBE (2.)
This behavior may be changed or extended in the future.
This code is highly experimental! It has not been tested well and the API may change.
The code that detects blocks of whitespace at potential indent positions may need some work.
Send bug reports, hints, tips, suggestions to Enno Derksen at <email@example.com>.
|perl v5.20.3||XML::FILTER::REINDENT (3)||2000-02-16|