From: Stefan Knorr Date: Wed, 11 Nov 2015 14:25:06 +0000 (+0100) Subject: Fix bug#1371: namespace insertion fails in some cases X-Git-Tag: snapshot/2018-09-28-172~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71fc75e0f150e41c4f2d34f7390771c1df78cbc5;p=docbook-dsssl Fix bug#1371: namespace insertion fails in some cases When you have the script would fail to do its job because immediately after the final quote, ", the tag was closed with >. Of course, that is completely valid XML, so it should not trip up the script. --- diff --git a/releasetools/xslns-build b/releasetools/xslns-build index 45ebfa6c2..3cd7d1cf3 100755 --- a/releasetools/xslns-build +++ b/releasetools/xslns-build @@ -247,7 +247,7 @@ sub nsfilter { # Add the docbook5 namespace declaration to root element - s|(xmlns:xsl\s*=\s*"http://www.w3.org/1999/XSL/Transform"(?!>))(\s*\n?)(\s*)|$1$2$3xmlns:d="http://docbook.org/ns/docbook"\n$3|s; + s|([ \t]*)(xmlns:xsl\s*=\s*"http://www.w3.org/1999/XSL/Transform")|$1$2\n$1xmlns:d="http://docbook.org/ns/docbook"|s; # Add namespace d to exclude-result-prefixes