functx:change-element-ns-deep

Changes the namespace of XML elements and its descendants

Description

The functx:change-element-ns-deep function changes the namespace of the XML elements in $nodes to $newns. Unlike the functx:change-element-ns function, it also changes the namespace of all their descendant elements.

Parameters

Description

nodes:node()

the nodes to change

newns:string()

the new namespace

prefix:string()

the prefix to use for the new namespace

Examples

XPath

Results

functx:change-element-ns-deep($in-xml, ‘http://foo’,’’)

<a xmlns=”http://foo”> <b>557</b> <c>xyz</c> </a>

functx:change-element-ns-deep($in-xml, ‘http://foo’,’foo’)

<foo:a xmlns:foo=”http://foo”> <foo:b>557</foo:b> <foo:c>xyz</foo:c> </foo:a>

See Also