source: common/chroot.xsl@ f1fcb6b

2.4 ablfs-more legacy trunk
Last change on this file since f1fcb6b was b97ed5b, checked in by Pierre Labastie <pierre@…>, 11 years ago

Change the svn:keyword property of common/chroot.xsl

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[d68eb1b]1<?xml version="1.0" encoding="ISO-8859-1"?>
2
[b97ed5b]3<!-- $Id$ -->
[d68eb1b]4
5<xsl:stylesheet
6 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7 xmlns:exsl="http://exslt.org/common"
8 extension-element-prefixes="exsl"
9 version="1.0">
10
11 <xsl:template match="/">
12 <xsl:apply-templates select="//sect1"/>
13 </xsl:template>
14
15 <xsl:template match="sect1">
16 <xsl:if
17 test="descendant::screen/userinput[starts-with(string(),'chroot')]">
18 <!-- The file names -->
19 <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
20 <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
21 <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
22 <!-- The build order -->
23 <xsl:variable name="position" select="position()"/>
24 <xsl:variable name="order">
25 <xsl:choose>
26 <xsl:when test="string-length($position) = 1">
27 <xsl:text>00</xsl:text>
28 <xsl:value-of select="$position"/>
29 </xsl:when>
30 <xsl:when test="string-length($position) = 2">
31 <xsl:text>0</xsl:text>
32 <xsl:value-of select="$position"/>
33 </xsl:when>
34 <xsl:otherwise>
35 <xsl:value-of select="$position"/>
36 </xsl:otherwise>
37 </xsl:choose>
38 </xsl:variable>
39 <!-- Creating dirs and files -->
40 <exsl:document href="{$order}-{$filename}" method="text">
41 <xsl:text>#!/bin/bash&#xA;</xsl:text>
42 <xsl:apply-templates select=".//userinput[starts-with(string(),'chroot')]"/>
43 <xsl:text>exit&#xA;</xsl:text>
44 </exsl:document>
45 </xsl:if>
46 </xsl:template>
47
48 <xsl:template match="userinput">
49 <xsl:apply-templates/>
50 <xsl:text>&#xA;</xsl:text>
51 </xsl:template>
52</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.