I have a XML file having default namespace and empty namespaces which need to be removed, while keeping the rest of namespaces.
Input:
<prefix:request xmlns:prefix="urn1" xmlns:foo2="urn2" xmlns="urn1">
<element1 xmlns="">version1</element1>
<element2 xsi:type="prefix:requestA" xmlns=""/>
...
</element1>
</prefix:request>
Expected output:
<prefix:request xmlns:prefix="urn1" xmlns:foo2="urn2">
<element1>version1</element1>
<element2 xsi:type="prefix:requestA"/>
...
</element1>
</prefix:request>
XSLT sample for removing namespaces will filter out all namespaces, including the prefix. Any idea how to solve this particular case?