Namespace Manager
Type: Class
How to get namespaceManager?
JavaScript
import namespaceManager from 'fontoxml-dom-namespaces/src/namespaceManager.js'
The namespace manager controls which namespace uri should be used for which prefix. The mapping is used by various components to create elements and attributes or to read from the DOM
Currently, Fonto uses a global one-to-one mapping between uris and prefixes. One prefix may only point to one uri, and one uri may only be referred to one prefix.
Methods
add Namespace
Type: Function
Register a namespace / prefix combination
Arguments
create Element
Type: Function
Convenience function to create an element in the correct namespace by specifying only its qualified name (including the prefix, where appropriate)
Arguments
Returns
create Element NS
Type: Function
Convenience function to create an element in the specified namespace by specifying only its local name (without the prefix, that will be added automatically)
Arguments
Returns
get Namespace Uri
Type: Function
Get the registered namespace associated with the given prefix, given the contextNode for extra information on namespaces used elsewhere in the document
Arguments
Returns
get Or Create Prefix
Type: Function
Get the registered prefix associated with the given uri, given the contextNode for extra information on namespaces used elsewhere in the document. If prefix doens't exists yet for a given namespaceURI, then generate a new one: ns0, ns1, ns2, or ...
Arguments
Returns
get Prefix
Type: Function
Get the registered prefix associated with the given uri, given the contextNode for extra information on namespaces used elsewhere in the document
Arguments
Returns
get Qualified Name For Attribute
Type: Function
Get the qualified name associated with the given uri, for the local name if, given the contextNode for extra information on namespaces used elsewhere in the document.
This method can resolve a qualified name for attributes; The null namespace uri will always be bound to no prefix.
Arguments
Returns
get Qualified Name For Element
Type: Function
Get the registered prefix associated with the given uri, given the contextNode for extra information on namespaces used elsewhere in the document
Arguments
Returns
resolve Qualified Name For Attribute
Type: Function
Get the registered prefix associated with the given uri, given the contextNode for extra information on namespaces used elsewhere in the document.
This method can resolve a qualified name for attributes; The null namespace uri will always be bound to no prefix.
Arguments
Returns
resolve Qualified Name For Element
Type: Function
Get the QName, including parts making up such a QName associated with the given qualified name, given the contextNode for extra information on namespaces used elsewhere in the document.
Arguments
Returns