Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • NamespaceMangler

Index

Constructors

constructor

Methods

mangle

  • mangle(node: NodeImpl, target: NodeImpl, anchor: NodeImpl): NodeImpl
  • Maps namespace of the given node to target document. If the given node is an element, all its attributes will be mapped too. Also, all descendants of the given node will be mapped.

    An anchor is needed because this method descends into all descendants. Namespace lookup happens on the anchor and the target nodes.

    Parameters

    • node: NodeImpl

      a imported node that will be put to target, please note that this node may not be in the patch document.

    • target: NodeImpl

      a node in the target document.

    • anchor: NodeImpl

      a node in the patch document, mostly likely the node being processed currently.

    Returns NodeImpl

mangleAttributes

  • mangleAttributes(node: NodeImpl | AttrImpl, target: NodeImpl, anchor: NodeImpl): void
  • Maps namespace of the given attribute to target document. Namespace lookup happens on the anchor and the target nodes.

    Parameters

    • node: NodeImpl | AttrImpl

      a node from patch document

    • target: NodeImpl

      a node in the target document

    • anchor: NodeImpl

      a node in the patch document, mostly likely the node being processed currently.

    Returns void

mangleNode

  • mangleNode(node: NodeImpl | AttrImpl, target: NodeImpl, anchor: NodeImpl): void
  • Maps namespace of the given node to target document. If the given node is an element, all its attributes will be mapped too. Namespace lookup happens on the anchor and the target nodes.

    Parameters

    • node: NodeImpl | AttrImpl

      a node from patch document

    • target: NodeImpl

      a node in the target document

    • anchor: NodeImpl

      a node in the patch document, mostly likely the node being processed currently.

    Returns void

mapNamespace

  • mapNamespace(name: string, target: NodeImpl, node: NodeImpl, isAttr?: undefined | false | true): string[]
  • Map the given namespace to target document's namespaces.

    Parameters

    • name: string

      a qualified name from patch document

    • target: NodeImpl

      a node in the target document

    • node: NodeImpl

      a node from patch document

    • Optional isAttr: undefined | false | true

      whether it's an attribute node

    Returns string[]

setPrefix

  • setPrefix(node: ElementImpl | AttrImpl, prefix: string, ns?: undefined | string): void
  • Sets the node prefix, and namespace URI if provided. Please note that the namespace lookup list (_nsMap) is not changed.

    Parameters

    • node: ElementImpl | AttrImpl
    • prefix: string
    • Optional ns: undefined | string

    Returns void

setTarget

Generated using TypeDoc