XML Namespace Helper Tools

Functions

xmlns.CN(tag)

Convert Prefix-Notation to Clark-Notation. All OpenDocument V1.1 Namespaces are respected:

CN('text:p') == '{urn:oasis:names:tc:opendocument:xmlns:text:1.0}p'
xmlns.register_class(cls)

Register cls for wrapping mechanism. Can be used as class decorator. cls has to have a cls.TAG attribute in Clark-Notation which determines the XML element to wrap, and cls has to accept the keyword attribute xmlnode on the __init__() constructor, which is the lxml.Element object to wrap. (see GenericWrapper)

xmlns.wrap(element)

Wrap element into a wrapper object, where element is an lxml.Element object. Returns a GenericWrapper object, if no class is registered for element.

Table Of Contents

Previous topic

Document Management

Next topic

GenericWrapper Class

This Page