VirtualBox

Changeset 68872 in vbox for trunk/doc/manual


Ignore:
Timestamp:
Sep 26, 2017 10:50:57 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118126
Message:

isomakercmd.cpp,docbook-refentry*.xsl: Converted the rest of the iso maker help text. Made some refentry text conversion adjustments.

File:
1 edited

Legend:

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

    r68860 r68872  
    5050    <!-- Assert refetry expectations. -->
    5151    <xsl:if test="not(./refsynopsisdiv)">
    52         <xsl:message terminate="yes">refentry must have a refsynopsisdiv</xsl:message>
     52        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refentry must have a refsynopsisdiv</xsl:message>
    5353    </xsl:if>
    5454    <xsl:if test="not(./refentryinfo/title)">
    55       <xsl:message terminate="yes">refentry must have a refentryinfo with title</xsl:message>
     55      <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refentry must have a refentryinfo with title</xsl:message>
    5656    </xsl:if>
    5757    <xsl:if test="not(./refmeta/refentrytitle)">
    58       <xsl:message terminate="yes">refentry must have a refentryinfo with title</xsl:message>
     58      <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refentry must have a refentryinfo with title</xsl:message>
    5959    </xsl:if>
    6060    <xsl:if test="./refmeta/refentrytitle != ./refnamediv/refname">
    61       <xsl:message terminate="yes">The refmeta/refentrytitle and the refnamediv/refname must be identical</xsl:message>
     61      <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>The refmeta/refentrytitle and the refnamediv/refname must be identical</xsl:message>
    6262    </xsl:if>
    6363    <xsl:if test="not(./refsect1/title)">
    64       <xsl:message terminate="yes">refentry must have a refsect1 with title</xsl:message>
     64      <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refentry must have a refsect1 with title</xsl:message>
    6565    </xsl:if>
    6666    <xsl:if test="not(@id) or @id = ''">
    67       <xsl:message terminate="yes">refentry must have an id attribute</xsl:message>
     67      <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refentry must have an id attribute</xsl:message>
    6868    </xsl:if>
    6969
     
    8383      <!-- Assert synopsis expectations -->
    8484      <xsl:if test="not(@id) or substring-before(@id, '-') != 'synopsis'">
    85         <xsl:message terminate="yes">The refsynopsisdiv/cmdsynopsis elements must have an id starting with 'synopsis-'.</xsl:message>
     85        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>The refsynopsisdiv/cmdsynopsis elements must have an id starting with 'synopsis-'.</xsl:message>
    8686      </xsl:if>
    8787      <xsl:if test="not(starts-with(substring-after(@id, '-'), $sBaseId))">
    88         <xsl:message terminate="yes">The refsynopsisdiv/cmdsynopsis elements @id is expected to include the refentry @id.</xsl:message>
     88        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>The refsynopsisdiv/cmdsynopsis elements @id is expected to include the refentry @id.</xsl:message>
    8989      </xsl:if>
    9090      <xsl:if test="not(../../refsect1/refsect2[@id=./@id])">
    91         <xsl:message terminate="yes">No refsect2 with id="<xsl:value-of select="@id"/>" found.</xsl:message>
     91        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>No refsect2 with id="<xsl:value-of select="@id"/>" found.</xsl:message>
    9292      </xsl:if>
    9393
     
    132132    <!-- Then comes the description and other refsect1 -->
    133133    <xsl:for-each select="./refsect1">
    134       <xsl:if test="name(*[1]) != 'title'"><xsl:message terminate="yes">Expected title as the first element in refsect1.</xsl:message></xsl:if>
    135       <xsl:if test="text()"><xsl:message terminate="yes">No text supported in refsect1.</xsl:message></xsl:if>
     134      <xsl:if test="name(*[1]) != 'title'"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Expected title as the first element in refsect1.</xsl:message></xsl:if>
     135      <xsl:if test="text()"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>No text supported in refsect1.</xsl:message></xsl:if>
    136136      <xsl:if test="not(./remark[@role='help-skip'])">
    137137        <xsl:variable name="sTitle">
     
    148148
    149149        <xsl:apply-templates select="./*[name() != 'title']"/>
     150
     151        <xsl:text>
     152    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    150153      </xsl:if>
    151154    </xsl:for-each>
     
    193196    -->
    194197  <xsl:template match="cmdsynopsis">
    195     <xsl:if test="text()"><xsl:message terminate="yes">cmdsynopsis with text is not supported.</xsl:message></xsl:if>
     198    <xsl:if test="text()"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>cmdsynopsis with text is not supported.</xsl:message></xsl:if>
    196199    <xsl:text>
    197200    {   </xsl:text><xsl:call-template name="calc-scope-cmdsynopsis"/><xsl:text> | RTMSGREFENTRYSTR_FLAGS_SYNOPSIS,
     
    222225  <xsl:template match="replaceable">
    223226    <xsl:choose>
    224       <xsl:when test="not(ancestor::cmdsynopsis) or ancestor::arg">
     227      <xsl:when test="ancestor::arg">
    225228        <xsl:apply-templates />
    226229      </xsl:when>
     
    249252      <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.open.str"/></xsl:when>
    250253      <xsl:when test="@choice = 'plain'"/>
    251       <xsl:otherwise><xsl:message terminate="yes">Invalid arg choice: "<xsl:value-of select="@choice"/>"</xsl:message></xsl:otherwise>
     254      <xsl:otherwise><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Invalid arg choice: "<xsl:value-of select="@choice"/>"</xsl:message></xsl:otherwise>
    252255    </xsl:choose>
    253256
     
    259262      <xsl:when test="@rep = 'norepeat' or not(@rep) or @rep = ''"/>
    260263      <xsl:when test="@rep = 'repeat'">               <xsl:value-of select="$arg.rep.repeat.str"/></xsl:when>
    261       <xsl:otherwise><xsl:message terminate="yes">Invalid rep choice: "<xsl:value-of select="@rep"/>"</xsl:message></xsl:otherwise>
     264      <xsl:otherwise><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Invalid rep choice: "<xsl:value-of select="@rep"/>"</xsl:message></xsl:otherwise>
    262265    </xsl:choose>
    263266    <!-- close wrapping -->
     
    275278  <xsl:template match="refsect2">
    276279    <!-- assertions -->
    277     <xsl:if test="text()"><xsl:message terminate="yes">refsect2 shouldn't contain text</xsl:message></xsl:if>
    278     <xsl:if test="count(./title) != 1"><xsl:message terminate="yes">refsect2 requires a title (<xsl:value-of select="ancestor-or-self::*[@id][1]/@id"/>)</xsl:message></xsl:if>
     280    <xsl:if test="text()"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refsect2 shouldn't contain text</xsl:message></xsl:if>
     281    <xsl:if test="count(./title) != 1"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refsect2 requires a title (<xsl:value-of select="ancestor-or-self::*[@id][1]/@id"/>)</xsl:message></xsl:if>
    279282
    280283    <!-- title / command synopsis - sets the scope. -->
     
    324327  <xsl:template match="variablelist">
    325328    <xsl:if test="*[not(self::varlistentry)]|text()">
    326       <xsl:message terminate="yes">Only varlistentry elements are supported in variablelist</xsl:message>
     329      <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Only varlistentry elements are supported in variablelist </xsl:message>
    327330    </xsl:if>
    328331    <xsl:for-each select="./varlistentry">
    329332      <xsl:if test="not(term) or not(listitem) or count(listitem) > 1">
    330         <xsl:message terminate="yes">Expected one or more term members and exactly one listentry member in varlistentry element.</xsl:message>
     333        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Expected one or more term members and exactly one listentry member in varlistentry element.</xsl:message>
    331334      </xsl:if>
    332       <xsl:if test="not(@spacing) or @spacing != 'compact'">
     335      <xsl:if test="(not(@spacing) or @spacing != 'compact') and (position() > 1 or (count(../preceding-sibling::*) - count(../preceding-sibling::title) > 0))">
    333336        <xsl:text>
    334337    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     
    358361    <xsl:if test="*[not(self::listitem)]|text()">
    359362      <xsl:message terminate="yes">
    360         <xsl:call-template name="get-node-path"/>: error: Only listitem elements are supported in <xsl:value-of select="name()"/>:
     363        <xsl:call-template name="error-prefix"/>Only listitem elements are supported in <xsl:value-of select="name()"/>:
    361364        <xsl:call-template name="list-nodes">
    362365          <xsl:with-param name="Nodes" select="*[not(self::listitem)]|text()"/>
     
    380383    <xsl:if test="*[not(self::para)]|text()">
    381384      <xsl:message terminate="yes">
    382         <xsl:call-template name="get-node-path"/>: error: Expected <xsl:value-of select="name()"/>/listitem to only contain para elements:
     385        <xsl:call-template name="error-prefix"/>Expected <xsl:value-of select="name()"/>/listitem to only contain para elements:
    383386        <xsl:call-template name="list-nodes">
    384387          <xsl:with-param name="Nodes" select="*[not(self::para)]|text()"/>
     
    416419        <xsl:otherwise>
    417420          <xsl:if test="*">
    418             <xsl:message terminate="yes">Support for elements under screen has not been implemented: <xsl:value-of select="name()"/></xsl:message>
     421            <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Support for elements under screen has not been implemented: <xsl:value-of select="name()"/></xsl:message>
    419422          </xsl:if>
    420423        </xsl:otherwise>
     
    565568    -->
    566569  <xsl:template match="synopfragment|synopfragmentref|title|refsect1">
    567     <xsl:message terminate="yes">The <xsl:value-of select="name()"/> element is not supported</xsl:message>
     570    <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>The <xsl:value-of select="name()"/> element is not supported</xsl:message>
    568571  </xsl:template>
    569572
     
    577580      <xsl:when test="parent::cmdsynopsis and ancestor::refsynopsisdiv"/>
    578581      <xsl:otherwise>
    579         <xsl:message terminate="yes">Misplaced remark/@role=help-scope element.
     582        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Misplaced remark/@role=help-scope element.
    580583Only supported on: refsect1, refsect2, refsynopsisdiv/cmdsynopsis</xsl:message>
    581584      </xsl:otherwise>
     
    587590    -->
    588591  <xsl:template match="remark[@role = 'help-copy-synopsis']">
    589     <xsl:message terminate="yes">remark/@role=help-copy-synopsis is not supported by this stylesheet. Must preprocess input!</xsl:message>
     592    <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>remark/@role=help-copy-synopsis is not supported by this stylesheet. Must preprocess input!</xsl:message>
    590593  </xsl:template>
    591594
     
    714717      </xsl:when>
    715718      <xsl:otherwise>
    716         <xsl:message terminate="yes">expected remark child or id attribute.</xsl:message>
     719        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>expected remark child or id attribute.</xsl:message>
    717720      </xsl:otherwise>
    718721    </xsl:choose>
     
    729732    <xsl:choose>
    730733      <xsl:when test="not($sAncestorId)">           <!-- Sanity check. -->
    731         <xsl:message terminate="yes">error: calc-scope-const-from-id is invoked without an refentry ancestor with a id. <xsl:call-template name="get-node-path"/> </xsl:message>
     734        <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>calc-scope-const-from-id is invoked without an refentry ancestor with a id. <xsl:call-template name="get-node-path"/> </xsl:message>
    732735      </xsl:when>
    733736
     
    735738        <xsl:variable name="sPrefix" select="concat(substring-before($sAncestorId, '-'), '-')"/>
    736739        <xsl:if test="not(contains($sId, $sPrefix))">
    737           <xsl:message terminate="yes">Expected sId (<xsl:value-of select="$sId"/>) to contain <xsl:value-of select="$sPrefix"/></xsl:message>
     740          <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Expected sId (<xsl:value-of select="$sId"/>) to contain <xsl:value-of select="$sPrefix"/></xsl:message>
    738741        </xsl:if>
    739742        <xsl:call-template name="str:to-upper">
     
    755758    <xsl:variable name="sNormalized" select="concat(normalize-space(translate($sCondition, ',;:|', '    ')), ' ')"/>
    756759    <xsl:if test="$sNormalized = ' ' or $sNormalized = ''">
    757       <xsl:message terminate="yes">Empty @condition for help-scope remark.</xsl:message>
     760      <xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Empty @condition for help-scope remark.</xsl:message>
    758761    </xsl:if>
    759762    <xsl:choose>
     
    855858          <xsl:otherwise>
    856859            <xsl:value-of select="concat('/', name(.))"/>
    857             <xsl:if test="@id">
    858               <xsl:text>[@id=</xsl:text>
    859               <xsl:value-of select="@id"/>
    860               <xsl:text>]</xsl:text>
    861             </xsl:if>
     860            <xsl:choose>
     861              <xsl:when test="@id">
     862                <xsl:text>[@id=</xsl:text>
     863                <xsl:value-of select="@id"/>
     864                <xsl:text>]</xsl:text>
     865              </xsl:when>
     866              <xsl:when test="position() > 1">
     867                <xsl:text>[</xsl:text><xsl:value-of select="position()"/><xsl:text>]</xsl:text>
     868              </xsl:when>
     869            </xsl:choose>
    862870          </xsl:otherwise>
    863871        </xsl:choose>
    864872      </xsl:for-each>
    865873    </xsl:for-each>
     874  </xsl:template>
     875
     876  <!--
     877    Debug/Diagnostics: Return error message prefix.
     878    -->
     879  <xsl:template name="error-prefix">
     880    <xsl:param name="Node" select="."/>
     881    <xsl:text>error: </xsl:text>
     882    <xsl:call-template name="get-node-path">
     883      <xsl:with-param name="Node" select="$Node"/>
     884    </xsl:call-template>
     885    <xsl:text>: </xsl:text>
    866886  </xsl:template>
    867887
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