Package suds :: Package sax :: Module element :: Class PrefixNormalizer
[hide private]
[frames] | no frames]

Class PrefixNormalizer

source code

The prefix normalizer provides namespace prefix normalization.

Instance Methods [hide private]
 
__init__(self, node) source code
set
getNamespaces(self)
Get the unique set of namespaces referenced in the branch.
source code
set
pset(self, n)
Convert the nodes nsprefixes into a set.
source code
{u, p}
genPrefixes(self)
Generate a reverse mapping of unique prefixes for all namespaces.
source code
 
refit(self)
Refit (normalize) the prefixes in the node.
source code
 
refitNodes(self)
Refit (normalize) all of the nodes in the branch.
source code
 
refitAttrs(self, n)
Refit (normalize) all of the attributes in the node.
source code
 
refitAddr(self, a)
Refit (normalize) the attribute.
source code
 
refitValue(self, a)
Refit (normalize) the attribute's value.
source code
 
refitMappings(self)
Refit (normalize) all of the nsprefix mappings.
source code
boolean
permit(self, ns)
Get whether the ns is to be normalized.
source code
boolean
skip(self, ns)
Get whether the ns is to not be normalized.
source code
Class Methods [hide private]
Element
apply(cls, node)
Normalize the specified node.
source code
Instance Variables [hide private]
[Element,..] branch
The nodes flattened branch.
[str,] namespaces
A unique list of namespaces (URI).
Element node
A node to normalize.
{u, p} prefixes
A reverse dict of prefixes.
Method Details [hide private]

apply(cls, node)
Class Method

source code 

Normalize the specified node.

Parameters:
  • node (Element) - A node to normalize.
Returns: Element
The normalized node.

__init__(self, node)
(Constructor)

source code 
Parameters:
  • node (Element) - A node to normalize.

getNamespaces(self)

source code 

Get the unique set of namespaces referenced in the branch.

Returns: set
A set of namespaces.

pset(self, n)

source code 

Convert the nodes nsprefixes into a set.

Parameters:
Returns: set
A set of namespaces.

genPrefixes(self)

source code 

Generate a reverse mapping of unique prefixes for all namespaces.

Returns: {u, p}
A referse dict of prefixes.

refitAttrs(self, n)

source code 

Refit (normalize) all of the attributes in the node.

Parameters:

refitAddr(self, a)

source code 

Refit (normalize) the attribute.

Parameters:

refitValue(self, a)

source code 

Refit (normalize) the attribute's value.

Parameters:

permit(self, ns)

source code 

Get whether the ns is to be normalized.

Parameters:
  • ns ((p,u)) - A namespace.
Returns: boolean
True if to be included.

skip(self, ns)

source code 

Get whether the ns is to not be normalized.

Parameters:
  • ns ((p,u)) - A namespace.
Returns: boolean
True if to be skipped.