VirtualBox

Changeset 77177 in vbox for trunk/doc/manual


Ignore:
Timestamp:
Feb 6, 2019 2:35:09 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128664
Message:

docbook-refentry-to-C-help.xsl: Skip the extra <> around arguments within a group. Check that args and group has the same choice value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/docbook-refentry-to-C-help.xsl

    r77173 r77177  
    248248      </xsl:choose>
    249249    </xsl:if>
     250
     251    <!-- Make sure group choice and arg choice matches. -->
     252    <xsl:if test="self::arg and ancestor::group">
     253      <xsl:if test="@choice != ancestor::group/@choice">
     254        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Mismatching group and arg choice: "<xsl:value-of select="@choice"/>" (arg) vs "<xsl:value-of select="ancestor::group/@choice"/>" (group)</xsl:message>
     255      </xsl:if>
     256    </xsl:if>
     257
    250258    <!-- open wrapping -->
    251     <xsl:choose>
    252       <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.open.str"/></xsl:when>
    253       <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.open.str"/></xsl:when>
    254       <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.open.str"/></xsl:when>
    255       <xsl:when test="@choice = 'plain'"/>
    256       <xsl:otherwise><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Invalid arg choice: "<xsl:value-of select="@choice"/>"</xsl:message></xsl:otherwise>
    257     </xsl:choose>
     259    <xsl:variable name="fWrappers" select="not(ancestor::group)"/>
     260    <xsl:if test="$fWrappers">
     261      <xsl:choose>
     262        <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.open.str"/></xsl:when>
     263        <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.open.str"/></xsl:when>
     264        <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.open.str"/></xsl:when>
     265        <xsl:when test="@choice = 'plain'"/>
     266        <xsl:otherwise><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Invalid arg choice: "<xsl:value-of select="@choice"/>"</xsl:message></xsl:otherwise>
     267      </xsl:choose>
     268    </xsl:if>
    258269
    259270    <!-- render the arg (TODO: may need to do more work here) -->
     
    266277      <xsl:otherwise><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Invalid rep choice: "<xsl:value-of select="@rep"/>"</xsl:message></xsl:otherwise>
    267278    </xsl:choose>
     279
    268280    <!-- close wrapping -->
    269     <xsl:choose>
    270       <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.close.str"/></xsl:when>
    271       <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.close.str"/></xsl:when>
    272       <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.close.str"/></xsl:when>
    273     </xsl:choose>
     281    <xsl:if test="$fWrappers">
     282      <xsl:choose>
     283        <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.close.str"/></xsl:when>
     284        <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.close.str"/></xsl:when>
     285        <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.close.str"/></xsl:when>
     286      </xsl:choose>
     287    </xsl:if>
    274288  </xsl:template>
    275289
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette