Changeset 68872 in vbox for trunk/doc/manual
- Timestamp:
- Sep 26, 2017 10:50:57 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 118126
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/docbook-refentry-to-C-help.xsl
r68860 r68872 50 50 <!-- Assert refetry expectations. --> 51 51 <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> 53 53 </xsl:if> 54 54 <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> 56 56 </xsl:if> 57 57 <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> 59 59 </xsl:if> 60 60 <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> 62 62 </xsl:if> 63 63 <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> 65 65 </xsl:if> 66 66 <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> 68 68 </xsl:if> 69 69 … … 83 83 <!-- Assert synopsis expectations --> 84 84 <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> 86 86 </xsl:if> 87 87 <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> 89 89 </xsl:if> 90 90 <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> 92 92 </xsl:if> 93 93 … … 132 132 <!-- Then comes the description and other refsect1 --> 133 133 <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> 136 136 <xsl:if test="not(./remark[@role='help-skip'])"> 137 137 <xsl:variable name="sTitle"> … … 148 148 149 149 <xsl:apply-templates select="./*[name() != 'title']"/> 150 151 <xsl:text> 152 { RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text> 150 153 </xsl:if> 151 154 </xsl:for-each> … … 193 196 --> 194 197 <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> 196 199 <xsl:text> 197 200 { </xsl:text><xsl:call-template name="calc-scope-cmdsynopsis"/><xsl:text> | RTMSGREFENTRYSTR_FLAGS_SYNOPSIS, … … 222 225 <xsl:template match="replaceable"> 223 226 <xsl:choose> 224 <xsl:when test=" not(ancestor::cmdsynopsis) orancestor::arg">227 <xsl:when test="ancestor::arg"> 225 228 <xsl:apply-templates /> 226 229 </xsl:when> … … 249 252 <xsl:when test="@choice = 'req'"> <xsl:value-of select="$arg.choice.req.open.str"/></xsl:when> 250 253 <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> 252 255 </xsl:choose> 253 256 … … 259 262 <xsl:when test="@rep = 'norepeat' or not(@rep) or @rep = ''"/> 260 263 <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> 262 265 </xsl:choose> 263 266 <!-- close wrapping --> … … 275 278 <xsl:template match="refsect2"> 276 279 <!-- 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> 279 282 280 283 <!-- title / command synopsis - sets the scope. --> … … 324 327 <xsl:template match="variablelist"> 325 328 <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> 327 330 </xsl:if> 328 331 <xsl:for-each select="./varlistentry"> 329 332 <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> 331 334 </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))"> 333 336 <xsl:text> 334 337 { RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text> … … 358 361 <xsl:if test="*[not(self::listitem)]|text()"> 359 362 <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()"/>: 361 364 <xsl:call-template name="list-nodes"> 362 365 <xsl:with-param name="Nodes" select="*[not(self::listitem)]|text()"/> … … 380 383 <xsl:if test="*[not(self::para)]|text()"> 381 384 <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: 383 386 <xsl:call-template name="list-nodes"> 384 387 <xsl:with-param name="Nodes" select="*[not(self::para)]|text()"/> … … 416 419 <xsl:otherwise> 417 420 <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> 419 422 </xsl:if> 420 423 </xsl:otherwise> … … 565 568 --> 566 569 <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> 568 571 </xsl:template> 569 572 … … 577 580 <xsl:when test="parent::cmdsynopsis and ancestor::refsynopsisdiv"/> 578 581 <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. 580 583 Only supported on: refsect1, refsect2, refsynopsisdiv/cmdsynopsis</xsl:message> 581 584 </xsl:otherwise> … … 587 590 --> 588 591 <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> 590 593 </xsl:template> 591 594 … … 714 717 </xsl:when> 715 718 <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> 717 720 </xsl:otherwise> 718 721 </xsl:choose> … … 729 732 <xsl:choose> 730 733 <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> 732 735 </xsl:when> 733 736 … … 735 738 <xsl:variable name="sPrefix" select="concat(substring-before($sAncestorId, '-'), '-')"/> 736 739 <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> 738 741 </xsl:if> 739 742 <xsl:call-template name="str:to-upper"> … … 755 758 <xsl:variable name="sNormalized" select="concat(normalize-space(translate($sCondition, ',;:|', ' ')), ' ')"/> 756 759 <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> 758 761 </xsl:if> 759 762 <xsl:choose> … … 855 858 <xsl:otherwise> 856 859 <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> 862 870 </xsl:otherwise> 863 871 </xsl:choose> 864 872 </xsl:for-each> 865 873 </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> 866 886 </xsl:template> 867 887
Note:
See TracChangeset
for help on using the changeset viewer.