For example, I have XML as following:
<RootNode xmlns:test1="test1Namespace"
xmlns:test2="childNamespace">
<test1:SomeElement>
<OtherElement xmlns="test1Namespace">
<test2:ChildElement>test</test2:ChildElement>
</OtherElement>
</test1:SomeElement>
</RootNode>
I want to add namespace prefix to all elements that have inline XML namespace definition ( in this case "OtherElement") and remove its inline namespace definition, but leave other possible attributes it might contain.
Other XML nodes should not change. All of this should be done using XSLT 1.0. Result should be as follows:
<RootNode xmlns:test1="test1Namespace"
xmlns:test2="childNamespace">
<test1:SomeElement>
<test1:OtherElement>
<test2:ChildElement>test</test2:ChildElement>
</test1:OtherElement>
</test1:SomeElement>
</RootNode>