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'">
230 <xsl:when test=
"$gui = 'true'">utils
</xsl:when>
231 <xsl:otherwise>utils/tex2rtf/src ../../HelpGen/src
</xsl:otherwise>
233 <xsl:text> </xsl:text>
236 <xsl:if test=
"$demos = 'true' and $gui = 'true'">demos
</xsl:if>
238 <xsl:if test=
"$contrib = 'true' and $gui = 'true'">contrib
</xsl:if>
240 <xsl:if test=
"$tests = 'true'">tests
</xsl:if>
244 compile-subdir - build step to compile a subdirectory.
246 Usage: as <compile> plus the following attributes,
247 <compile-subdir dir="foobar" [ halt="true" ]/>
249 Compiles the named subdirectory 'foobar'. Continues with the next build
250 step on failure, unless the optional attibute 'halt="true"' is given.
251 The make command used is as described for the compile step above.
253 <xsl:template name=
"compile-subdir">
254 <xsl:param name=
"content"/>
255 <xsl:param name=
"dir"/>
256 <xsl:param name=
"halt" select=
"'false'"/>
257 <compile-subdirs name=
"{$dir}" dirs=
"{$dir}" halt=
"{$halt}">
258 <xsl:copy-of select=
"$content"/>
263 compile-subdirs - adds a compile build step for each directory in a list.
265 Usage: as <compile> plus the following attributes,
266 <compile-subdir dirs="foobar1 foobar2"
271 Compiles the named subdirectories. Continues with the next build
272 step on failure, unless the optional attibute 'halt="true"' is given.
273 The make command used is as described for the compile step above.
274 The 'name' attribute can be used to give a collective name for the
275 subdirectories, and the 'sep' attibute can be used to specify the
276 separator in the 'dirs' list (defaults to space).
278 <xsl:template name=
"compile-subdirs">
279 <xsl:param name=
"content"/>
280 <xsl:param name=
"name"/>
281 <xsl:param name=
"dirs"/>
282 <xsl:param name=
"sep" select=
"' '"/>
283 <xsl:param name=
"halt" select=
"'false'"/>
284 <xsl:if test=
"translate($dirs, $sep, '')">
286 <defaults content=
"{$content}">
288 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
291 <xsl:value-of select=
"normalize-space(concat('compiling ', $name))"/>
294 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
297 <xsl:value-of select=
"$halt"/>
301 <copy-with-defaults content=
"{$content}">
303 <compile-subdirs-cmd dirs=
"{$dirs}" sep=
"{$sep}"/>
305 </copy-with-defaults>
310 <xsl:template name=
"compile-subdirs-cmd">
311 <xsl:param name=
"content"/>
312 <xsl:param name=
"dirs"/>
313 <xsl:param name=
"sep"/>
315 <xsl:when test=
"contains($dirs, $sep)">
316 <xsl:variable name=
"before" select=
"substring-before($dirs, $sep)"/>
317 <xsl:variable name=
"after" select=
"substring-after($dirs, $sep)"/>
319 <xsl:call-template name=
"compile-subdirs-cmd">
320 <xsl:with-param name=
"dirs" select=
"$before"/>
321 <xsl:with-param name=
"sep" select=
"$sep"/>
324 <xsl:if test=
"$after and substring($after, 1, 1) != ' '">
325 <xsl:text> && </xsl:text>
328 <xsl:call-template name=
"compile-subdirs-cmd">
329 <xsl:with-param name=
"dirs" select=
"$after"/>
330 <xsl:with-param name=
"sep" select=
"$sep"/>
333 <xsl:when test=
"string($dirs)">
334 <xsl:if test=
"$dirs != '.'">cd
<xsl:value-of select=
"$dirs"/> && </xsl:if>
335 <get name=
"make" default=
"make"/>
341 run-tests - build step to run the test suites.
348 <xsl:template name=
"run-tests">
349 <xsl:param name=
"content"/>
350 <xsl:param name=
"options" select=
"'-t'"/>
351 <xsl:param name=
"guioptions" select=
"$options"/>
352 <xsl:param name=
"msw"><is-msw/></xsl:param>
354 <defaults content=
"{$content}">
355 <description>running tests
</description>
356 <descriptionDone>run tests
</descriptionDone>
359 <copy-with-defaults content=
"{$content}">
362 <xsl:when test=
"$msw = 'true'">
363 <run-tests-win options=
"{$options}" guioptions=
"{$guioptions}"/>
366 <run-tests-unix options=
"{$options}" guioptions=
"{$guioptions}"/>
370 </copy-with-defaults>
374 <xsl:template name=
"run-tests-win">
375 <xsl:param name=
"options"/>
376 <xsl:param name=
"guioptions"/>
378 cd tests
&& runtests.bat
382 <xsl:template name=
"run-tests-unix">
383 <xsl:param name=
"options"/>
384 <xsl:param name=
"guioptions"/>
395 if [ -f core -a -x "`which gdb`" ]; then
396 echo Crashed, attempting to display backtrace:
397 gdb -batch -c core -ex 'set pagination off' -ex bt "$
1"
403 try ./test
<xsl:value-of select=
"normalize-space($options)"/>
405 test -x test_gui || exit $ERR
407 if [ -z "$DISPLAY" ]; then
408 echo '$DISPLAY is not set, skipping GUI tests.'
412 echo 'Checking window manager:'
413 WINDOW_MANAGER=$(xprop -root
32x '\n$
0\n' _NET_SUPPORTING_WM_CHECK | grep ^
0x)
415 if [ -z "$WINDOW_MANAGER" ]; then
416 echo 'Window manager not present, skipping GUI tests.'
420 xprop -id $WINDOW_MANAGER
8s _NET_WM_NAME
423 try ./test_gui
<xsl:value-of select=
"normalize-space($guioptions)"/>
429 defaults - supply default content for an element.
431 Usage: <defaults content="{$content}">
436 Copies those child elements that do not already exist in $content.
438 <xsl:template name=
"defaults">
439 <xsl:param name=
"defaults"/>
440 <xsl:param name=
"content"/>
442 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
443 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
445 <xsl:for-each select=
"$def-nodes/*">
446 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
447 <xsl:copy-of select=
"."/>
453 copy-with-defaults - copy elements supplying defaults for any that are
456 Usage: <copy-with-defaults content="{$content}">
459 </copy-with-defaults>
461 Copies $content plus any child elements that do not exist in $content,
462 substituting empty elements in $content with any child elements of the
465 <xsl:template name=
"copy-with-defaults">
466 <xsl:param name=
"defaults"/>
467 <xsl:param name=
"content"/>
469 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
470 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
472 <xsl:for-each select=
"$def-nodes/*">
473 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
474 <xsl:copy-of select=
"."/>
478 <xsl:for-each select=
"$cont-nodes/*">
480 <xsl:when test=
"not(node())">
481 <xsl:copy-of select=
"$def-nodes/*[name() = name(current())]"/>
484 <xsl:copy-of select=
"."/>
491 get - gets the text from a child element of the current build.
493 Usage: <get name="foobar" [ default="value" ]/>
495 Gets the text from the <foobar> element of the current build, or returns
496 $default if there is not such element.
498 <xsl:template name=
"get">
499 <xsl:param name=
"content"/>
500 <xsl:param name=
"build" select=
"get:build()"/>
501 <xsl:param name=
"name"/>
502 <xsl:param name=
"default"/>
503 <xsl:variable name=
"property" select=
"get:property($name, $build)"/>
506 <xsl:when test=
"$property">
507 <xsl:apply-templates select=
"$property/node()"/>
510 <xsl:value-of select=
"$default"/>
517 Accessors to get builds and their fields. XSLT code should use these
518 instead of traversing the input tree directly.
520 <func:function name=
"get:build">
521 <func:result select=
"ancestor-or-self::build[last()]"/>
524 <func:function name=
"get:all-builds">
525 <func:result select=
"//build[not(ancestor::*[name() != name(/*)])]"/>
528 <func:function name=
"get:preceding-builds">
529 <func:result select=
"get:build()/preceding-sibling::build"/>
532 <func:function name=
"get:property">
533 <xsl:param name=
"name"/>
534 <xsl:param name=
"build" select=
"get:build()"/>
535 <func:result select=
"$build/*[name() = $name]"/>
538 <func:function name=
"get:step">
539 <xsl:param name=
"name"/>
540 <xsl:param name=
"build" select=
"get:build()"/>
541 <func:result select=
"get:property('steps', $build)/*[name() = $name]"/>
545 Returns true if this is an msw build.
547 <xsl:template name=
"is-msw">
548 <xsl:param name=
"content"/>
549 <xsl:param name=
"build" select=
"get:build()"/>
550 <xsl:value-of select=
"not(get:step('configure', $build))"/>
554 Returns true if this a gui build.
556 <xsl:template name=
"is-gui">
557 <xsl:param name=
"content"/>
558 <xsl:param name=
"build" select=
"get:build()"/>
559 <xsl:variable name=
"make"><get name=
"make" build=
"{$build}"/></xsl:variable>
560 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
561 <xsl:value-of select=
"not(contains($make, 'USE_GUI=0') or contains($configure, '--disable-gui'))"/>
565 Returns true if the branch we're building has a contrib subdirectory.
567 <xsl:template name=
"has-contrib">
568 <xsl:param name=
"content"/>
569 <xsl:param name=
"build" select=
"get:build()"/>
570 <xsl:variable name=
"checkout"><xsl:apply-templates select=
"get:step('checkout', $build)"/></xsl:variable>
571 <xsl:value-of select=
"contains($checkout, 'WX_2_') and not(contains($checkout, 'WX_2_9_'))"/>
575 Returns true if the build should build the test suite.
577 <xsl:template name=
"has-tests">
578 <xsl:param name=
"content"/>
579 <xsl:param name=
"build" select=
"get:build()"/>
580 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
581 <xsl:value-of select=
"get:step('run-tests', $build) or contains($configure, '--host=')"/>
585 strip - strips leading and trailing whitespace
591 Converts to text and strips leading and trailing whitespace.
593 <xsl:template name=
"strip">
594 <xsl:param name=
"content"/>
595 <xsl:variable name=
"len" select=
"string-length($content)"/>
596 <xsl:variable name=
"norm" select=
"normalize-space($content)"/>
597 <xsl:variable name=
"normlen" select=
"string-length($norm)"/>
599 <xsl:when test=
"substring($content, 1, 1) != substring($norm, 1, 1)">
600 <xsl:call-template name=
"strip">
601 <xsl:with-param name=
"content" select=
"substring($content, 2)"/>
604 <xsl:when test=
"substring($content, $len, 1) != substring($norm, $normlen, 1)">
605 <xsl:call-template name=
"strip">
606 <xsl:with-param name=
"content" select=
"substring($content, 1, $len - 1)"/>
610 <xsl:value-of select=
"$content"/>
616 normalize-space - normalises whitespace.
618 Usage: <normalize-space>
622 Converts to text, strips leading and trailing whitespace and replaces
623 sequences of whitespace characters by a single space.
625 <xsl:template name=
"normalize-space">
626 <xsl:param name=
"content"/>
627 <xsl:value-of select=
"normalize-space($content)"/>
631 lower-case - converts to lower case.
633 Usage: <lower-case>FooBar</lower-case>
635 <xsl:template name=
"lower-case">
636 <xsl:param name=
"content"/>
637 <xsl:variable name=
"lower">abcdefghijklmnopqrstuvwxyz
</xsl:variable>
638 <xsl:variable name=
"upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ
</xsl:variable>
639 <xsl:value-of select=
"translate($content, $upper, $lower)"/>
643 Helpers to convert between day numbers and names.
645 <xsl:template name=
"day-number">
646 <xsl:param name=
"content"/>
647 <xsl:param name=
"name"/>
649 <xsl:when test=
"$name = 'monday'">0</xsl:when>
650 <xsl:when test=
"$name = 'tuesday'">1</xsl:when>
651 <xsl:when test=
"$name = 'wednesday'">2</xsl:when>
652 <xsl:when test=
"$name = 'thursday'">3</xsl:when>
653 <xsl:when test=
"$name = 'friday'">4</xsl:when>
654 <xsl:when test=
"$name = 'saturday'">5</xsl:when>
655 <xsl:when test=
"$name = 'sunday'">6</xsl:when>
659 <xsl:template name=
"day-name">
660 <xsl:param name=
"content"/>
661 <xsl:param name=
"number"/>
663 <xsl:when test=
"$number = '0'">monday
</xsl:when>
664 <xsl:when test=
"$number = '1'">tuesday
</xsl:when>
665 <xsl:when test=
"$number = '2'">wednesday
</xsl:when>
666 <xsl:when test=
"$number = '3'">thursday
</xsl:when>
667 <xsl:when test=
"$number = '4'">friday
</xsl:when>
668 <xsl:when test=
"$number = '5'">saturday
</xsl:when>
669 <xsl:when test=
"$number = '6'">sunday
</xsl:when>
674 Helpers to convert between time in the format 'hhmm' and an integer
675 count of the minutes since midnight.
677 <xsl:template name=
"time-minutes">
678 <xsl:param name=
"content"/>
679 <xsl:param name=
"hhmm"/>
680 <xsl:if test=
"string-length($hhmm) = 4 and format-number($hhmm, '0000') = $hhmm">
681 <xsl:variable name=
"hour" select=
"substring($hhmm, 1, 2)"/>
682 <xsl:variable name=
"min" select=
"substring($hhmm, 3, 2)"/>
683 <xsl:if test=
"$hour >= 0 and $hour < 24 and $min >= 0 and $min < 60">
684 <xsl:value-of select=
"$hour * 60 + $min"/>
689 <xsl:template name=
"time-hhmm">
690 <xsl:param name=
"content"/>
691 <xsl:param name=
"minutes"/>
692 <xsl:value-of select=
"format-number(floor($minutes div 60) * 100 + $minutes mod 60, '0000')"/>
698 <xsl:template name=
"nightly-schedulers">
699 <xsl:param name=
"content"/>
700 <xsl:param name=
"name"/>
701 <xsl:param name=
"day"><day-number name=
"{$name}"/></xsl:param>
702 <xsl:param name=
"hour" select=
"0"/>
703 <xsl:param name=
"minute" select=
"0"/>
704 <xsl:param name=
"step" select=
"30"/>
706 <xsl:if test=
"$hour < 24">
709 <xsl:value-of select=
"concat($name, '_', format-number($hour, '00'), format-number($minute, '00'))"/>
712 <xsl:value-of select=
"$hour"/>
715 <xsl:value-of select=
"$minute"/>
717 <xsl:if test=
"$day != ''">
719 <xsl:value-of select=
"$day"/>
723 <xsl:variable name=
"next" select=
"$hour * 60 + $minute + $step"/>
724 <xsl:call-template name=
"nightly-schedulers">
725 <xsl:with-param name=
"name" select=
"$name"/>
726 <xsl:with-param name=
"day" select=
"$day"/>
727 <xsl:with-param name=
"hour" select=
"floor($next div 60)"/>
728 <xsl:with-param name=
"minute" select=
"$next mod 60"/>
729 <xsl:with-param name=
"step" select=
"$step"/>
735 scheduler - provide default for the <scheduler> build element.
737 <xsl:template name=
"scheduler">
738 <xsl:param name=
"content"/>
739 <xsl:param name=
"previous" select=
"get:property('scheduler', get:preceding-builds()[last()])"/>
740 <xsl:param name=
"step" select=
"60"/>
743 <xsl:when test=
"exsl:node-set($content)/node()">
745 <xsl:copy-of select=
"$content"/>
749 <xsl:for-each select=
"$previous">
750 <xsl:variable name=
"text">
751 <xsl:apply-templates select=
"."/>
754 <scheduler-subst text=
"{$text}" step=
"{$step}"/>
761 <xsl:template name=
"scheduler-subst">
762 <xsl:param name=
"content"/>
763 <xsl:param name=
"text"/>
764 <xsl:param name=
"step"/>
766 <xsl:variable name=
"name" select=
"substring-before($text, '_')"/>
767 <xsl:variable name=
"hhmm" select=
"substring-after($text, '_')"/>
768 <xsl:variable name=
"day"><day-number name=
"{$name}"/></xsl:variable>
769 <xsl:variable name=
"mins"><time-minutes hhmm=
"{$hhmm}"/></xsl:variable>
772 <xsl:when test=
"$mins = ''">
773 <xsl:value-of select=
"$text"/>
775 <xsl:when test=
"$day = ''">
776 <xsl:value-of select=
"$name"/>
777 <xsl:text>_
</xsl:text>
778 <time-hhmm minutes=
"{$mins + $step}"/>
781 <xsl:variable name=
"day-mins" select=
"24 * 60"/>
782 <xsl:variable name=
"week-mins" select=
"7 * $day-mins"/>
783 <xsl:variable name=
"tmp" select=
"($day + 1) * $day-mins + $mins"/>
784 <xsl:variable name=
"next" select=
"$tmp mod $week-mins + floor($tmp div $week-mins) * $step"/>
785 <day-name number=
"{floor($next div $day-mins)}"/>
786 <xsl:text>_
</xsl:text>
787 <time-hhmm minutes=
"{$next mod $day-mins}"/>
793 email - substitute '@' for ' -at- ' in email addresses.
795 <xsl:template name=
"emailfield">
796 <xsl:param name=
"content"/>
797 <xsl:param name=
"addr"/>
798 <xsl:variable name=
"at"> -at-
</xsl:variable>
800 <xsl:when test=
"contains($addr, $at)">
801 <xsl:value-of select=
"substring-before($addr, $at)"/>
802 <xsl:text>@
</xsl:text>
803 <xsl:value-of select=
"substring-after($addr, $at)"/>
806 <xsl:value-of select=
"$addr"/>
811 <xsl:template name=
"email">
812 <xsl:param name=
"content"/>
813 <xsl:param name=
"id"/>
814 <email id=
"{$id}"><emailfield addr=
"{$content}"/></email>
817 <xsl:template name=
"fromaddr">
818 <xsl:param name=
"content"/>
819 <fromaddr><emailfield addr=
"{$content}"/></fromaddr>
822 <xsl:template name=
"extraRecipient">
823 <xsl:param name=
"content"/>
824 <extraRecipient><emailfield addr=
"{$content}"/></extraRecipient>
828 mailnotifier - add a default value for <fromaddr> to <mailnotifier>
830 <xsl:template name=
"mailnotifier">
831 <xsl:param name=
"content"/>
833 <defaults content=
"{$content}">
834 <fromaddr>noreply -at- wxsite.net
</fromaddr>
836 <xsl:copy-of select=
"$content"/>