source: stylesheets/dump-commands.xsl@ fd8b059

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since fd8b059 was 814f5ec, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Some of the commands marked as "nodump" are actualy needed to do proper commands diffs between books versions.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@6962 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.9 KB
Line 
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:exsl="http://exslt.org/common"
4 extension-element-prefixes="exsl"
5 version="1.0">
6
7<!-- XSLT stylesheet to extract commands from [B,H]LFS books. -->
8
9 <xsl:template match="/">
10 <xsl:apply-templates select="//sect1"/>
11 </xsl:template>
12
13 <xsl:template match="sect1">
14 <!-- The dirs names -->
15 <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
16 <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
17 <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
18 <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
19 <!-- The file names -->
20 <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
21 <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
22 <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
23 <!-- The build order -->
24 <xsl:variable name="position" select="position()"/>
25 <xsl:variable name="order">
26 <xsl:choose>
27 <xsl:when test="string-length($position) = 1">
28 <xsl:text>00</xsl:text>
29 <xsl:value-of select="$position"/>
30 </xsl:when>
31 <xsl:when test="string-length($position) = 2">
32 <xsl:text>0</xsl:text>
33 <xsl:value-of select="$position"/>
34 </xsl:when>
35 <xsl:otherwise>
36 <xsl:value-of select="$position"/>
37 </xsl:otherwise>
38 </xsl:choose>
39 </xsl:variable>
40 <!-- Creating dirs and files -->
41 <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
42 <xsl:apply-templates select=".//screen"/>
43 </exsl:document>
44 </xsl:template>
45
46 <xsl:template match="screen">
47 <xsl:if test="child::* = userinput">
48 <xsl:choose>
49 <xsl:when test="@role = 'root'">
50 <xsl:text>&#xA;</xsl:text>
51 <xsl:text># Run this as root</xsl:text>
52 <xsl:apply-templates select="userinput"/>
53 <xsl:text># End root commands</xsl:text>
54 <xsl:text>&#xA;</xsl:text>
55 </xsl:when>
56 <xsl:otherwise>
57 <xsl:apply-templates select="userinput"/>
58 </xsl:otherwise>
59 </xsl:choose>
60 </xsl:if>
61 </xsl:template>
62
63 <xsl:template match="userinput">
64 <xsl:text>&#xA;</xsl:text>
65 <xsl:if test=".//replaceable">
66 <xsl:text># This block must be edited to suit your needs.</xsl:text>
67 </xsl:if>
68 <xsl:text>&#xA;</xsl:text>
69 <xsl:apply-templates/>
70 <xsl:text>&#xA;</xsl:text>
71 <xsl:if test=".//replaceable">
72 <xsl:text># End of editable block.</xsl:text>
73 </xsl:if>
74 <xsl:text>&#xA;</xsl:text>
75 </xsl:template>
76
77 <xsl:template match="replaceable">
78 <xsl:text>**EDITME</xsl:text>
79 <xsl:apply-templates/>
80 <xsl:text>EDITME**</xsl:text>
81 </xsl:template>
82
83</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.