I have a regex that removes xmlns references from XML. It works fine when there are matching tags, but if the the xmlns reference is in a single tag it removes "/" as well.
Here is the regex:
"<(.*?) xmlns[:=].*?>", "<$1>"
When I use the regex on this line of xml:
<ns22:someTagName xmlns:ns22="http://exampledatatypes.com"></ns22:someTagName>
I get what I want:
<ns22:someTagName></ns22:someTagName>
When I use the regex on this line of xml:
<ns22:someTagName xmlns:ns22="http://exampledatatypes.com"/>
I get this invalid XML:
<ns22:someTagName>
It removes the reference fine, but it takes the closing "/" with it.
Thanks for the help, Scott