Menu

#128 Too aggressive RegExp in documentation

all
open
nobody
None
3
2023-01-23
2023-01-23
No

The documentation contains too agressive RegExp in "5.1.4. Deleting namespace declarations":

sed -e 's/ xmlns.*=".*"//g'

I deletes all attributes instead of 'xmlns' only. My proposal is:

sed -e 's/ xmlns[^"]*="[^"]*"//g'

Test the result on this XML:

<doc xmlns="http://www.a.com/xyz" xmlns:ns="http://www.c.com/xyz" test="test">
  <A>test</A>
  <B>
    <ns:C>xyz</ns:C>
  </B>
</doc>

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.