Helper functions for working with XML.
|
|
getText(node,
xml_space='preserve')
Extracts the plain text content out of the given node. |
source code
|
|
|
|
getXMLlang(node)
Gets the xml:lang attribute on node |
source code
|
|
|
|
setXMLlang(node,
lang)
Sets the xml:lang attribute on node |
source code
|
|
|
|
getXMLspace(node,
default=None)
Gets the xml:space attribute on node |
source code
|
|
|
|
setXMLspace(node,
value)
Sets the xml:space attribute on node |
source code
|
|
|
|
|
|
|
normalize_space(text)
Normalize the given text for implimentation of
xml:space="default". |
source code
|
|
|
|
normalize_xml_space(node,
xml_space,
remove_start=False)
normalize spaces following the nodes xml:space, or alternatively the
given xml_space parameter. |
source code
|
|
|
|
xml_preserve_ancestors = ancestor-or-self::*[attribute::xml:sp...
All ancestors with xml:space='preserve'
|
|
|
xml_space_ancestors = ancestor-or-self::*/attribute::xml:space
All xml:space attributes in the ancestors
|
|
|
string_xpath = string()
Return a non-normalized string in the node subtree
|
|
|
string_xpath_normalized = normalize-space()
Return a (space) normalized string in the node subtree
|
|
|
XML_NS = 'http://www.w3.org/XML/1998/namespace'
|
|
|
MULTIWHITESPACE_PATTERN = '[\\n\\r\\t ]+'
|
|
|
MULTIWHITESPACE_RE = re.compile(r'(?m)[\n\r\t ]+')
|
|
|
__package__ = 'translate.misc'
|