VirtualBox

Changeset 99272 in vbox


Ignore:
Timestamp:
Apr 4, 2023 1:36:25 AM (20 months ago)
Author:
vboxsync
Message:

manual: More work on the refentry to dita converter - convert to topic rather than reference. [fixes] bugref:10302

File:
1 edited

Legend:

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

    r99271 r99272  
    9191  <xsl:choose>
    9292    <xsl:when test="$g_fToReference = 'true'">
    93       <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd"&gt;
     93      <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"&gt;</xsl:text>
     94    </xsl:when>
     95    <xsl:otherwise>
     96      <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd"&gt;</xsl:text>
     97    </xsl:otherwise>
     98  </xsl:choose>
     99  <xsl:text>
    94100</xsl:text>
    95     </xsl:when>
    96     <xsl:otherwise>
    97       <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"&gt;
    98 </xsl:text>
    99     </xsl:otherwise>
    100   </xsl:choose>
    101101
    102102  <!-- Root element -->
     
    167167      <xsl:element name="topic">
    168168        <xsl:attribute name="rev">refsynopsisdiv</xsl:attribute>
    169         <xsl:attribute name="toc">no</xsl:attribute>
     169        <!-- <xsl:attribute name="toc">no</xsl:attribute> - topicref only. sigh -->
     170        <xsl:attribute name="id"><xsl:value-of select="concat(../@id,'-synopsis')"/></xsl:attribute>
    170171        <xsl:element name="title">
    171172          <xsl:text>Synopsis</xsl:text>
     
    199200      <xsl:element name="topic">
    200201        <xsl:attribute name="rev">refsect1</xsl:attribute>
    201         <xsl:attribute name="toc">no</xsl:attribute>
     202        <!-- <xsl:attribute name="toc">no</xsl:attribute> - topicref only. sigh -->
    202203        <xsl:attribute name="id">
    203204          <xsl:choose>
    204205            <xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when>
    205             <xsl:otherwise><xsl:value-of select="generate-id()"/></xsl:otherwise>
     206            <xsl:otherwise><xsl:value-of select="concat(generate-id(),'-',/@id)"/></xsl:otherwise>
    206207          </xsl:choose>
    207208        </xsl:attribute>
     
    214215            <xsl:choose>
    215216              <xsl:when test="self::title"/>
    216               <xsl:when test="self::refentry2"/>
     217              <xsl:when test="self::refsect2"/>
    217218              <xsl:when test="self::cmdsynopsis">
    218219                <xsl:element name="p">
     
    226227            </xsl:choose>
    227228          </xsl:for-each>
    228 
    229           <!-- xsl:apply-templates select="node()[not(self::title) and not(self::refentry2)]" / -->
    230229        </xsl:element>
    231230
    232         <xsl:apply-templates select="refentry2"/>
     231        <xsl:apply-templates select="refsect2"/>
    233232      </xsl:element>
    234233    </xsl:otherwise>
     
    258257      <xsl:element name="topic">
    259258        <xsl:attribute name="rev">refsect2</xsl:attribute>
    260         <xsl:attribute name="toc">no</xsl:attribute>
     259        <!-- <xsl:attribute name="toc">no</xsl:attribute> - topicref only. sigh -->
    261260        <xsl:attribute name="id">
    262261          <xsl:choose>
    263262            <xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when>
    264             <xsl:otherwise><xsl:value-of select="generate-id()"/></xsl:otherwise>
     263            <xsl:otherwise><xsl:value-of select="concat(generate-id(),'-',/@id)"/></xsl:otherwise>
    265264          </xsl:choose>
    266265        </xsl:attribute>
     
    272271            <xsl:choose>
    273272              <xsl:when test="self::title"/>
    274               <xsl:when test="self::refentry3"/>
     273              <xsl:when test="self::refsect3"/>
    275274              <xsl:when test="self::cmdsynopsis">
    276275                <xsl:element name="p">
     
    288287            </xsl:choose>
    289288          </xsl:for-each>
    290 
    291           <!-- xsl:apply-templates select="node()[not(self::title) and not(self::refentry3)]"/ -->
    292289        </xsl:element>
    293290
    294         <xsl:apply-templates select="refentry3"/>
     291        <xsl:apply-templates select="refsect3"/>
    295292      </xsl:element>
    296293    </xsl:otherwise>
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