--- /dev/null
+Description: use EXSLT "replace" function when available
+ A recursive implementation of string.subst is problematic,
+ long strings with many matches will cause stack overflows.
+Author: Peter De Wachter <pdewacht@gmail.com>
+Bug-Debian: https://bugs.debian.org/750593
+
+--- docbook-xsl-1.78.1+dfsg.orig/docbook-xsl/lib/lib.xsl
++++ docbook-xsl-1.78.1+dfsg/docbook-xsl/lib/lib.xsl
+@@ -10,7 +10,10 @@
+
+ This module implements DTD-independent functions
+
+- ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
++ ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
++ xmlns:str="http://exslt.org/strings"
++ exclude-result-prefixes="str"
++ version="1.0">
+
+ <xsl:template name="dot.count">
+ <!-- Returns the number of "." characters in a string -->
+@@ -56,6 +59,9 @@
+ <xsl:param name="replacement"/>
+
+ <xsl:choose>
++ <xsl:when test="function-available('str:replace')">
++ <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>
++ </xsl:when>
+ <xsl:when test="contains($string, $target)">
+ <xsl:variable name="rest">
+ <xsl:call-template name="string.subst">
Summary(pt_BR.UTF-8): Stylesheets modulares do Norman Walsh para DocBook
Name: docbook-style-xsl
Version: 1.79.2
-Release: 1
+Release: 2
License: MIT-like
Group: Applications/Publishing/XML
Source0: https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{version}/docbook-xsl-%{version}.tar.bz2
# Source0-md5: 4a400f0264a19329c7f95f69e098744a
Source1: https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{version}/docbook-xsl-doc-%{version}.tar.bz2
# Source1-md5: 62375ca864fc198cb2b17d98209d0b8c
+Patch0: docbook-style-xsl-non-recursive-string-subst.patch
URL: https://github.com/docbook/xslt10-stylesheets
BuildRequires: libxml2-progs
BuildRequires: unzip
%prep
%setup -q -n docbook-xsl-%{version} -b1
+%patch0 -p2
%install
rm -rf $RPM_BUILD_ROOT