Commit acdd1f9b authored by Luca Toscano's avatar Luca Toscano
Browse files

common|synopsis.xsl: rename directive type=sections id generation

This commits is a follow up of r1805189 and it is meant
to allow directives with the same name but different type
to coexist in the same document without triggering errors
while executing validate-xhtml.

For example: mod_md.xml recently introduced the following:

* ManagedDomain
* <ManagedDomain> (this one is type=section)

In my opinion this is a perfectly valid use case and it should
be allowed/handled correctly by the doc generation process/validation.

In order to avoid clashing the directive ids will get a suffix
called "section" if type=section will be present as param.

Quicklinks, <directive> links have been updated to the new
scheme to avoid dandling pointers in the doc.

Comments/reviews are welcome, if I left something behind
please let me know.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805193 13f79535-47bb-0310-9956-ffa450edef68
parent 99465694
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -887,12 +887,12 @@ if (typeof(prettyPrint) !== 'undefined') {
        <xsl:variable name="lowerdirective">
            <xsl:choose>
            <xsl:when test="@name">
                <xsl:value-of select="normalize-space(translate(@name,
                                        $uppercase, $lowercase))" />
                <xsl:value-of select="normalize-space(concat(translate(@name,
                                        $uppercase, $lowercase),@type))" />
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="normalize-space(translate(.,
                                        $uppercase, $lowercase))" />
                <xsl:value-of select="normalize-space(concat(translate(.,
                                        $uppercase, $lowercase),@type))" />
            </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
+9 −6
Original line number Diff line number Diff line
@@ -194,8 +194,8 @@
                                    /modulesynopsis/directivesynopsis">
                            <xsl:sort select="name" />
                                <xsl:variable name="lowername"
                                    select="translate(name, $uppercase,
                                                      $lowercase)" />
                                    select="concat(translate(name, $uppercase,
                                                   $lowercase),@type)" />

                                <xsl:choose>
                                <xsl:when test="not(@location)">
@@ -353,9 +353,12 @@
    <xsl:call-template name="toplink" />&lf;

    <div class="directive-section">
        <!-- Concatenate the Directive name with its type to allow
             a directive to be referenced multiple times
             with different types -->
        <xsl:variable name="lowername"
            select="translate(name, $uppercase, $lowercase)" />

            select="concat(translate(name, $uppercase, $lowercase),@type)" />
        <xsl:variable name="directivename" select="concat(name,@type)" />
        <!-- Directive heading gets both mixed case and lowercase      -->
        <!-- anchors, and includes lt/gt only for "section" directives -->
        <h2>
@@ -377,7 +380,7 @@
                </xsl:otherwise>
                </xsl:choose>

                <a id="{name}" name="{name}">
                <a id="{$directivename}" name="{$directivename}">
                    <xsl:if test="@type='section'">&lt;</xsl:if>
                    <xsl:value-of select="name" />
                    <xsl:if test="@type='section'">&gt;</xsl:if>
@@ -385,7 +388,7 @@
            </xsl:when>

            <xsl:otherwise>
                <a id="{name}" name="{name}">
                <a id="{$directivename}" name="{$directivename}">
                    <xsl:if test="@type='section'">&lt;</xsl:if>
                    <xsl:value-of select="name" />
                    <xsl:if test="@type='section'">&gt;</xsl:if>