]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug#1371: namespace insertion fails in some cases
authorStefan Knorr <sknorr@suse.de>
Wed, 11 Nov 2015 14:25:06 +0000 (15:25 +0100)
committerbobstayton <bobs@sagehill.net>
Thu, 7 Jun 2018 17:10:23 +0000 (10:10 -0700)
When you have <xsl:stylesheet xmlns:xsl="..."> 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.

releasetools/xslns-build

index 45ebfa6c2868c6da51b0b0e1285950cb8abedef3..3cd7d1cf313827e910a8b4690bf27d594f90c3b0 100755 (executable)
@@ -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