I want to remove all the namespace attributes from the following XML.
<md:EntityDescriptor xmlns="urn:_" xmlns:md="_"></md:EntityDescriptor>
I have tried to remove xmlns
using following command which does not change the input in anyway.
xmlstarlet ed \
-N n="urn:oasis:names:tc:SAML:2.0:metadata" \
-d '/md:EntityDescriptor/@*[n:name()="xmlns"]' \
<<< '<md:EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:md="_"></md:EntityDescriptor>' \
> ttt.xml
Expected output:
<md:EntityDescriptor></md:EntityDescriptor>