Logo Search packages:      
Sourcecode: harpia version File versions  Download package

harpia::amara::binderytools::ws_strip_element_rule Class Reference

Inheritance diagram for harpia::amara::binderytools::ws_strip_element_rule:

List of all members.


Detailed Description

An Amara bindery rule.  Bindery rules allow developers to customize how
XML documents are translated to Python objects.

This rule is pattern based.  Elements that match the pattern and
descendants will have text children stripped if they are pure whitespace.
In other words
<a> <b/> <c/> </a>
will end up with the same binding as
<a> <b/> <c/> </a>
but not
<a> <b/> x <c/> </a> <!-- ' x ' is not pure whirespace -->
Stripping whitespace saves memory and can simplify resulting bindings,
but be sure the whitespace doesn't have a significant meeaning in the
document.

The default pattern is '*', meaning all elements.

Definition at line 463 of file binderytools.py.


Public Member Functions

def __init__
def add_rule_hook
def apply
def dom_match
def match

Public Attributes

 stack_depth
 xpatterns

Static Public Attributes

 event_type = saxtools.START_ELEMENT
 target_phase = bindery.PRE_INSTANCE

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index