Changeset 36f5dce for LFS/lfs.xsl
- Timestamp:
- 06/09/2020 07:28:05 AM (4 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- ebe1ba6
- Parents:
- 9ef12f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/lfs.xsl
r9ef12f7 r36f5dce 103 103 </xsl:choose> 104 104 </xsl:variable> 105 106 <!-- Start of templates --> 105 107 <xsl:template match="/"> 106 <xsl:apply-templates select="//sect1[not(@revision) or 107 @revision=$revision]"/> 108 </xsl:template> 109 110 <xsl:template match="sect1"> 111 <!-- Since this xsl:if tag encloses the whole template, it would 112 be much better to transpose this condition to the select part 113 of the "calling" apply-template. But that would change the numbering, 114 so that it would be difficult to compare to previous versions. So for 115 version 2.4, let us keep this --> 116 <xsl:if test="(../@id='chapter-temporary-tools' or 117 ../@id='chapter-final-preps' or 118 ../@id='chapter-building-system' or 119 ../@id='chapter-bootscripts' or 120 ../@id='chapter-config' or 121 ../@id='chapter-bootable') and 122 (sect2[not(@revision) or @revision=$revision]//..|.)/ 123 screen[(not(@role) or @role != 'nodump') and 124 (not(@revision) or @revision=$revision)]/ 125 userinput[not(starts-with(string(),'chroot'))]"> 126 <!-- The last condition is a hack to allow previous versions of the 108 <xsl:apply-templates select="//chapter[ 109 @id='chapter-final-preps' or 110 @id='chapter-cross-tools' or 111 @id='chapter-temporary-tools' or 112 @id='chapter-chroot-temporary-tools' or 113 @id='chapter-building-system' or 114 @id='chapter-config' or 115 @id='chapter-bootscripts' or 116 @id='chapter-bootable']"/> 117 </xsl:template> 118 119 <xsl:template match="chapter"> 120 <xsl:apply-templates select="./sect1[ 121 (not(@revision) or @revision=$revision) and 122 .//screen[(not(@role) or @role != 'nodump') and 123 (not(@revision) or @revision=$revision)]/ 124 userinput[not(starts-with(string(),'chroot'))]]"> 125 <xsl:with-param name="chap-num" select="position()+3"/> 126 </xsl:apply-templates> 127 <!-- The last condition is a hack to allow old versions of the 127 128 book where the chroot commands did not have role="nodump". 128 129 It only works if the chroot command is the only one on the page --> 129 <!-- The dirs names --> 130 <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/> 131 <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/> 132 <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/> 133 <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/> 130 </xsl:template> 131 132 <xsl:template match="sect1"> 133 <xsl:param name="chap-num" select="'1'"/> 134 <!-- The dirs names --> 135 <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/> 136 <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/> 137 <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/> 138 <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/> 134 139 <!-- The file names --> 135 140 <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/> … … 139 144 <xsl:variable name="position" select="position()"/> 140 145 <xsl:variable name="order"> 141 <xsl:choose> 142 <xsl:when test="string-length($position) = 1"> 143 <xsl:text>00</xsl:text> 144 <xsl:value-of select="$position"/> 145 </xsl:when> 146 <xsl:when test="string-length($position) = 2"> 147 <xsl:text>0</xsl:text> 148 <xsl:value-of select="$position"/> 149 </xsl:when> 150 <xsl:otherwise> 151 <xsl:value-of select="$position"/> 152 </xsl:otherwise> 153 </xsl:choose> 146 <xsl:value-of select="$chap-num"/> 147 <xsl:if test="string-length($position) = 1"> 148 <xsl:text>0</xsl:text> 149 </xsl:if> 150 <xsl:value-of select="$position"/> 154 151 </xsl:variable> 155 152 <!-- Inclusion of package manager scriptlets --> 156 <xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'"> 153 <xsl:if test="@id='ch-tools-stripping' and 154 $pkgmngt='y' and 155 $bashdir='/tools'"> 157 156 <xsl:apply-templates 158 159 157 select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]" 158 mode="pkgmngt"> 160 159 <xsl:with-param name="order" select="$order"/> 161 160 <xsl:with-param name="dirname" select="$dirname"/> 162 161 </xsl:apply-templates> 163 162 </xsl:if> 164 <xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'"> 163 <xsl:if test="@id='ch-system-strippingagain' and 164 $pkgmngt='y' and 165 $bashdir='/tools'"> 165 166 <xsl:apply-templates 166 select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]" 167 select="document('packageManager.xml')//sect1[ 168 contains(@id,'ch-system')]" 167 169 mode="pkgmngt"> 168 170 <xsl:with-param name="order" select="$order"/> … … 215 217 <xsl:text>exit
</xsl:text> 216 218 </exsl:document> 217 </xsl:if>218 219 </xsl:template> 219 220
Note:
See TracChangeset
for help on using the changeset viewer.