NamespaceManager

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

addNamespace

Type: Function

Register a namespace / prefix combination

Arguments

createElement

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

createElementNS

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

getNamespaceUri

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

getOrCreatePrefix

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

getPrefix

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

getQualifiedNameForAttribute

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

getQualifiedNameForElement

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

resolveQualifiedNameForAttribute

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

resolveQualifiedNameForElement

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