VirtualBox

Changeset 56571 in vbox for trunk/doc/manual


Ignore:
Timestamp:
Jun 20, 2015 10:52:13 PM (10 years ago)
Author:
vboxsync
Message:

fixes and better debug.

File:
1 edited

Legend:

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

    r56570 r56571  
    334334
    335335  <xsl:template match="varlistentry/listitem">
    336     <xsl:if test="text() or *[not(self::para or self::itemizedlist or self::orderedlist)]">
    337       <xsl:message terminate="yes">Expected varlistentry/listitem to only contain para, itemizedlist and orderedlist elements:<!-- no newline -->
    338         <xsl:if test="text()">text(), </xsl:if>
    339         <for-each select="*[self::para or self::itemizedlist or self::orderedlist]">
    340           <xsl:value-of select="concat(name(.), ', ')"/>
    341         </for-each>
     336    <xsl:if test="*[not(self::para or self::itemizedlist or self::orderedlist)]|text()">
     337      <xsl:message terminate="yes">
     338        <xsl:call-template name="get-node-path"/>: error: Expected varlistentry/listitem to only contain para, itemizedlist and orderedlist elements:
     339        <xsl:call-template name="list-nodes">
     340          <xsl:with-param name="Nodes" select="*[not(self::para or self::itemizedlist or self::orderedlist)]|text()"/>
     341        </xsl:call-template>
    342342      </xsl:message>
    343343    </xsl:if>
     
    352352  <xsl:template match="itemizedlist|orderedlist">
    353353    <xsl:if test="*[not(self::listitem)]|text()">
    354       <xsl:message terminate="yes">Only listitem elements are supported in <xsl:value-of select="name()"/>.</xsl:message>
     354      <xsl:message terminate="yes">
     355        <xsl:call-template name="get-node-path"/>: error: Only listitem elements are supported in <xsl:value-of select="name()"/>:
     356        <xsl:call-template name="list-nodes">
     357          <xsl:with-param name="Nodes" select="*[not(self::listitem)]|text()"/>
     358        </xsl:call-template>
     359        </xsl:message>
    355360    </xsl:if>
    356361    <xsl:if test="parent::para">
     
    368373
    369374  <xsl:template match="itemizedlist/listitem|orderedlist/listitem">
    370     <xsl:if test="text() or *[not(self::para)]">
    371       <xsl:message terminate="yes">Expected <xsl:value-of select="name()"/>/listitem to only contain para elements</xsl:message>
    372     </xsl:if>
     375    <xsl:if test="*[not(self::para)]|text()">
     376      <xsl:message terminate="yes">
     377        <xsl:call-template name="get-node-path"/>: error: Expected <xsl:value-of select="name()"/>/listitem to only contain para elements:
     378        <xsl:call-template name="list-nodes">
     379          <xsl:with-param name="Nodes" select="*[not(self::para)]|text()"/>
     380        </xsl:call-template>
     381      </xsl:message>
     382    </xsl:if>
     383
    373384    <xsl:if test="position() != 1 and @spaceing != 'compact'">
    374385      <xsl:text>
     
    798809  </xsl:template>
    799810
     811
     812  <!--
     813    Debug/Diagnostics: Return the path to the specified node (by default the current).
     814    -->
     815  <xsl:template name="get-node-path">
     816    <xsl:param name="Node" select="."/>
     817    <xsl:for-each select="$Node">
     818      <xsl:for-each select="ancestor-or-self::node()">
     819        <xsl:choose>
     820          <xsl:when test="name(.) = ''">
     821            <xsl:text>text()</xsl:text>
     822          </xsl:when>
     823          <xsl:otherwise>
     824            <xsl:value-of select="concat('/', name(.))"/>
     825            <xsl:if test="@id">
     826              <xsl:text>[@id=</xsl:text>
     827              <xsl:value-of select="@id"/>
     828              <xsl:text>]</xsl:text>
     829            </xsl:if>
     830          </xsl:otherwise>
     831        </xsl:choose>
     832      </xsl:for-each>
     833    </xsl:for-each>
     834  </xsl:template>
     835
     836  <!--
     837    Debug/Diagnostics: Print list of nodes (by default all children of current node).
     838    -->
     839  <xsl:template name="list-nodes">
     840    <xsl:param name="Nodes" select="node()"/>
     841
     842    <for-each select="$Nodes">
     843      <xsl:if test="posision() != 1">
     844        <xsl:text>, </xsl:text>
     845      </xsl:if>
     846      <xsl:choose>
     847        <xsl:when test="name(.) = ''">
     848          <xsl:text>text()</xsl:text>
     849        </xsl:when>
     850        <xsl:otherwise>
     851          <xsl:value-of select="name(.)"/>
     852          <xsl:if test="@id">
     853            <xsl:text>[@id=</xsl:text>
     854            <xsl:value-of select="@id"/>
     855            <xsl:text>]</xsl:text>
     856          </xsl:if>
     857        </xsl:otherwise>
     858      </xsl:choose>
     859    </for-each>
     860
     861  </xsl:template>
     862
    800863</xsl:stylesheet>
    801864
Note: See TracChangeset for help on using the changeset viewer.

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