1 <?xml version=
"1.0" encoding=
"utf-8"?>
5 Purpose: Common declarations for buildbot
7 Copyright: (c) 2007 Mike Wetherell
8 Licence: wxWindows licence
11 <bot xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
12 xmlns:
exsl=
"http://exslt.org/common"
13 xmlns:
func=
"http://exslt.org/functions"
15 xsl:
extension-element-prefixes=
"func"
21 <xsl:template name=
"SVN_URL">http://svn.wxwidgets.org/svn/wx/wxWidgets/
</xsl:template>
22 <xsl:template name=
"STABLE_BRANCH">branches/WX_2_8_BRANCH
</xsl:template>
23 <xsl:variable name=
"STABLE_BRANCH"><STABLE_BRANCH/></xsl:variable>
24 <xsl:template name=
"RELEASE_BRANCH">branches/WX_2_9_0_BRANCH
</xsl:template>
25 <xsl:variable name=
"RELEASE_BRANCH"><RELEASE_BRANCH/></xsl:variable>
26 <xsl:template name=
"SNAPSHOT_URL">http://biolpc22.york.ac.uk/pub
</xsl:template>
29 disable - comment out a section.
35 XML comments can't contain a double hyphen which tends to be used in
36 configure commands, so <disable> can be used instead.
38 <xsl:template name=
"disable"/>
41 checkout - build step for source checkout.
43 Usage: as <svn> with defaults for <baseURL> and <defaultBranch>
48 <checkout branch="branches/WX_2_8_BRANCH"/>
51 <xsl:template name=
"checkout">
52 <xsl:param name=
"content"/>
53 <xsl:param name=
"branch" select=
"'trunk'"/>
54 <xsl:variable name=
"nodes" select=
"exsl:node-set($content)"/>
56 <xsl:if test=
"not($nodes/svnurl)">
57 <xsl:if test=
"not($nodes/baseURL)">
58 <baseURL><SVN_URL/></baseURL>
60 <xsl:if test=
"not($nodes/defaultBranch)">
61 <defaultBranch><xsl:value-of select=
"$branch"/></defaultBranch>
64 <xsl:copy-of select=
"$content"/>
69 configure - add the options attribute to <configure>
71 Usage: <configure options="-with-foobar"/>
73 <xsl:template name=
"configure">
74 <xsl:param name=
"content"/>
75 <xsl:param name=
"options"/>
77 <copy-with-defaults content=
"{$content}">
78 <command>./configure
<xsl:value-of select=
"normalize-space($options)"/></command>
84 make - specify the make command.
86 Usage: <make>nmake -f makefile.vc SHARED=1</make>
88 Used as a child of <build> to specify the make command used by the
89 <compile> elements below, if omitted 'make' is used.
91 <xsl:template name=
"make"/>
94 compile - modifiy <compile> to default to the command given by <make>
98 The <make> element of <build> spcecifies the make command used by all
99 compile build steps in the build. If <make> is not given 'make' is used.
101 The command for a particular compile build step can be further overridden
102 using its <command> element:
104 <command>myscript</command>
107 <xsl:template name=
"compile">
108 <xsl:param name=
"content"/>
110 <copy-with-defaults content=
"{$content}">
111 <command><get name=
"make" default=
"make"/></command>
112 </copy-with-defaults>
117 Adds build steps to compile the library and the usual subdirectories.
119 Usage: as <compile> with the additional attributes below.
121 Usually the attributes default to suitable values, so typical usage
122 is just <compile-all/>.
124 <compile-all [ gui = 'true'|'false' ]
125 [ msw = 'true'|'false' ]
126 [ wx = 'true'|'false' ]
127 [ samples = 'true'|'false' ]
128 [ utils = 'true'|'false' ]
129 [ demos = 'true'|'false' ]
130 [ contrib = 'true'|'false' ]
131 [ tests = 'true'|'false' ] />
133 gui - if 'true' then build fully the subdirectories specified,
134 otherwise only the wxBase subset of the directories are built.
135 msw - if 'true' then build the directory 'build/msw' when building the
136 library instead of the root.
137 wx - build the library itself.
138 samples, utils, demos, contrib, tests
139 - build subdirectories.
141 <xsl:template name=
"compile-all">
142 <xsl:param name=
"content"/>
144 <xsl:param name=
"gui"><is-gui/></xsl:param>
145 <xsl:param name=
"msw"><is-msw/></xsl:param>
147 <xsl:param name=
"wx" select=
"'true'"/>
148 <xsl:param name=
"samples" select=
"'true'"/>
149 <xsl:param name=
"utils" select=
"'true'"/>
150 <xsl:param name=
"demos" select=
"$gui"/>
151 <xsl:param name=
"contrib"><has-contrib/></xsl:param>
152 <xsl:param name=
"tests"><has-tests/></xsl:param>
154 <xsl:param name=
"wx-dirs">
155 <get-dirs wx=
"{$wx}" gui=
"{$gui}" msw=
"{$msw}"/>
157 <xsl:param name=
"sample-dirs">
158 <get-dirs samples=
"{$samples}" gui=
"{$gui}" msw=
"{$msw}"/>
160 <xsl:param name=
"util-dirs">
161 <get-dirs utils=
"{$utils}" gui=
"{$gui}" msw=
"{$msw}"/>
163 <xsl:param name=
"demo-dirs">
164 <get-dirs demos=
"{$demos}" gui=
"{$gui}" msw=
"{$msw}"/>
166 <xsl:param name=
"contrib-dirs">
167 <get-dirs contrib=
"{$contrib}" gui=
"{$gui}" msw=
"{$msw}"/>
169 <xsl:param name=
"test-dirs">
170 <get-dirs tests=
"{$tests}" gui=
"{$gui}" msw=
"{$msw}"/>
173 <compile-subdirs dirs=
"{$wx-dirs}" halt=
"true">
174 <xsl:copy-of select=
"$content"/>
176 <compile-subdirs name=
"samples" dirs=
"{$sample-dirs}">
177 <xsl:copy-of select=
"$content"/>
179 <compile-subdirs name=
"utils" dirs=
"{$util-dirs}">
180 <xsl:copy-of select=
"$content"/>
182 <compile-subdirs name=
"demos" dirs=
"{$demo-dirs}">
183 <xsl:copy-of select=
"$content"/>
185 <compile-subdirs name=
"contrib" dirs=
"{$contrib-dirs}">
186 <xsl:copy-of select=
"$content"/>
188 <compile-subdirs name=
"tests" dirs=
"{$test-dirs}" halt=
"true">
189 <xsl:copy-of select=
"$content"/>
194 Helper for compile-all.
195 Returns the directories that need to be built for the various components:
196 wx (the library itself), samples, utils, demos, contrib and tests.
198 <xsl:template name=
"get-dirs">
199 <xsl:param name=
"contents"/>
201 <xsl:param name=
"gui"/>
202 <xsl:param name=
"msw"/>
204 <xsl:param name=
"wx"/>
205 <xsl:param name=
"samples"/>
206 <xsl:param name=
"utils"/>
207 <xsl:param name=
"demos"/>
208 <xsl:param name=
"contrib"/>
209 <xsl:param name=
"tests"/>
211 <xsl:if test=
"$wx = 'true'">
213 <xsl:when test=
"$msw = 'true'">build/msw
</xsl:when>
214 <xsl:otherwise>.
</xsl:otherwise>
216 <xsl:text> </xsl:text>
219 <xsl:if test=
"$samples = 'true'">
221 <xsl:when test=
"$gui = 'true'">samples
</xsl:when>
222 <xsl:otherwise>samples/console
</xsl:otherwise>
224 <xsl:text> </xsl:text>
227 <xsl:if test=
"$utils = 'true' and $gui = 'true'">utils
</xsl:if>
229 <xsl:if test=
"$demos = 'true' and $gui = 'true'">demos
</xsl:if>
231 <xsl:if test=
"$contrib = 'true' and $gui = 'true'">contrib
</xsl:if>
233 <xsl:if test=
"$tests = 'true'">tests
</xsl:if>
237 compile-subdir - build step to compile a subdirectory.
239 Usage: as <compile> plus the following attributes,
240 <compile-subdir dir="foobar" [ halt="true" ]/>
242 Compiles the named subdirectory 'foobar'. Continues with the next build
243 step on failure, unless the optional attibute 'halt="true"' is given.
244 The make command used is as described for the compile step above.
246 <xsl:template name=
"compile-subdir">
247 <xsl:param name=
"content"/>
248 <xsl:param name=
"dir"/>
249 <xsl:param name=
"halt" select=
"'false'"/>
250 <compile-subdirs name=
"{$dir}" dirs=
"{$dir}" halt=
"{$halt}">
251 <xsl:copy-of select=
"$content"/>
256 compile-subdirs - adds a compile build step for each directory in a list.
258 Usage: as <compile> plus the following attributes,
259 <compile-subdir dirs="foobar1 foobar2"
264 Compiles the named subdirectories. Continues with the next build
265 step on failure, unless the optional attibute 'halt="true"' is given.
266 The make command used is as described for the compile step above.
267 The 'name' attribute can be used to give a collective name for the
268 subdirectories, and the 'sep' attibute can be used to specify the
269 separator in the 'dirs' list (defaults to space).
271 <xsl:template name=
"compile-subdirs">
272 <xsl:param name=
"content"/>
273 <xsl:param name=
"name"/>
274 <xsl:param name=
"dirs"/>
275 <xsl:param name=
"sep" select=
"' '"/>
276 <xsl:param name=
"halt" select=
"'false'"/>
277 <xsl:if test=
"translate($dirs, $sep, '')">
279 <defaults content=
"{$content}">
281 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
284 <xsl:value-of select=
"normalize-space(concat('compiling ', $name))"/>
287 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
290 <xsl:value-of select=
"$halt"/>
294 <copy-with-defaults content=
"{$content}">
296 <compile-subdirs-cmd dirs=
"{$dirs}" sep=
"{$sep}"/>
298 </copy-with-defaults>
303 <xsl:template name=
"compile-subdirs-cmd">
304 <xsl:param name=
"content"/>
305 <xsl:param name=
"dirs"/>
306 <xsl:param name=
"sep"/>
308 <xsl:when test=
"contains($dirs, $sep)">
309 <xsl:variable name=
"before" select=
"substring-before($dirs, $sep)"/>
310 <xsl:variable name=
"after" select=
"substring-after($dirs, $sep)"/>
312 <xsl:call-template name=
"compile-subdirs-cmd">
313 <xsl:with-param name=
"dirs" select=
"$before"/>
314 <xsl:with-param name=
"sep" select=
"$sep"/>
317 <xsl:if test=
"$after and substring($after, 1, 1) != ' '">
318 <xsl:text> && </xsl:text>
321 <xsl:call-template name=
"compile-subdirs-cmd">
322 <xsl:with-param name=
"dirs" select=
"$after"/>
323 <xsl:with-param name=
"sep" select=
"$sep"/>
326 <xsl:when test=
"string($dirs)">
327 <xsl:if test=
"$dirs != '.'">cd
<xsl:value-of select=
"$dirs"/> && </xsl:if>
328 <get name=
"make" default=
"make"/>
334 run-tests - build step to run the test suites.
341 <xsl:template name=
"run-tests">
342 <xsl:param name=
"content"/>
343 <xsl:param name=
"options" select=
"'-t'"/>
344 <xsl:param name=
"guioptions" select=
"$options"/>
345 <xsl:param name=
"msw"><is-msw/></xsl:param>
347 <defaults content=
"{$content}">
348 <description>running tests
</description>
349 <descriptionDone>run tests
</descriptionDone>
352 <copy-with-defaults content=
"{$content}">
355 <xsl:when test=
"$msw = 'true'">
356 <run-tests-win options=
"{$options}" guioptions=
"{$guioptions}"/>
359 <run-tests-unix options=
"{$options}" guioptions=
"{$guioptions}"/>
363 </copy-with-defaults>
367 <xsl:template name=
"run-tests-win">
368 <xsl:param name=
"options"/>
369 <xsl:param name=
"guioptions"/>
371 cd tests
&& runtests.bat
375 <xsl:template name=
"run-tests-unix">
376 <xsl:param name=
"options"/>
377 <xsl:param name=
"guioptions"/>
388 if [ -f core -a -x "`which gdb`" ]; then
389 echo Crashed, attempting to display backtrace:
390 gdb -batch -c core -ex 'set pagination off' -ex bt "$
1"
396 try ./test
<xsl:value-of select=
"normalize-space($options)"/>
398 test -x test_gui || exit $ERR
400 if [ -z "$DISPLAY" ]; then
401 echo '$DISPLAY is not set, skipping GUI tests.'
405 echo 'Checking window manager:'
406 WINDOW_MANAGER=$(xprop -root
32x '\n$
0\n' _NET_SUPPORTING_WM_CHECK | grep ^
0x)
408 if [ -z "$WINDOW_MANAGER" ]; then
409 echo 'Window manager not present, skipping GUI tests.'
413 xprop -id $WINDOW_MANAGER
8s _NET_WM_NAME
416 try ./test_gui
<xsl:value-of select=
"normalize-space($guioptions)"/>
422 defaults - supply default content for an element.
424 Usage: <defaults content="{$content}">
429 Copies those child elements that do not already exist in $content.
431 <xsl:template name=
"defaults">
432 <xsl:param name=
"defaults"/>
433 <xsl:param name=
"content"/>
435 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
436 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
438 <xsl:for-each select=
"$def-nodes/*">
439 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
440 <xsl:copy-of select=
"."/>
446 copy-with-defaults - copy elements supplying defaults for any that are
449 Usage: <copy-with-defaults content="{$content}">
452 </copy-with-defaults>
454 Copies $content plus any child elements that do not exist in $content,
455 substituting empty elements in $content with any child elements of the
458 <xsl:template name=
"copy-with-defaults">
459 <xsl:param name=
"defaults"/>
460 <xsl:param name=
"content"/>
462 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
463 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
465 <xsl:for-each select=
"$def-nodes/*">
466 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
467 <xsl:copy-of select=
"."/>
471 <xsl:for-each select=
"$cont-nodes/*">
473 <xsl:when test=
"not(node())">
474 <xsl:copy-of select=
"$def-nodes/*[name() = name(current())]"/>
477 <xsl:copy-of select=
"."/>
484 get - gets the text from a child element of the current build.
486 Usage: <get name="foobar" [ default="value" ]/>
488 Gets the text from the <foobar> element of the current build, or returns
489 $default if there is not such element.
491 <xsl:template name=
"get">
492 <xsl:param name=
"content"/>
493 <xsl:param name=
"build" select=
"get:build()"/>
494 <xsl:param name=
"name"/>
495 <xsl:param name=
"default"/>
496 <xsl:variable name=
"property" select=
"get:property($name, $build)"/>
499 <xsl:when test=
"$property">
500 <xsl:apply-templates select=
"$property/node()"/>
503 <xsl:value-of select=
"$default"/>
510 Accessors to get builds and their fields. XSLT code should use these
511 instead of traversing the input tree directly.
513 <func:function name=
"get:build">
514 <func:result select=
"ancestor-or-self::build[last()]"/>
517 <func:function name=
"get:all-builds">
518 <func:result select=
"//build[not(ancestor::*[name() != name(/*)])]"/>
521 <func:function name=
"get:preceding-builds">
522 <func:result select=
"get:build()/preceding-sibling::build"/>
525 <func:function name=
"get:property">
526 <xsl:param name=
"name"/>
527 <xsl:param name=
"build" select=
"get:build()"/>
528 <func:result select=
"$build/*[name() = $name]"/>
531 <func:function name=
"get:step">
532 <xsl:param name=
"name"/>
533 <xsl:param name=
"build" select=
"get:build()"/>
534 <func:result select=
"get:property('steps', $build)/*[name() = $name]"/>
538 Returns true if this is an msw build.
540 <xsl:template name=
"is-msw">
541 <xsl:param name=
"content"/>
542 <xsl:param name=
"build" select=
"get:build()"/>
543 <xsl:value-of select=
"not(get:step('configure', $build))"/>
547 Returns true if this a gui build.
549 <xsl:template name=
"is-gui">
550 <xsl:param name=
"content"/>
551 <xsl:param name=
"build" select=
"get:build()"/>
552 <xsl:variable name=
"make"><get name=
"make" build=
"{$build}"/></xsl:variable>
553 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
554 <xsl:value-of select=
"not(contains($make, 'USE_GUI=0') or contains($configure, '--disable-gui'))"/>
558 Returns true if the branch we're building has a contrib subdirectory.
560 <xsl:template name=
"has-contrib">
561 <xsl:param name=
"content"/>
562 <xsl:param name=
"build" select=
"get:build()"/>
563 <xsl:variable name=
"checkout"><xsl:apply-templates select=
"get:step('checkout', $build)"/></xsl:variable>
564 <xsl:value-of select=
"contains($checkout, 'WX_2_') and not(contains($checkout, 'WX_2_9_'))"/>
568 Returns true if the build should build the test suite.
570 <xsl:template name=
"has-tests">
571 <xsl:param name=
"content"/>
572 <xsl:param name=
"build" select=
"get:build()"/>
573 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
574 <xsl:value-of select=
"get:step('run-tests', $build) or contains($configure, '--host=')"/>
578 strip - strips leading and trailing whitespace
584 Converts to text and strips leading and trailing whitespace.
586 <xsl:template name=
"strip">
587 <xsl:param name=
"content"/>
588 <xsl:variable name=
"len" select=
"string-length($content)"/>
589 <xsl:variable name=
"norm" select=
"normalize-space($content)"/>
590 <xsl:variable name=
"normlen" select=
"string-length($norm)"/>
592 <xsl:when test=
"substring($content, 1, 1) != substring($norm, 1, 1)">
593 <xsl:call-template name=
"strip">
594 <xsl:with-param name=
"content" select=
"substring($content, 2)"/>
597 <xsl:when test=
"substring($content, $len, 1) != substring($norm, $normlen, 1)">
598 <xsl:call-template name=
"strip">
599 <xsl:with-param name=
"content" select=
"substring($content, 1, $len - 1)"/>
603 <xsl:value-of select=
"$content"/>
609 normalize-space - normalises whitespace.
611 Usage: <normalize-space>
615 Converts to text, strips leading and trailing whitespace and replaces
616 sequences of whitespace characters by a single space.
618 <xsl:template name=
"normalize-space">
619 <xsl:param name=
"content"/>
620 <xsl:value-of select=
"normalize-space($content)"/>
624 lower-case - converts to lower case.
626 Usage: <lower-case>FooBar</lower-case>
628 <xsl:template name=
"lower-case">
629 <xsl:param name=
"content"/>
630 <xsl:variable name=
"lower">abcdefghijklmnopqrstuvwxyz
</xsl:variable>
631 <xsl:variable name=
"upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ
</xsl:variable>
632 <xsl:value-of select=
"translate($content, $upper, $lower)"/>
636 Helpers to convert between day numbers and names.
638 <xsl:template name=
"day-number">
639 <xsl:param name=
"content"/>
640 <xsl:param name=
"name"/>
642 <xsl:when test=
"$name = 'monday'">0</xsl:when>
643 <xsl:when test=
"$name = 'tuesday'">1</xsl:when>
644 <xsl:when test=
"$name = 'wednesday'">2</xsl:when>
645 <xsl:when test=
"$name = 'thursday'">3</xsl:when>
646 <xsl:when test=
"$name = 'friday'">4</xsl:when>
647 <xsl:when test=
"$name = 'saturday'">5</xsl:when>
648 <xsl:when test=
"$name = 'sunday'">6</xsl:when>
652 <xsl:template name=
"day-name">
653 <xsl:param name=
"content"/>
654 <xsl:param name=
"number"/>
656 <xsl:when test=
"$number = '0'">monday
</xsl:when>
657 <xsl:when test=
"$number = '1'">tuesday
</xsl:when>
658 <xsl:when test=
"$number = '2'">wednesday
</xsl:when>
659 <xsl:when test=
"$number = '3'">thursday
</xsl:when>
660 <xsl:when test=
"$number = '4'">friday
</xsl:when>
661 <xsl:when test=
"$number = '5'">saturday
</xsl:when>
662 <xsl:when test=
"$number = '6'">sunday
</xsl:when>
667 Helpers to convert between time in the format 'hhmm' and an integer
668 count of the minutes since midnight.
670 <xsl:template name=
"time-minutes">
671 <xsl:param name=
"content"/>
672 <xsl:param name=
"hhmm"/>
673 <xsl:if test=
"string-length($hhmm) = 4 and format-number($hhmm, '0000') = $hhmm">
674 <xsl:variable name=
"hour" select=
"substring($hhmm, 1, 2)"/>
675 <xsl:variable name=
"min" select=
"substring($hhmm, 3, 2)"/>
676 <xsl:if test=
"$hour >= 0 and $hour < 24 and $min >= 0 and $min < 60">
677 <xsl:value-of select=
"$hour * 60 + $min"/>
682 <xsl:template name=
"time-hhmm">
683 <xsl:param name=
"content"/>
684 <xsl:param name=
"minutes"/>
685 <xsl:value-of select=
"format-number(floor($minutes div 60) * 100 + $minutes mod 60, '0000')"/>
691 <xsl:template name=
"nightly-schedulers">
692 <xsl:param name=
"content"/>
693 <xsl:param name=
"name"/>
694 <xsl:param name=
"day"><day-number name=
"{$name}"/></xsl:param>
695 <xsl:param name=
"hour" select=
"0"/>
696 <xsl:param name=
"minute" select=
"0"/>
697 <xsl:param name=
"step" select=
"30"/>
699 <xsl:if test=
"$hour < 24">
702 <xsl:value-of select=
"concat($name, '_', format-number($hour, '00'), format-number($minute, '00'))"/>
705 <xsl:value-of select=
"$hour"/>
708 <xsl:value-of select=
"$minute"/>
710 <xsl:if test=
"$day != ''">
712 <xsl:value-of select=
"$day"/>
716 <xsl:variable name=
"next" select=
"$hour * 60 + $minute + $step"/>
717 <xsl:call-template name=
"nightly-schedulers">
718 <xsl:with-param name=
"name" select=
"$name"/>
719 <xsl:with-param name=
"day" select=
"$day"/>
720 <xsl:with-param name=
"hour" select=
"floor($next div 60)"/>
721 <xsl:with-param name=
"minute" select=
"$next mod 60"/>
722 <xsl:with-param name=
"step" select=
"$step"/>
728 scheduler - provide default for the <scheduler> build element.
730 <xsl:template name=
"scheduler">
731 <xsl:param name=
"content"/>
732 <xsl:param name=
"previous" select=
"get:property('scheduler', get:preceding-builds()[last()])"/>
733 <xsl:param name=
"step" select=
"60"/>
736 <xsl:when test=
"exsl:node-set($content)/node()">
738 <xsl:copy-of select=
"$content"/>
742 <xsl:for-each select=
"$previous">
743 <xsl:variable name=
"text">
744 <xsl:apply-templates select=
"."/>
747 <scheduler-subst text=
"{$text}" step=
"{$step}"/>
754 <xsl:template name=
"scheduler-subst">
755 <xsl:param name=
"content"/>
756 <xsl:param name=
"text"/>
757 <xsl:param name=
"step"/>
759 <xsl:variable name=
"name" select=
"substring-before($text, '_')"/>
760 <xsl:variable name=
"hhmm" select=
"substring-after($text, '_')"/>
761 <xsl:variable name=
"day"><day-number name=
"{$name}"/></xsl:variable>
762 <xsl:variable name=
"mins"><time-minutes hhmm=
"{$hhmm}"/></xsl:variable>
765 <xsl:when test=
"$mins = ''">
766 <xsl:value-of select=
"$text"/>
768 <xsl:when test=
"$day = ''">
769 <xsl:value-of select=
"$name"/>
770 <xsl:text>_
</xsl:text>
771 <time-hhmm minutes=
"{$mins + $step}"/>
774 <xsl:variable name=
"day-mins" select=
"24 * 60"/>
775 <xsl:variable name=
"week-mins" select=
"7 * $day-mins"/>
776 <xsl:variable name=
"tmp" select=
"($day + 1) * $day-mins + $mins"/>
777 <xsl:variable name=
"next" select=
"$tmp mod $week-mins + floor($tmp div $week-mins) * $step"/>
778 <day-name number=
"{floor($next div $day-mins)}"/>
779 <xsl:text>_
</xsl:text>
780 <time-hhmm minutes=
"{$next mod $day-mins}"/>
786 email - substitute '@' for ' -at- ' in email addresses.
788 <xsl:template name=
"emailfield">
789 <xsl:param name=
"content"/>
790 <xsl:param name=
"addr"/>
791 <xsl:variable name=
"at"> -at-
</xsl:variable>
793 <xsl:when test=
"contains($addr, $at)">
794 <xsl:value-of select=
"substring-before($addr, $at)"/>
795 <xsl:text>@
</xsl:text>
796 <xsl:value-of select=
"substring-after($addr, $at)"/>
799 <xsl:value-of select=
"$addr"/>
804 <xsl:template name=
"email">
805 <xsl:param name=
"content"/>
806 <xsl:param name=
"id"/>
807 <email id=
"{$id}"><emailfield addr=
"{$content}"/></email>
810 <xsl:template name=
"fromaddr">
811 <xsl:param name=
"content"/>
812 <fromaddr><emailfield addr=
"{$content}"/></fromaddr>
815 <xsl:template name=
"extraRecipient">
816 <xsl:param name=
"content"/>
817 <extraRecipient><emailfield addr=
"{$content}"/></extraRecipient>
821 mailnotifier - add a default value for <fromaddr> to <mailnotifier>
823 <xsl:template name=
"mailnotifier">
824 <xsl:param name=
"content"/>
826 <defaults content=
"{$content}">
827 <fromaddr>noreply -at- wxsite.net
</fromaddr>
829 <xsl:copy-of select=
"$content"/>