Package gavo :: Package utils :: Module stanxml :: Class NSRegistry
[frames] | no frames]

Class NSRegistry

source code

object --+
         |
        NSRegistry

A container for a registry of namespace prefixes to namespaces.

This is used to have fixed namespace prefixes (IMHO the only way to have namespaced attribute values and retain sanity). The class is never instanciated. It is used through the module-level method registerPrefix and by DOMMorpher.

Instance Methods

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
 
registerPrefix(cls, prefix, ns, schemaLocation) source code
 
getPrefixForNS(cls, ns) source code
 
getNSForPrefix(cls, prefix) source code
 
addNamespaceDeclarationsETree(cls, root, prefixes, prefixForEmpty=None, includeSchemaLocation=True)
adds xmlns declarations for prefixes to the etree node root.
source code
 
addNamespaceDeclarations(cls, root, prefixes, prefixForEmpty=None, includeSchemaLocation=True)
adds xmlns declarations for prefixes to the stanxml node root.
source code
 
getPrefixInfo(cls, prefix) source code
 
getSchemaForNS(self, ns) source code
Properties

Inherited from object: __class__

Method Details

addNamespaceDeclarationsETree(cls, root, prefixes, prefixForEmpty=None, includeSchemaLocation=True)
Class Method

source code 

adds xmlns declarations for prefixes to the etree node root.

With stanxml and the global-prefix scheme, xmlns declarations only come at the root element; thus, root should indeed be root rather than some random element.

Deprecated, don't use ElementTree with stanxml any more.

addNamespaceDeclarations(cls, root, prefixes, prefixForEmpty=None, includeSchemaLocation=True)
Class Method

source code 

adds xmlns declarations for prefixes to the stanxml node root.

With stanxml and the global-prefix scheme, xmlns declarations only come at the root element; thus, root should indeed be root rather than some random element.