source: stylesheets/dump-commands.xsl@ fd42347a

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 12.2 7.10 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gimp3 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/for-12.3 xry111/intltool xry111/llvm18 xry111/soup3 xry111/spidermonkey128 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since fd42347a was 276015d2, checked in by Randy McMurchy <randy@…>, 18 years ago

Added the LastChangedBy and Date keywords then set the corresponding keyword property on each file in the repo

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6430 af4574ff-66df-0310-9fd7-8a98e5e911e0

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