1 <?xml version=
"1.0" encoding=
"utf-8"?>
5 Purpose: Common declarations for buildbot
8 Copyright: (c) 2007 Mike Wetherell
9 Licence: wxWindows licence
12 <bot xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
13 xmlns:
exsl=
"http://exslt.org/common"
14 xmlns:
func=
"http://exslt.org/functions"
16 xsl:
extension-element-prefixes=
"func"
22 <xsl:template name=
"SVN_URL">http://svn.wxwidgets.org/svn/wx/wxWidgets/
</xsl:template>
23 <xsl:template name=
"STABLE_BRANCH">branches/WX_2_8_BRANCH
</xsl:template>
24 <xsl:variable name=
"STABLE_BRANCH"><STABLE_BRANCH/></xsl:variable>
25 <xsl:template name=
"RELEASE_BRANCH">branches/WX_2_9_0_BRANCH
</xsl:template>
26 <xsl:variable name=
"RELEASE_BRANCH"><RELEASE_BRANCH/></xsl:variable>
27 <xsl:template name=
"SNAPSHOT_URL">http://biolpc22.york.ac.uk/pub
</xsl:template>
30 disable - comment out a section.
36 XML comments can't contain a double hyphen which tends to be used in
37 configure commands, so <disable> can be used instead.
39 <xsl:template name=
"disable"/>
42 checkout - build step for source checkout.
44 Usage: as <svn> with defaults for <baseURL> and <defaultBranch>
49 <checkout branch="branches/WX_2_8_BRANCH"/>
52 <xsl:template name=
"checkout">
53 <xsl:param name=
"content"/>
54 <xsl:param name=
"branch" select=
"'trunk'"/>
55 <xsl:variable name=
"nodes" select=
"exsl:node-set($content)"/>
57 <xsl:if test=
"not($nodes/svnurl)">
58 <xsl:if test=
"not($nodes/baseURL)">
59 <baseURL><SVN_URL/></baseURL>
61 <xsl:if test=
"not($nodes/defaultBranch)">
62 <defaultBranch><xsl:value-of select=
"$branch"/></defaultBranch>
65 <xsl:copy-of select=
"$content"/>
70 configure - add the options attribute to <configure>
72 Usage: <configure options="-with-foobar"/>
74 <xsl:template name=
"configure">
75 <xsl:param name=
"content"/>
76 <xsl:param name=
"options"/>
78 <copy-with-defaults content=
"{$content}">
79 <command>./configure
<xsl:value-of select=
"normalize-space($options)"/></command>
85 make - specify the make command.
87 Usage: <make>nmake -f makefile.vc SHARED=1</make>
89 Used as a child of <build> to specify the make command used by the
90 <compile> elements below, if omitted 'make' is used.
92 <xsl:template name=
"make"/>
95 compile - modifiy <compile> to default to the command given by <make>
99 The <make> element of <build> spcecifies the make command used by all
100 compile build steps in the build. If <make> is not given 'make' is used.
102 The command for a particular compile build step can be further overridden
103 using its <command> element:
105 <command>myscript</command>
108 <xsl:template name=
"compile">
109 <xsl:param name=
"content"/>
111 <copy-with-defaults content=
"{$content}">
112 <command><get name=
"make" default=
"make"/></command>
113 </copy-with-defaults>
118 Adds build steps to compile the library and the usual subdirectories.
120 Usage: as <compile> with the additional attributes below.
122 Usually the attributes default to suitable values, so typical usage
123 is just <compile-all/>.
125 <compile-all [ gui = 'true'|'false' ]
126 [ msw = 'true'|'false' ]
127 [ wx = 'true'|'false' ]
128 [ samples = 'true'|'false' ]
129 [ utils = 'true'|'false' ]
130 [ demos = 'true'|'false' ]
131 [ contrib = 'true'|'false' ]
132 [ tests = 'true'|'false' ] />
134 gui - if 'true' then build fully the subdirectories specified,
135 otherwise only the wxBase subset of the directories are built.
136 msw - if 'true' then build the directory 'build/msw' when building the
137 library instead of the root.
138 wx - build the library itself.
139 samples, utils, demos, contrib, tests
140 - build subdirectories.
142 <xsl:template name=
"compile-all">
143 <xsl:param name=
"content"/>
145 <xsl:param name=
"gui"><is-gui/></xsl:param>
146 <xsl:param name=
"msw"><is-msw/></xsl:param>
148 <xsl:param name=
"wx" select=
"'true'"/>
149 <xsl:param name=
"samples" select=
"'true'"/>
150 <xsl:param name=
"utils" select=
"'true'"/>
151 <xsl:param name=
"demos" select=
"$gui"/>
152 <xsl:param name=
"contrib"><has-contrib/></xsl:param>
153 <xsl:param name=
"tests"><has-tests/></xsl:param>
155 <xsl:param name=
"wx-dirs">
156 <get-dirs wx=
"{$wx}" gui=
"{$gui}" msw=
"{$msw}"/>
158 <xsl:param name=
"sample-dirs">
159 <get-dirs samples=
"{$samples}" gui=
"{$gui}" msw=
"{$msw}"/>
161 <xsl:param name=
"util-dirs">
162 <get-dirs utils=
"{$utils}" gui=
"{$gui}" msw=
"{$msw}"/>
164 <xsl:param name=
"demo-dirs">
165 <get-dirs demos=
"{$demos}" gui=
"{$gui}" msw=
"{$msw}"/>
167 <xsl:param name=
"contrib-dirs">
168 <get-dirs contrib=
"{$contrib}" gui=
"{$gui}" msw=
"{$msw}"/>
170 <xsl:param name=
"test-dirs">
171 <get-dirs tests=
"{$tests}" gui=
"{$gui}" msw=
"{$msw}"/>
174 <compile-subdirs dirs=
"{$wx-dirs}" halt=
"true">
175 <xsl:copy-of select=
"$content"/>
177 <compile-subdirs name=
"samples" dirs=
"{$sample-dirs}">
178 <xsl:copy-of select=
"$content"/>
180 <compile-subdirs name=
"utils" dirs=
"{$util-dirs}">
181 <xsl:copy-of select=
"$content"/>
183 <compile-subdirs name=
"demos" dirs=
"{$demo-dirs}">
184 <xsl:copy-of select=
"$content"/>
186 <compile-subdirs name=
"contrib" dirs=
"{$contrib-dirs}">
187 <xsl:copy-of select=
"$content"/>
189 <compile-subdirs name=
"tests" dirs=
"{$test-dirs}" halt=
"true">
190 <xsl:copy-of select=
"$content"/>
195 Helper for compile-all.
196 Returns the directories that need to be built for the various components:
197 wx (the library itself), samples, utils, demos, contrib and tests.
199 <xsl:template name=
"get-dirs">
200 <xsl:param name=
"contents"/>
202 <xsl:param name=
"gui"/>
203 <xsl:param name=
"msw"/>
205 <xsl:param name=
"wx"/>
206 <xsl:param name=
"samples"/>
207 <xsl:param name=
"utils"/>
208 <xsl:param name=
"demos"/>
209 <xsl:param name=
"contrib"/>
210 <xsl:param name=
"tests"/>
212 <xsl:if test=
"$wx = 'true'">
214 <xsl:when test=
"$msw = 'true'">build/msw
</xsl:when>
215 <xsl:otherwise>.
</xsl:otherwise>
217 <xsl:text> </xsl:text>
220 <xsl:if test=
"$samples = 'true'">
222 <xsl:when test=
"$gui = 'true'">samples
</xsl:when>
223 <xsl:otherwise>samples/console
</xsl:otherwise>
225 <xsl:text> </xsl:text>
228 <xsl:if test=
"$utils = 'true' and $gui = 'true'">utils
</xsl:if>
230 <xsl:if test=
"$demos = 'true' and $gui = 'true'">demos
</xsl:if>
232 <xsl:if test=
"$contrib = 'true' and $gui = 'true'">contrib
</xsl:if>
234 <xsl:if test=
"$tests = 'true'">tests
</xsl:if>
238 compile-subdir - build step to compile a subdirectory.
240 Usage: as <compile> plus the following attributes,
241 <compile-subdir dir="foobar" [ halt="true" ]/>
243 Compiles the named subdirectory 'foobar'. Continues with the next build
244 step on failure, unless the optional attibute 'halt="true"' is given.
245 The make command used is as described for the compile step above.
247 <xsl:template name=
"compile-subdir">
248 <xsl:param name=
"content"/>
249 <xsl:param name=
"dir"/>
250 <xsl:param name=
"halt" select=
"'false'"/>
251 <compile-subdirs name=
"{$dir}" dirs=
"{$dir}" halt=
"{$halt}">
252 <xsl:copy-of select=
"$content"/>
257 compile-subdirs - adds a compile build step for each directory in a list.
259 Usage: as <compile> plus the following attributes,
260 <compile-subdir dirs="foobar1 foobar2"
265 Compiles the named subdirectories. Continues with the next build
266 step on failure, unless the optional attibute 'halt="true"' is given.
267 The make command used is as described for the compile step above.
268 The 'name' attribute can be used to give a collective name for the
269 subdirectories, and the 'sep' attibute can be used to specify the
270 separator in the 'dirs' list (defaults to space).
272 <xsl:template name=
"compile-subdirs">
273 <xsl:param name=
"content"/>
274 <xsl:param name=
"name"/>
275 <xsl:param name=
"dirs"/>
276 <xsl:param name=
"sep" select=
"' '"/>
277 <xsl:param name=
"halt" select=
"'false'"/>
278 <xsl:if test=
"translate($dirs, $sep, '')">
280 <defaults content=
"{$content}">
282 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
285 <xsl:value-of select=
"normalize-space(concat('compiling ', $name))"/>
288 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
291 <xsl:value-of select=
"$halt"/>
295 <copy-with-defaults content=
"{$content}">
297 <compile-subdirs-cmd dirs=
"{$dirs}" sep=
"{$sep}"/>
299 </copy-with-defaults>
304 <xsl:template name=
"compile-subdirs-cmd">
305 <xsl:param name=
"content"/>
306 <xsl:param name=
"dirs"/>
307 <xsl:param name=
"sep"/>
309 <xsl:when test=
"contains($dirs, $sep)">
310 <xsl:variable name=
"before" select=
"substring-before($dirs, $sep)"/>
311 <xsl:variable name=
"after" select=
"substring-after($dirs, $sep)"/>
313 <xsl:call-template name=
"compile-subdirs-cmd">
314 <xsl:with-param name=
"dirs" select=
"$before"/>
315 <xsl:with-param name=
"sep" select=
"$sep"/>
318 <xsl:if test=
"$after and substring($after, 1, 1) != ' '">
319 <xsl:text> && </xsl:text>
322 <xsl:call-template name=
"compile-subdirs-cmd">
323 <xsl:with-param name=
"dirs" select=
"$after"/>
324 <xsl:with-param name=
"sep" select=
"$sep"/>
327 <xsl:when test=
"string($dirs)">
328 <xsl:if test=
"$dirs != '.'">cd
<xsl:value-of select=
"$dirs"/> && </xsl:if>
329 <get name=
"make" default=
"make"/>
335 run-tests - build step to run the test suites.
342 <xsl:template name=
"run-tests">
343 <xsl:param name=
"content"/>
344 <xsl:param name=
"options" select=
"'-t'"/>
345 <xsl:param name=
"guioptions" select=
"$options"/>
346 <xsl:param name=
"msw"><is-msw/></xsl:param>
348 <defaults content=
"{$content}">
349 <description>running tests
</description>
350 <descriptionDone>run tests
</descriptionDone>
353 <copy-with-defaults content=
"{$content}">
356 <xsl:when test=
"$msw = 'true'">
357 <run-tests-win options=
"{$options}" guioptions=
"{$guioptions}"/>
360 <run-tests-unix options=
"{$options}" guioptions=
"{$guioptions}"/>
364 </copy-with-defaults>
368 <xsl:template name=
"run-tests-win">
369 <xsl:param name=
"options"/>
370 <xsl:param name=
"guioptions"/>
372 cd tests
&& runtests.bat
376 <xsl:template name=
"run-tests-unix">
377 <xsl:param name=
"options"/>
378 <xsl:param name=
"guioptions"/>
389 if [ -f core -a -x "`which gdb`" ]; then
390 echo Crashed, attempting to display backtrace:
391 gdb -batch -c core -ex 'set pagination off' -ex bt "$
1"
397 try ./test
<xsl:value-of select=
"normalize-space($options)"/>
399 test -x test_gui || exit $ERR
401 if [ -z "$DISPLAY" ]; then
402 echo '$DISPLAY is not set, skipping GUI tests.'
406 echo 'Checking window manager:'
407 WINDOW_MANAGER=$(xprop -root
32x '\n$
0\n' _NET_SUPPORTING_WM_CHECK | grep ^
0x)
409 if [ -z "$WINDOW_MANAGER" ]; then
410 echo 'Window manager not present, skipping GUI tests.'
414 xprop -id $WINDOW_MANAGER
8s _NET_WM_NAME
417 try ./test_gui
<xsl:value-of select=
"normalize-space($guioptions)"/>
423 defaults - supply default content for an element.
425 Usage: <defaults content="{$content}">
430 Copies those child elements that do not already exist in $content.
432 <xsl:template name=
"defaults">
433 <xsl:param name=
"defaults"/>
434 <xsl:param name=
"content"/>
436 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
437 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
439 <xsl:for-each select=
"$def-nodes/*">
440 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
441 <xsl:copy-of select=
"."/>
447 copy-with-defaults - copy elements supplying defaults for any that are
450 Usage: <copy-with-defaults content="{$content}">
453 </copy-with-defaults>
455 Copies $content plus any child elements that do not exist in $content,
456 substituting empty elements in $content with any child elements of the
459 <xsl:template name=
"copy-with-defaults">
460 <xsl:param name=
"defaults"/>
461 <xsl:param name=
"content"/>
463 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
464 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
466 <xsl:for-each select=
"$def-nodes/*">
467 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
468 <xsl:copy-of select=
"."/>
472 <xsl:for-each select=
"$cont-nodes/*">
474 <xsl:when test=
"not(node())">
475 <xsl:copy-of select=
"$def-nodes/*[name() = name(current())]"/>
478 <xsl:copy-of select=
"."/>
485 get - gets the text from a child element of the current build.
487 Usage: <get name="foobar" [ default="value" ]/>
489 Gets the text from the <foobar> element of the current build, or returns
490 $default if there is not such element.
492 <xsl:template name=
"get">
493 <xsl:param name=
"content"/>
494 <xsl:param name=
"build" select=
"get:build()"/>
495 <xsl:param name=
"name"/>
496 <xsl:param name=
"default"/>
497 <xsl:variable name=
"property" select=
"get:property($name, $build)"/>
500 <xsl:when test=
"$property">
501 <xsl:apply-templates select=
"$property/node()"/>
504 <xsl:value-of select=
"$default"/>
511 Accessors to get builds and their fields. XSLT code should use these
512 instead of traversing the input tree directly.
514 <func:function name=
"get:build">
515 <func:result select=
"ancestor-or-self::build[last()]"/>
518 <func:function name=
"get:all-builds">
519 <func:result select=
"//build[not(ancestor::*[name() != name(/*)])]"/>
522 <func:function name=
"get:preceding-builds">
523 <func:result select=
"get:build()/preceding-sibling::build"/>
526 <func:function name=
"get:property">
527 <xsl:param name=
"name"/>
528 <xsl:param name=
"build" select=
"get:build()"/>
529 <func:result select=
"$build/*[name() = $name]"/>
532 <func:function name=
"get:step">
533 <xsl:param name=
"name"/>
534 <xsl:param name=
"build" select=
"get:build()"/>
535 <func:result select=
"get:property('steps', $build)/*[name() = $name]"/>
539 Returns true if this is an msw build.
541 <xsl:template name=
"is-msw">
542 <xsl:param name=
"content"/>
543 <xsl:param name=
"build" select=
"get:build()"/>
544 <xsl:value-of select=
"not(get:step('configure', $build))"/>
548 Returns true if this a gui build.
550 <xsl:template name=
"is-gui">
551 <xsl:param name=
"content"/>
552 <xsl:param name=
"build" select=
"get:build()"/>
553 <xsl:variable name=
"make"><get name=
"make" build=
"{$build}"/></xsl:variable>
554 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
555 <xsl:value-of select=
"not(contains($make, 'USE_GUI=0') or contains($configure, '--disable-gui'))"/>
559 Returns true if the branch we're building has a contrib subdirectory.
561 <xsl:template name=
"has-contrib">
562 <xsl:param name=
"content"/>
563 <xsl:param name=
"build" select=
"get:build()"/>
564 <xsl:variable name=
"checkout"><xsl:apply-templates select=
"get:step('checkout', $build)"/></xsl:variable>
565 <xsl:value-of select=
"contains($checkout, 'WX_2_') and not(contains($checkout, 'WX_2_9_'))"/>
569 Returns true if the build should build the test suite.
571 <xsl:template name=
"has-tests">
572 <xsl:param name=
"content"/>
573 <xsl:param name=
"build" select=
"get:build()"/>
574 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
575 <xsl:value-of select=
"get:step('run-tests', $build) or contains($configure, '--host=')"/>
579 strip - strips leading and trailing whitespace
585 Converts to text and strips leading and trailing whitespace.
587 <xsl:template name=
"strip">
588 <xsl:param name=
"content"/>
589 <xsl:variable name=
"len" select=
"string-length($content)"/>
590 <xsl:variable name=
"norm" select=
"normalize-space($content)"/>
591 <xsl:variable name=
"normlen" select=
"string-length($norm)"/>
593 <xsl:when test=
"substring($content, 1, 1) != substring($norm, 1, 1)">
594 <xsl:call-template name=
"strip">
595 <xsl:with-param name=
"content" select=
"substring($content, 2)"/>
598 <xsl:when test=
"substring($content, $len, 1) != substring($norm, $normlen, 1)">
599 <xsl:call-template name=
"strip">
600 <xsl:with-param name=
"content" select=
"substring($content, 1, $len - 1)"/>
604 <xsl:value-of select=
"$content"/>
610 normalize-space - normalises whitespace.
612 Usage: <normalize-space>
616 Converts to text, strips leading and trailing whitespace and replaces
617 sequences of whitespace characters by a single space.
619 <xsl:template name=
"normalize-space">
620 <xsl:param name=
"content"/>
621 <xsl:value-of select=
"normalize-space($content)"/>
625 lower-case - converts to lower case.
627 Usage: <lower-case>FooBar</lower-case>
629 <xsl:template name=
"lower-case">
630 <xsl:param name=
"content"/>
631 <xsl:variable name=
"lower">abcdefghijklmnopqrstuvwxyz
</xsl:variable>
632 <xsl:variable name=
"upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ
</xsl:variable>
633 <xsl:value-of select=
"translate($content, $upper, $lower)"/>
637 Helpers to convert between day numbers and names.
639 <xsl:template name=
"day-number">
640 <xsl:param name=
"content"/>
641 <xsl:param name=
"name"/>
643 <xsl:when test=
"$name = 'monday'">0</xsl:when>
644 <xsl:when test=
"$name = 'tuesday'">1</xsl:when>
645 <xsl:when test=
"$name = 'wednesday'">2</xsl:when>
646 <xsl:when test=
"$name = 'thursday'">3</xsl:when>
647 <xsl:when test=
"$name = 'friday'">4</xsl:when>
648 <xsl:when test=
"$name = 'saturday'">5</xsl:when>
649 <xsl:when test=
"$name = 'sunday'">6</xsl:when>
653 <xsl:template name=
"day-name">
654 <xsl:param name=
"content"/>
655 <xsl:param name=
"number"/>
657 <xsl:when test=
"$number = '0'">monday
</xsl:when>
658 <xsl:when test=
"$number = '1'">tuesday
</xsl:when>
659 <xsl:when test=
"$number = '2'">wednesday
</xsl:when>
660 <xsl:when test=
"$number = '3'">thursday
</xsl:when>
661 <xsl:when test=
"$number = '4'">friday
</xsl:when>
662 <xsl:when test=
"$number = '5'">saturday
</xsl:when>
663 <xsl:when test=
"$number = '6'">sunday
</xsl:when>
668 Helpers to convert between time in the format 'hhmm' and an integer
669 count of the minutes since midnight.
671 <xsl:template name=
"time-minutes">
672 <xsl:param name=
"content"/>
673 <xsl:param name=
"hhmm"/>
674 <xsl:if test=
"string-length($hhmm) = 4 and format-number($hhmm, '0000') = $hhmm">
675 <xsl:variable name=
"hour" select=
"substring($hhmm, 1, 2)"/>
676 <xsl:variable name=
"min" select=
"substring($hhmm, 3, 2)"/>
677 <xsl:if test=
"$hour >= 0 and $hour < 24 and $min >= 0 and $min < 60">
678 <xsl:value-of select=
"$hour * 60 + $min"/>
683 <xsl:template name=
"time-hhmm">
684 <xsl:param name=
"content"/>
685 <xsl:param name=
"minutes"/>
686 <xsl:value-of select=
"format-number(floor($minutes div 60) * 100 + $minutes mod 60, '0000')"/>
692 <xsl:template name=
"nightly-schedulers">
693 <xsl:param name=
"content"/>
694 <xsl:param name=
"name"/>
695 <xsl:param name=
"day"><day-number name=
"{$name}"/></xsl:param>
696 <xsl:param name=
"hour" select=
"0"/>
697 <xsl:param name=
"minute" select=
"0"/>
698 <xsl:param name=
"step" select=
"30"/>
700 <xsl:if test=
"$hour < 24">
703 <xsl:value-of select=
"concat($name, '_', format-number($hour, '00'), format-number($minute, '00'))"/>
706 <xsl:value-of select=
"$hour"/>
709 <xsl:value-of select=
"$minute"/>
711 <xsl:if test=
"$day != ''">
713 <xsl:value-of select=
"$day"/>
717 <xsl:variable name=
"next" select=
"$hour * 60 + $minute + $step"/>
718 <xsl:call-template name=
"nightly-schedulers">
719 <xsl:with-param name=
"name" select=
"$name"/>
720 <xsl:with-param name=
"day" select=
"$day"/>
721 <xsl:with-param name=
"hour" select=
"floor($next div 60)"/>
722 <xsl:with-param name=
"minute" select=
"$next mod 60"/>
723 <xsl:with-param name=
"step" select=
"$step"/>
729 scheduler - provide default for the <scheduler> build element.
731 <xsl:template name=
"scheduler">
732 <xsl:param name=
"content"/>
733 <xsl:param name=
"previous" select=
"get:property('scheduler', get:preceding-builds()[last()])"/>
734 <xsl:param name=
"step" select=
"60"/>
737 <xsl:when test=
"exsl:node-set($content)/node()">
739 <xsl:copy-of select=
"$content"/>
743 <xsl:for-each select=
"$previous">
744 <xsl:variable name=
"text">
745 <xsl:apply-templates select=
"."/>
748 <scheduler-subst text=
"{$text}" step=
"{$step}"/>
755 <xsl:template name=
"scheduler-subst">
756 <xsl:param name=
"content"/>
757 <xsl:param name=
"text"/>
758 <xsl:param name=
"step"/>
760 <xsl:variable name=
"name" select=
"substring-before($text, '_')"/>
761 <xsl:variable name=
"hhmm" select=
"substring-after($text, '_')"/>
762 <xsl:variable name=
"day"><day-number name=
"{$name}"/></xsl:variable>
763 <xsl:variable name=
"mins"><time-minutes hhmm=
"{$hhmm}"/></xsl:variable>
766 <xsl:when test=
"$mins = ''">
767 <xsl:value-of select=
"$text"/>
769 <xsl:when test=
"$day = ''">
770 <xsl:value-of select=
"$name"/>
771 <xsl:text>_
</xsl:text>
772 <time-hhmm minutes=
"{$mins + $step}"/>
775 <xsl:variable name=
"day-mins" select=
"24 * 60"/>
776 <xsl:variable name=
"week-mins" select=
"7 * $day-mins"/>
777 <xsl:variable name=
"tmp" select=
"($day + 1) * $day-mins + $mins"/>
778 <xsl:variable name=
"next" select=
"$tmp mod $week-mins + floor($tmp div $week-mins) * $step"/>
779 <day-name number=
"{floor($next div $day-mins)}"/>
780 <xsl:text>_
</xsl:text>
781 <time-hhmm minutes=
"{$next mod $day-mins}"/>
787 email - substitute '@' for ' -at- ' in email addresses.
789 <xsl:template name=
"emailfield">
790 <xsl:param name=
"content"/>
791 <xsl:param name=
"addr"/>
792 <xsl:variable name=
"at"> -at-
</xsl:variable>
794 <xsl:when test=
"contains($addr, $at)">
795 <xsl:value-of select=
"substring-before($addr, $at)"/>
796 <xsl:text>@
</xsl:text>
797 <xsl:value-of select=
"substring-after($addr, $at)"/>
800 <xsl:value-of select=
"$addr"/>
805 <xsl:template name=
"email">
806 <xsl:param name=
"content"/>
807 <xsl:param name=
"id"/>
808 <email id=
"{$id}"><emailfield addr=
"{$content}"/></email>
811 <xsl:template name=
"fromaddr">
812 <xsl:param name=
"content"/>
813 <fromaddr><emailfield addr=
"{$content}"/></fromaddr>
816 <xsl:template name=
"extraRecipient">
817 <xsl:param name=
"content"/>
818 <extraRecipient><emailfield addr=
"{$content}"/></extraRecipient>
822 mailnotifier - add a default value for <fromaddr> to <mailnotifier>
824 <xsl:template name=
"mailnotifier">
825 <xsl:param name=
"content"/>
827 <defaults content=
"{$content}">
828 <fromaddr>noreply -at- wxsite.net
</fromaddr>
830 <xsl:copy-of select=
"$content"/>