Type: Function

How to get translateNamespacePrefixes?


import translateNamespacePrefixes from 'fontoxml-dom-utils/src/translateNamespacePrefixes.js'

Change namespace prefixes of a node and all its descendants.

This can be used if a source of XML might not use the same namespace prefixes as the documents edited by Fonto.

While it is certainly possible to use a number of prefixes for a certain namespace uri, it might be better to stick to using same prefix everywhere.

The getPrefixForUri should return the prefix for an uri, for example html for if html elements should be serialized as html:div. If the prefix should be absent, return null to make all html elements 'div'.


  1. node


    Type: Node

  2. getPrefixForUri


    Type: Function | NULL

    Get called with a namespace uri and the 'current' prefix


Type: Node