source: BLFS/xsl/scripts.xsl@ 5b0b1f2

2.4
Last change on this file since 5b0b1f2 was 9da16d9, checked in by Pierre Labastie <pierre@…>, 8 years ago

Fix a bug in the blfs scripts, occuring when the pacakge is neither a
tarball nor a zip file: copy the package from $SRC_DIR to the xxx-build dir.
And in case they are needed, copy the additional files too.

  • Property mode set to 100644
File size: 20.7 KB
Line 
1<?xml version="1.0"?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:exsl="http://exslt.org/common"
5 extension-element-prefixes="exsl"
6 version="1.0">
7
8<!-- $Id$ -->
9
10<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
11
12<!-- Check whether the book is sysv or systemd -->
13 <xsl:variable name="rev">
14 <xsl:choose>
15 <xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
16 systemd
17 </xsl:when>
18 <xsl:otherwise>
19 sysv
20 </xsl:otherwise>
21 </xsl:choose>
22 </xsl:variable>
23
24 <!-- Build as user (y) or as root (n)? -->
25 <xsl:param name="sudo" select="'y'"/>
26
27 <xsl:template match="/">
28 <xsl:apply-templates select="//sect1"/>
29 </xsl:template>
30
31<!--=================== Master chunks code ======================-->
32
33 <xsl:template match="sect1">
34
35 <xsl:if test="@id != 'bootscripts' and @id != 'systemd-units'">
36 <!-- The file names -->
37 <xsl:variable name="filename" select="@id"/>
38
39 <!-- The build order -->
40 <xsl:variable name="position" select="position()"/>
41 <xsl:variable name="order">
42 <xsl:choose>
43 <xsl:when test="string-length($position) = 1">
44 <xsl:text>00</xsl:text>
45 <xsl:value-of select="$position"/>
46 </xsl:when>
47 <xsl:when test="string-length($position) = 2">
48 <xsl:text>0</xsl:text>
49 <xsl:value-of select="$position"/>
50 </xsl:when>
51 <xsl:otherwise>
52 <xsl:value-of select="$position"/>
53 </xsl:otherwise>
54 </xsl:choose>
55 </xsl:variable>
56
57 <!-- Depuration code -->
58 <xsl:message>
59 <xsl:text>SCRIPT is </xsl:text>
60 <xsl:value-of select="concat($order,'-z-',$filename)"/>
61 <xsl:text>&#xA; FTPDIR is </xsl:text>
62 <xsl:value-of select="$filename"/>
63 <xsl:text>&#xA;&#xA;</xsl:text>
64 </xsl:message>
65
66 <!-- Creating the scripts -->
67 <exsl:document href="{$order}-z-{$filename}" method="text">
68 <xsl:text>#!/bin/bash&#xA;set -e&#xA;&#xA;</xsl:text>
69 <xsl:choose>
70 <!-- Package page -->
71 <xsl:when test="sect2[@role='package']">
72 <!-- We build in a subdirectory -->
73 <xsl:text>PKG_DIR=</xsl:text>
74 <xsl:value-of select="$filename"/>
75 <xsl:text>
76SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
77BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
78mkdir -p $SRC_DIR
79mkdir -p $BUILD_DIR
80
81</xsl:text>
82 <!-- Download code and build commands -->
83 <xsl:apply-templates select="sect2"/>
84 <!-- Clean-up -->
85 <xsl:text>cd $BUILD_DIR
86[[ -n "$KEEP_FILES" ]] || </xsl:text>
87 <!-- In some case, some files in the build tree are owned
88 by root -->
89 <xsl:if test="$sudo='y'">
90 <xsl:text>sudo </xsl:text>
91 </xsl:if>
92 <xsl:text>rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
93 </xsl:when>
94 <!-- Non-package page -->
95 <xsl:otherwise>
96 <xsl:apply-templates select=".//screen"/>
97 </xsl:otherwise>
98 </xsl:choose>
99 <xsl:text>exit</xsl:text>
100 </exsl:document>
101 </xsl:if>
102 </xsl:template>
103
104<!--======================= Sub-sections code =======================-->
105
106 <xsl:template match="sect2">
107 <xsl:choose>
108 <xsl:when test="@role = 'package'">
109 <xsl:text>cd $SRC_DIR
110</xsl:text>
111 <!-- Download information is in bridgehead tags -->
112 <xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
113 <xsl:text>&#xA;</xsl:text>
114 </xsl:when>
115 <xsl:when test="@role = 'qt4-prefix' or @role = 'qt5-prefix'">
116 <xsl:apply-templates select=".//screen"/>
117 </xsl:when>
118 <xsl:when test="@role = 'installation'">
119 <xsl:text>
120cd $BUILD_DIR
121find . -maxdepth 1 -mindepth 1 -type d | xargs </xsl:text>
122 <xsl:if test="$sudo='y'">
123 <xsl:text>sudo </xsl:text>
124 </xsl:if>
125 <xsl:text>rm -rf
126case $PACKAGE in
127 *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
128 tar -xvf $SRC_DIR/$PACKAGE &gt; unpacked
129 UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
130 ;;
131 *.tar.lz)
132 bsdtar -xvf $SRC_DIR/$PACKAGE 2&gt; unpacked
133 UNPACKDIR=`head -n1 unpacked | cut -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
134 ;;
135 *.zip)
136 zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
137 UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
138 if test $(wc -w &lt;&lt;&lt; $UNPACKDIR) -eq 1; then
139 unzip $SRC_DIR/$PACKAGE
140 else
141 UNPACKDIR=${PACKAGE%.zip}
142 unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
143 fi
144 ;;
145 *)
146 UNPACKDIR=$PKG_DIR-build
147 mkdir $UNPACKDIR
148 cp $SRC_DIR/$PACKAGE $UNPACKDIR
149 cp $(find . -mindepth 1 -maxdepth 1 -type l) $UNPACKDIR
150 ;;
151esac
152cd $UNPACKDIR&#xA;
153</xsl:text>
154 <xsl:apply-templates select=".//screen | .//para/command"/>
155 <xsl:if test="$sudo = 'y'">
156 <xsl:text>sudo /sbin/</xsl:text>
157 </xsl:if>
158 <xsl:text>ldconfig&#xA;&#xA;</xsl:text>
159 </xsl:when>
160 <xsl:when test="@role = 'configuration'">
161 <xsl:apply-templates select=".//screen" mode="config"/>
162 </xsl:when>
163 </xsl:choose>
164 </xsl:template>
165
166<!--==================== Download code =======================-->
167
168 <!-- template for extracting the filename from an url in the form:
169 proto://internet.name/dir1/.../dirn/filename?condition.
170 Needed, because substring-after(...,'/') returns only the
171 substring after the first '/'. -->
172 <xsl:template name="package_name">
173 <xsl:param name="url" select="foo"/>
174 <xsl:param name="sub-url" select="substring-after($url,'/')"/>
175 <xsl:choose>
176 <xsl:when test="contains($sub-url,'/')">
177 <xsl:call-template name="package_name">
178 <xsl:with-param name="url" select="$sub-url"/>
179 </xsl:call-template>
180 </xsl:when>
181 <xsl:otherwise>
182 <xsl:choose>
183 <xsl:when test="contains($sub-url,'?')">
184 <xsl:value-of select="substring-before($sub-url,'?')"/>
185 </xsl:when>
186 <xsl:otherwise>
187 <xsl:value-of select="$sub-url"/>
188 </xsl:otherwise>
189 </xsl:choose>
190 </xsl:otherwise>
191 </xsl:choose>
192 </xsl:template>
193
194 <!-- Generates the code to download a package, an additional package or
195 a patch. -->
196 <xsl:template name="download-file">
197 <xsl:param name="httpurl" select="''"/>
198 <xsl:param name="ftpurl" select="''"/>
199 <xsl:param name="md5" select="''"/>
200 <xsl:param name="varname" select="''"/>
201 <xsl:variable name="package">
202 <xsl:call-template name="package_name">
203 <xsl:with-param name="url">
204 <xsl:choose>
205 <xsl:when test="string-length($httpurl) &gt; 10">
206 <xsl:value-of select="$httpurl"/>
207 </xsl:when>
208 <xsl:otherwise>
209 <xsl:value-of select="$ftpurl"/>
210 </xsl:otherwise>
211 </xsl:choose>
212 </xsl:with-param>
213 </xsl:call-template>
214 </xsl:variable>
215 <xsl:variable name="first_letter"
216 select="translate(substring($package,1,1),
217 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
218 'abcdefghijklmnopqrstuvwxyz')"/>
219 <xsl:text>&#xA;</xsl:text>
220 <xsl:value-of select="$varname"/>
221 <xsl:text>=</xsl:text>
222 <xsl:value-of select="$package"/>
223 <xsl:text>&#xA;if [[ ! -f $</xsl:text>
224 <xsl:value-of select="$varname"/>
225 <xsl:text> ]] ; then
226 if [[ -f $SRC_ARCHIVE/$</xsl:text>
227 <xsl:value-of select="$varname"/>
228 <xsl:text> ]] ; then&#xA;</xsl:text>
229 <xsl:text> cp $SRC_ARCHIVE/$</xsl:text>
230 <xsl:value-of select="$varname"/>
231 <xsl:text> $</xsl:text>
232 <xsl:value-of select="$varname"/>
233 <xsl:text>
234 else&#xA;</xsl:text>
235 <!-- Download from upstream http -->
236 <xsl:if test="string-length($httpurl) &gt; 10">
237 <xsl:text> wget -T 30 -t 5 </xsl:text>
238 <xsl:value-of select="$httpurl"/>
239 <xsl:text> ||&#xA;</xsl:text>
240 </xsl:if>
241 <!-- Download from upstream ftp -->
242 <xsl:if test="string-length($ftpurl) &gt; 10">
243 <xsl:text> wget -T 30 -t 5 </xsl:text>
244 <xsl:value-of select="$ftpurl"/>
245 <xsl:text> ||&#xA;</xsl:text>
246 </xsl:if>
247 <!-- The FTP_SERVER mirror as a last resort -->
248 <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
249 <xsl:value-of select="$first_letter"/>
250 <xsl:text>/$</xsl:text>
251 <xsl:value-of select="$varname"/>
252 <xsl:text><!--
253 cp $</xsl:text>
254 <xsl:value-of select="$varname"/>
255 <xsl:text> $SRC_ARCHIVE-->
256 fi
257fi
258</xsl:text>
259 <xsl:if test="string-length($md5) &gt; 10">
260 <xsl:text>echo "</xsl:text>
261 <xsl:value-of select="$md5"/>
262 <xsl:text>&#x20;&#x20;$</xsl:text>
263 <xsl:value-of select="$varname"/>
264 <xsl:text>" | md5sum -c -
265</xsl:text>
266 </xsl:if>
267<!-- link additional packages into $BUILD_DIR, because they are supposed to
268 be there-->
269 <xsl:if test="string($varname) != 'PACKAGE'">
270 <xsl:text>[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
271 <xsl:value-of select="$varname"/>
272 <xsl:text> $BUILD_DIR
273</xsl:text>
274 </xsl:if>
275 </xsl:template>
276
277 <!-- Extract the MD5 sum information -->
278 <xsl:template match="para" mode="md5">
279 <xsl:choose>
280 <xsl:when test="contains(substring-after(string(),'sum: '),'&#xA;')">
281 <xsl:value-of select="substring-before(substring-after(string(),'sum: '),'&#xA;')"/>
282 </xsl:when>
283 <xsl:otherwise>
284 <xsl:value-of select="substring-after(string(),'sum: ')"/>
285 </xsl:otherwise>
286 </xsl:choose>
287 </xsl:template>
288
289 <!-- We have several templates itemizedlist, depending on whether we
290 expect the package information, or additional package(s) or patch(es)
291 information. Select the appropriate mode here. -->
292 <xsl:template match="bridgehead">
293 <xsl:choose>
294 <!-- Special case for Openjdk -->
295 <xsl:when test="contains(string(),'Source Package Information')">
296 <xsl:apply-templates
297 select="following-sibling::itemizedlist[1]//simplelist">
298 <xsl:with-param name="varname" select="'PACKAGE'"/>
299 </xsl:apply-templates>
300 <xsl:apply-templates select="following-sibling::itemizedlist
301 [preceding-sibling::bridgehead[1]=current()
302 and position() &gt;1]//simplelist">
303 <xsl:with-param name="varname" select="'PACKAGE1'"/>
304 </xsl:apply-templates>
305 </xsl:when>
306 <!-- Package information -->
307 <xsl:when test="contains(string(),'Package Information')">
308 <xsl:apply-templates select="following-sibling::itemizedlist
309 [preceding-sibling::bridgehead[1]=current()]"
310 mode="package"/>
311 </xsl:when>
312 <!-- Additional package information -->
313 <!-- special case for llvm -->
314 <xsl:when test="contains(string(),'Optional Download')">
315 <xsl:apply-templates select="following-sibling::itemizedlist"
316 mode="additional"/>
317 </xsl:when>
318 <!-- All other additional packages have "Additional" -->
319 <xsl:when test="contains(string(),'Additional')">
320 <xsl:apply-templates select="following-sibling::itemizedlist"
321 mode="additional"/>
322 </xsl:when>
323 <!-- Do not do anything if the dev has created another type of
324 bridgehead. -->
325 <xsl:otherwise/>
326 </xsl:choose>
327 </xsl:template>
328
329 <!-- Call the download code template with appropriate parameters -->
330 <xsl:template match="itemizedlist" mode="package">
331 <xsl:call-template name="download-file">
332 <xsl:with-param name="httpurl">
333 <xsl:value-of select="./listitem[1]/para/ulink/@url"/>
334 </xsl:with-param>
335 <xsl:with-param name="ftpurl">
336 <xsl:value-of select="./listitem/para[contains(string(),'FTP')]/ulink/@url"/>
337 </xsl:with-param>
338 <xsl:with-param name="md5">
339 <xsl:apply-templates select="./listitem/para[contains(string(),'MD5')]"
340 mode="md5"/>
341 </xsl:with-param>
342 <xsl:with-param name="varname" select="'PACKAGE'"/>
343 </xsl:call-template>
344 </xsl:template>
345
346 <xsl:template match="itemizedlist" mode="additional">
347 <!-- The normal layout is "one listitem"<->"one url", but some devs
348 find amusing to have FTP and/or MD5sum listitems, or to
349 enclose the download information inside a simplelist tag... -->
350 <xsl:for-each select="listitem[.//ulink]">
351 <xsl:choose>
352 <!-- hopefully, there was a HTTP line before -->
353 <xsl:when test="contains(string(./para),'FTP')"/>
354 <xsl:when test=".//simplelist">
355 <xsl:apply-templates select=".//simplelist">
356 <xsl:with-param name="varname" select="'PACKAGE1'"/>
357 </xsl:apply-templates>
358 </xsl:when>
359 <xsl:otherwise>
360 <xsl:call-template name="download-file">
361 <xsl:with-param name="httpurl">
362 <xsl:value-of select="./para/ulink/@url"/>
363 </xsl:with-param>
364 <xsl:with-param name="ftpurl">
365 <xsl:value-of
366 select="following-sibling::listitem[1]/
367 para[contains(string(),'FTP')]/ulink/@url"/>
368 </xsl:with-param>
369 <xsl:with-param name="md5">
370 <xsl:apply-templates
371 select="following-sibling::listitem[position()&lt;3]/
372 para[contains(string(),'MD5')]"
373 mode="md5"/>
374 </xsl:with-param>
375 <xsl:with-param name="varname">
376 <xsl:choose>
377 <xsl:when test="contains(./para/ulink/@url,'.patch')">
378 <xsl:text>PATCH</xsl:text>
379 </xsl:when>
380 <xsl:otherwise>
381 <xsl:text>PACKAGE1</xsl:text>
382 </xsl:otherwise>
383 </xsl:choose>
384 </xsl:with-param>
385 </xsl:call-template>
386 </xsl:otherwise>
387 </xsl:choose>
388 </xsl:for-each>
389 </xsl:template>
390
391 <!-- the simplelist case. Hopefully, the layout is one member for
392 url, one for md5 and others for various information, that we do not
393 use -->
394 <xsl:template match="simplelist">
395 <xsl:param name="varname" select="'PACKAGE1'"/>
396 <xsl:call-template name="download-file">
397 <xsl:with-param name="httpurl" select=".//ulink/@url"/>
398 <xsl:with-param name="md5">
399 <xsl:value-of select="substring-after(member[contains(string(),'MD5')],'sum: ')"/>
400 </xsl:with-param>
401 <xsl:with-param name="varname" select="$varname"/>
402 </xsl:call-template>
403 </xsl:template>
404<!--======================== Commands code ==========================-->
405
406 <xsl:template match="screen">
407 <xsl:if test="child::* = userinput and not(@role = 'nodump')">
408 <xsl:choose>
409 <xsl:when test="@role = 'root'">
410 <xsl:if test="$sudo = 'y'">
411 <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
412 </xsl:if>
413 <xsl:apply-templates mode="root"/>
414 <xsl:if test="$sudo = 'y'">
415 <xsl:text>&#xA;ROOT_EOF</xsl:text>
416 </xsl:if>
417 </xsl:when>
418 <xsl:otherwise>
419 <xsl:apply-templates select="userinput"/>
420 </xsl:otherwise>
421 </xsl:choose>
422 <xsl:text>&#xA;</xsl:text>
423 </xsl:if>
424 </xsl:template>
425
426 <xsl:template name="set-bootpkg-dir">
427 <xsl:param name="bootpkg" select="'bootscripts'"/>
428 <xsl:param name="url" select="''"/>
429 <xsl:text>[[ ! -d $SRC_DIR/blfs-</xsl:text>
430 <xsl:copy-of select="$bootpkg"/>
431 <xsl:text> ]] &amp;&amp; mkdir $SRC_DIR/blfs-</xsl:text>
432 <xsl:copy-of select="$bootpkg"/>
433 <xsl:text>
434pushd $SRC_DIR/blfs-</xsl:text>
435 <xsl:copy-of select="$bootpkg"/>
436 <xsl:text>
437URL=</xsl:text>
438 <xsl:value-of select="$url"/>
439 <xsl:text>
440BOOTPACKG=$(basename $URL)
441if [[ ! -f $BOOTPACKG ]] ; then
442 if [[ -f $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG ]] ; then
443 cp $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG $BOOTPACKG
444 elif [[ -f $SRC_ARCHIVE/$BOOTPACKG ]] ; then
445 cp $SRC_ARCHIVE/$BOOTPACKG $BOOTPACKG
446 else
447 wget -T 30 -t 5 $URL
448 cp $BOOTPACKG $SRC_ARCHIVE
449 fi
450 rm -f unpacked
451fi
452
453if [[ -e unpacked ]] ; then
454 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
455 if ! [[ -d $BOOTUNPACKDIR ]]; then
456 rm unpacked
457 tar -xvf $BOOTPACKG > unpacked
458 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
459 fi
460else
461 tar -xvf $BOOTPACKG > unpacked
462 BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
463fi
464cd $BOOTUNPACKDIR
465</xsl:text>
466 </xsl:template>
467
468 <xsl:template match="screen" mode="config">
469 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
470 <xsl:call-template name="set-bootpkg-dir">
471 <xsl:with-param name="bootpkg" select="'bootscripts'"/>
472 <xsl:with-param name="url"
473 select="id('bootscripts')//itemizedlist//ulink/@url"/>
474 </xsl:call-template>
475 </xsl:if>
476 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
477 <xsl:call-template name="set-bootpkg-dir">
478 <xsl:with-param name="bootpkg" select="'systemd-units'"/>
479 <xsl:with-param name="url"
480 select="id('systemd-units')//itemizedlist//ulink/@url"/>
481 </xsl:call-template>
482 </xsl:if>
483 <xsl:apply-templates select='.'/>
484 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
485 @linkend='systemd-units']">
486 <xsl:text>
487popd</xsl:text>
488 </xsl:if>
489 <xsl:text>&#xA;</xsl:text>
490 </xsl:template>
491
492 <xsl:template match="para/command">
493 <xsl:variable name="ns" select="normalize-space(string())"/>
494 <xsl:if test="(contains($ns,'test') or
495 contains($ns,'check'))">
496 <xsl:text>#</xsl:text>
497 <xsl:value-of select="substring-before($ns,'make ')"/>
498 <xsl:text>make </xsl:text>
499 <xsl:if test="not(contains($ns,'-k'))">
500 <xsl:text>-k </xsl:text>
501 </xsl:if>
502 <xsl:value-of select="substring-after($ns,'make ')"/>
503 <xsl:text> || true&#xA;</xsl:text>
504 </xsl:if>
505 </xsl:template>
506
507 <xsl:template match="userinput">
508 <xsl:apply-templates/>
509 </xsl:template>
510
511 <xsl:template match="text()" mode="root">
512 <xsl:call-template name="output-root">
513 <xsl:with-param name="out-string" select="string()"/>
514 </xsl:call-template>
515 </xsl:template>
516
517 <xsl:template name="output-root">
518 <xsl:param name="out-string" select="''"/>
519 <xsl:choose>
520 <xsl:when test="contains($out-string,'make ')">
521 <xsl:call-template name="output-root">
522 <xsl:with-param name="out-string"
523 select="substring-before($out-string,'make ')"/>
524 </xsl:call-template>
525 <xsl:text>make -j1 </xsl:text>
526 <xsl:call-template name="output-root">
527 <xsl:with-param name="out-string"
528 select="substring-after($out-string,'make ')"/>
529 </xsl:call-template>
530 </xsl:when>
531 <xsl:when test="contains($out-string,'$') and $sudo = 'y'">
532 <xsl:call-template name="output-root">
533 <xsl:with-param name="out-string"
534 select="substring-before($out-string,'$')"/>
535 </xsl:call-template>
536 <xsl:text>\$</xsl:text>
537 <xsl:call-template name="output-root">
538 <xsl:with-param name="out-string"
539 select="substring-after($out-string,'$')"/>
540 </xsl:call-template>
541 </xsl:when>
542 <xsl:when test="contains($out-string,'`') and $sudo = 'y'">
543 <xsl:call-template name="output-root">
544 <xsl:with-param name="out-string"
545 select="substring-before($out-string,'`')"/>
546 </xsl:call-template>
547 <xsl:text>\`</xsl:text>
548 <xsl:call-template name="output-root">
549 <xsl:with-param name="out-string"
550 select="substring-after($out-string,'`')"/>
551 </xsl:call-template>
552 </xsl:when>
553 <xsl:when test="contains($out-string,'\') and $sudo = 'y'">
554 <xsl:call-template name="output-root">
555 <xsl:with-param name="out-string"
556 select="substring-before($out-string,'\')"/>
557 </xsl:call-template>
558 <xsl:text>\\</xsl:text>
559 <xsl:call-template name="output-root">
560 <xsl:with-param name="out-string"
561 select="substring-after($out-string,'\')"/>
562 </xsl:call-template>
563 </xsl:when>
564 <xsl:otherwise>
565 <xsl:value-of select="$out-string"/>
566 </xsl:otherwise>
567 </xsl:choose>
568 </xsl:template>
569
570 <xsl:template match="replaceable">
571 <xsl:text>**EDITME</xsl:text>
572 <xsl:apply-templates/>
573 <xsl:text>EDITME**</xsl:text>
574 </xsl:template>
575
576 <xsl:template match="replaceable" mode="root">
577 <xsl:text>**EDITME</xsl:text>
578 <xsl:apply-templates/>
579 <xsl:text>EDITME**</xsl:text>
580 </xsl:template>
581
582</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.