]> granicus.if.org Git - apache/commitdiff
synopsis.xsl: fix broken translation builds
authorLuca Toscano <elukey@apache.org>
Mon, 28 Aug 2017 12:34:58 +0000 (12:34 +0000)
committerLuca Toscano <elukey@apache.org>
Mon, 28 Aug 2017 12:34:58 +0000 (12:34 +0000)
This commit is a follow up of r1805189, in which
a new logic was added to allow to repeat a directive
name only if its type is different (like SSLPolicy
and <SSLPolicy>). The change broken french translations
since the $this variable, containing the translated
sections, was not used anymore.

The XPath code could surely be improved, but it seems
more pressing to allow our translators to get back
to their daily work without interference.

build.sh validate-* worked fine, as well as the build.sh fr
translation.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1806443 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/xsl/synopsis.xsl

index 37aa3c27d1dd6d05a4957923c3f1e126a9af95b8..401ac5ff250c39e0d0d035df693e0b57336a6e2d 100644 (file)
             <xsl:sort select="name" />
                 <xsl:choose>
                 <xsl:when test="$this[name=current()/name]">
-                    <xsl:apply-templates select="." />
+                    <!-- A directive name is allowed to be repeated if its type
+                         is different. There is currently only one allowed type
+                         to set, namely 'section', that represents
+                         directive/containers like <DirectiveName>.
+                         The following check is needed to avoid rendering
+                         multiple times the same content when a directive name
+                         is repeated.
+                     -->
+                    <xsl:choose>
+                        <xsl:when test="current()[@type='section']">
+                            <xsl:apply-templates select="$this[name=current()/name and @type='section']" />
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:apply-templates select="$this[name=current()/name and not(@type='section')]" />
+                        </xsl:otherwise>
+                    </xsl:choose>
                 </xsl:when>
                 <xsl:otherwise>
                     <xsl:apply-templates select=".">