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 checkout - build step for source checkout.
32 Usage: as <svn> with defaults for <baseURL> and <defaultBranch>
37 <checkout branch="branches/WX_2_8_BRANCH"/>
40 <xsl:template name=
"checkout">
41 <xsl:param name=
"content"/>
42 <xsl:param name=
"branch" select=
"'trunk'"/>
43 <xsl:variable name=
"nodes" select=
"exsl:node-set($content)"/>
45 <xsl:if test=
"not($nodes/svnurl)">
46 <xsl:if test=
"not($nodes/baseURL)">
47 <baseURL><SVN_URL/></baseURL>
49 <xsl:if test=
"not($nodes/defaultBranch)">
50 <defaultBranch><xsl:value-of select=
"$branch"/></defaultBranch>
53 <xsl:copy-of select=
"$content"/>
58 configure - add the options attribute to <configure>
60 Usage: <configure options="-with-foobar"/>
62 <xsl:template name=
"configure">
63 <xsl:param name=
"content"/>
64 <xsl:param name=
"options"/>
66 <copy-with-defaults content=
"{$content}">
67 <command>./configure
<xsl:value-of select=
"normalize-space($options)"/></command>
73 make - specify the make command.
75 Usage: <make>nmake -f makefile.vc SHARED=1</make>
77 Used as a child of <build> to specify the make command used by the
78 <compile> elements below, if omitted 'make' is used.
80 <xsl:template name=
"make"/>
83 compile - modifiy <compile> to default to the command given by <make>
87 The <make> element of <build> spcecifies the make command used by all
88 compile build steps in the build. If <make> is not given 'make' is used.
90 The command for a particular compile build step can be further overridden
91 using its <command> element:
93 <command>myscript</command>
96 <xsl:template name=
"compile">
97 <xsl:param name=
"content"/>
99 <copy-with-defaults content=
"{$content}">
100 <command><get name=
"make" default=
"make"/></command>
101 </copy-with-defaults>
106 Adds build steps to compile the library and the usual subdirectories.
108 Usage: as <compile> with the additional attributes below.
110 Usually the attributes default to suitable values, so typical usage
111 is just <compile-all/>.
113 <compile-all [ gui = 'true'|'false' ]
114 [ msw = 'true'|'false' ]
115 [ wx = 'true'|'false' ]
116 [ samples = 'true'|'false' ]
117 [ utils = 'true'|'false' ]
118 [ demos = 'true'|'false' ]
119 [ contrib = 'true'|'false' ]
120 [ tests = 'true'|'false' ] />
122 gui - if 'true' then build fully the subdirectories specified,
123 otherwise only the wxBase subset of the directories are built.
124 msw - if 'true' then build the directory 'build/msw' when building the
125 library instead of the root.
126 wx - build the library itself.
127 samples, utils, demos, contrib, tests
128 - build subdirectories.
130 <xsl:template name=
"compile-all">
131 <xsl:param name=
"content"/>
133 <xsl:param name=
"gui"><is-gui/></xsl:param>
134 <xsl:param name=
"msw"><is-msw/></xsl:param>
136 <xsl:param name=
"wx" select=
"'true'"/>
137 <xsl:param name=
"samples" select=
"'true'"/>
138 <xsl:param name=
"utils" select=
"'true'"/>
139 <xsl:param name=
"demos" select=
"$gui"/>
140 <xsl:param name=
"contrib"><has-contrib/></xsl:param>
141 <xsl:param name=
"tests"><has-tests/></xsl:param>
143 <xsl:param name=
"wx-dirs">
144 <get-dirs wx=
"{$wx}" gui=
"{$gui}" msw=
"{$msw}"/>
146 <xsl:param name=
"sample-dirs">
147 <get-dirs samples=
"{$samples}" gui=
"{$gui}" msw=
"{$msw}"/>
149 <xsl:param name=
"util-dirs">
150 <get-dirs utils=
"{$utils}" gui=
"{$gui}" msw=
"{$msw}"/>
152 <xsl:param name=
"demo-dirs">
153 <get-dirs demos=
"{$demos}" gui=
"{$gui}" msw=
"{$msw}"/>
155 <xsl:param name=
"contrib-dirs">
156 <get-dirs contrib=
"{$contrib}" gui=
"{$gui}" msw=
"{$msw}"/>
158 <xsl:param name=
"test-dirs">
159 <get-dirs tests=
"{$tests}" gui=
"{$gui}" msw=
"{$msw}"/>
162 <compile-subdirs dirs=
"{$wx-dirs}" halt=
"true">
163 <xsl:copy-of select=
"$content"/>
165 <compile-subdirs name=
"samples" dirs=
"{$sample-dirs}">
166 <xsl:copy-of select=
"$content"/>
168 <compile-subdirs name=
"utils" dirs=
"{$util-dirs}">
169 <xsl:copy-of select=
"$content"/>
171 <compile-subdirs name=
"demos" dirs=
"{$demo-dirs}">
172 <xsl:copy-of select=
"$content"/>
174 <compile-subdirs name=
"contrib" dirs=
"{$contrib-dirs}">
175 <xsl:copy-of select=
"$content"/>
177 <compile-subdirs name=
"tests" dirs=
"{$test-dirs}" halt=
"true">
178 <xsl:copy-of select=
"$content"/>
183 Helper for compile-all.
184 Returns the directories that need to be built for the various components:
185 wx (the library itself), samples, utils, demos, contrib and tests.
187 <xsl:template name=
"get-dirs">
188 <xsl:param name=
"contents"/>
190 <xsl:param name=
"gui"/>
191 <xsl:param name=
"msw"/>
193 <xsl:param name=
"wx"/>
194 <xsl:param name=
"samples"/>
195 <xsl:param name=
"utils"/>
196 <xsl:param name=
"demos"/>
197 <xsl:param name=
"contrib"/>
198 <xsl:param name=
"tests"/>
200 <xsl:if test=
"$wx = 'true'">
202 <xsl:when test=
"$msw = 'true'">build/msw
</xsl:when>
203 <xsl:otherwise>.
</xsl:otherwise>
205 <xsl:text> </xsl:text>
208 <xsl:if test=
"$samples = 'true'">
210 <xsl:when test=
"$gui = 'true'">samples
</xsl:when>
211 <xsl:otherwise>samples/console
</xsl:otherwise>
213 <xsl:text> </xsl:text>
216 <xsl:if test=
"$utils = 'true'">
218 <xsl:when test=
"$gui = 'true'">utils
</xsl:when>
219 <xsl:otherwise>utils/tex2rtf/src ../../HelpGen/src
</xsl:otherwise>
221 <xsl:text> </xsl:text>
224 <xsl:if test=
"$demos = 'true' and $gui = 'true'">demos
</xsl:if>
226 <xsl:if test=
"$contrib = 'true' and $gui = 'true'">contrib
</xsl:if>
228 <xsl:if test=
"$tests = 'true'">tests
</xsl:if>
232 compile-subdir - build step to compile a subdirectory.
234 Usage: as <compile> plus the following attributes,
235 <compile-subdir dir="foobar" [ halt="true" ]/>
237 Compiles the named subdirectory 'foobar'. Continues with the next build
238 step on failure, unless the optional attibute 'halt="true"' is given.
239 The make command used is as described for the compile step above.
241 <xsl:template name=
"compile-subdir">
242 <xsl:param name=
"content"/>
243 <xsl:param name=
"dir"/>
244 <xsl:param name=
"halt" select=
"'false'"/>
245 <compile-subdirs name=
"{$dir}" dirs=
"{$dir}" halt=
"{$halt}">
246 <xsl:copy-of select=
"$content"/>
251 compile-subdirs - adds a compile build step for each directory in a list.
253 Usage: as <compile> plus the following attributes,
254 <compile-subdir dirs="foobar1 foobar2"
259 Compiles the named subdirectories. Continues with the next build
260 step on failure, unless the optional attibute 'halt="true"' is given.
261 The make command used is as described for the compile step above.
262 The 'name' attribute can be used to give a collective name for the
263 subdirectories, and the 'sep' attibute can be used to specify the
264 separator in the 'dirs' list (defaults to space).
266 <xsl:template name=
"compile-subdirs">
267 <xsl:param name=
"content"/>
268 <xsl:param name=
"name"/>
269 <xsl:param name=
"dirs"/>
270 <xsl:param name=
"sep" select=
"' '"/>
271 <xsl:param name=
"halt" select=
"'false'"/>
272 <xsl:if test=
"translate($dirs, $sep, '')">
274 <defaults content=
"{$content}">
276 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
279 <xsl:value-of select=
"normalize-space(concat('compiling ', $name))"/>
282 <xsl:value-of select=
"normalize-space(concat('compile ', $name))"/>
285 <xsl:value-of select=
"$halt"/>
289 <copy-with-defaults content=
"{$content}">
291 <compile-subdirs-cmd dirs=
"{$dirs}" sep=
"{$sep}"/>
293 </copy-with-defaults>
298 <xsl:template name=
"compile-subdirs-cmd">
299 <xsl:param name=
"content"/>
300 <xsl:param name=
"dirs"/>
301 <xsl:param name=
"sep"/>
303 <xsl:when test=
"contains($dirs, $sep)">
304 <xsl:variable name=
"before" select=
"substring-before($dirs, $sep)"/>
305 <xsl:variable name=
"after" select=
"substring-after($dirs, $sep)"/>
307 <xsl:call-template name=
"compile-subdirs-cmd">
308 <xsl:with-param name=
"dirs" select=
"$before"/>
309 <xsl:with-param name=
"sep" select=
"$sep"/>
312 <xsl:if test=
"$after and substring($after, 1, 1) != ' '">
313 <xsl:text> && </xsl:text>
316 <xsl:call-template name=
"compile-subdirs-cmd">
317 <xsl:with-param name=
"dirs" select=
"$after"/>
318 <xsl:with-param name=
"sep" select=
"$sep"/>
321 <xsl:when test=
"string($dirs)">
322 <xsl:if test=
"$dirs != '.'">cd
<xsl:value-of select=
"$dirs"/> && </xsl:if>
323 <get name=
"make" default=
"make"/>
329 run-tests - build step to run the test suites.
336 <xsl:template name=
"run-tests">
337 <xsl:param name=
"content"/>
338 <xsl:param name=
"options" select=
"'-t'"/>
339 <xsl:param name=
"guioptions" select=
"$options"/>
340 <xsl:param name=
"msw"><is-msw/></xsl:param>
342 <defaults content=
"{$content}">
343 <description>running tests
</description>
344 <descriptionDone>run tests
</descriptionDone>
347 <copy-with-defaults content=
"{$content}">
350 <xsl:when test=
"$msw = 'true'">
351 <run-tests-win options=
"{$options}" guioptions=
"{$guioptions}"/>
354 <run-tests-unix options=
"{$options}" guioptions=
"{$guioptions}"/>
358 </copy-with-defaults>
362 <xsl:template name=
"run-tests-win">
363 <xsl:param name=
"options"/>
364 <xsl:param name=
"guioptions"/>
366 cd tests
&& runtests.bat
370 <xsl:template name=
"run-tests-unix">
371 <xsl:param name=
"options"/>
372 <xsl:param name=
"guioptions"/>
383 if [ -f core -a -x "`which gdb`" ]; then
384 echo Crashed, attempting to display backtrace:
385 gdb -batch -c core -ex 'set pagination off' -ex bt "$
1"
391 try ./test
<xsl:value-of select=
"normalize-space($options)"/>
393 test -x test_gui || exit $ERR
395 if [ -z "$DISPLAY" ]; then
396 echo '$DISPLAY is not set, skipping GUI tests.'
400 echo 'Checking window manager:'
401 WINDOW_MANAGER=$(xprop -root
32x '\n$
0\n' _NET_SUPPORTING_WM_CHECK | grep ^
0x)
403 if [ -z "$WINDOW_MANAGER" ]; then
404 echo 'Window manager not present, skipping GUI tests.'
408 xprop -id $WINDOW_MANAGER
8s _NET_WM_NAME
411 try ./test_gui
<xsl:value-of select=
"normalize-space($guioptions)"/>
417 defaults - supply default content for an element.
419 Usage: <defaults content="{$content}">
424 Copies those child elements that do not already exist in $content.
426 <xsl:template name=
"defaults">
427 <xsl:param name=
"defaults"/>
428 <xsl:param name=
"content"/>
430 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
431 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
433 <xsl:for-each select=
"$def-nodes/*">
434 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
435 <xsl:copy-of select=
"."/>
441 copy-with-defaults - copy elements supplying defaults for any that are
444 Usage: <copy-with-defaults content="{$content}">
447 </copy-with-defaults>
449 Copies $content plus any child elements that do not exist in $content,
450 substituting empty elements in $content with any child elements of the
453 <xsl:template name=
"copy-with-defaults">
454 <xsl:param name=
"defaults"/>
455 <xsl:param name=
"content"/>
457 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
458 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
460 <xsl:for-each select=
"$def-nodes/*">
461 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
462 <xsl:copy-of select=
"."/>
466 <xsl:for-each select=
"$cont-nodes/*">
468 <xsl:when test=
"not(node())">
469 <xsl:copy-of select=
"$def-nodes/*[name() = name(current())]"/>
472 <xsl:copy-of select=
"."/>
479 get - gets the text from a child element of the current build.
481 Usage: <get name="foobar" [ default="value" ]/>
483 Gets the text from the <foobar> element of the current build, or returns
484 $default if there is not such element.
486 <xsl:template name=
"get">
487 <xsl:param name=
"content"/>
488 <xsl:param name=
"build" select=
"get:build()"/>
489 <xsl:param name=
"name"/>
490 <xsl:param name=
"default"/>
491 <xsl:variable name=
"property" select=
"get:property($name, $build)"/>
494 <xsl:when test=
"$property">
495 <xsl:apply-templates select=
"$property/node()"/>
498 <xsl:value-of select=
"$default"/>
505 Accessors to get builds and their fields. XSLT code should use these
506 instead of traversing the input tree directly.
508 <func:function name=
"get:build">
509 <func:result select=
"ancestor-or-self::build[last()]"/>
512 <func:function name=
"get:all-builds">
513 <func:result select=
"//build[not(ancestor::*[name() != name(/*)])]"/>
516 <func:function name=
"get:preceding-builds">
517 <func:result select=
"get:build()/preceding-sibling::build"/>
520 <func:function name=
"get:property">
521 <xsl:param name=
"name"/>
522 <xsl:param name=
"build" select=
"get:build()"/>
523 <func:result select=
"$build/*[name() = $name]"/>
526 <func:function name=
"get:step">
527 <xsl:param name=
"name"/>
528 <xsl:param name=
"build" select=
"get:build()"/>
529 <func:result select=
"get:property('steps', $build)/*[name() = $name]"/>
533 Returns true if this is an msw build.
535 <xsl:template name=
"is-msw">
536 <xsl:param name=
"content"/>
537 <xsl:param name=
"build" select=
"get:build()"/>
538 <xsl:value-of select=
"not(get:step('configure', $build))"/>
542 Returns true if this a gui build.
544 <xsl:template name=
"is-gui">
545 <xsl:param name=
"content"/>
546 <xsl:param name=
"build" select=
"get:build()"/>
547 <xsl:variable name=
"make"><get name=
"make" build=
"{$build}"/></xsl:variable>
548 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
549 <xsl:value-of select=
"not(contains($make, 'USE_GUI=0') or contains($configure, '--disable-gui'))"/>
553 Returns true if the branch we're building has a contrib subdirectory.
555 <xsl:template name=
"has-contrib">
556 <xsl:param name=
"content"/>
557 <xsl:param name=
"build" select=
"get:build()"/>
558 <xsl:variable name=
"checkout"><xsl:apply-templates select=
"get:step('checkout', $build)"/></xsl:variable>
559 <xsl:value-of select=
"contains($checkout, 'WX_2_') and not(contains($checkout, 'WX_2_9_'))"/>
563 Returns true if the build should build the test suite.
565 <xsl:template name=
"has-tests">
566 <xsl:param name=
"content"/>
567 <xsl:param name=
"build" select=
"get:build()"/>
568 <xsl:variable name=
"configure"><xsl:apply-templates select=
"get:step('configure', $build)"/></xsl:variable>
569 <xsl:value-of select=
"get:step('run-tests', $build) or contains($configure, '--host=')"/>
573 strip - strips leading and trailing whitespace
579 Converts to text and strips leading and trailing whitespace.
581 <xsl:template name=
"strip">
582 <xsl:param name=
"content"/>
583 <xsl:variable name=
"len" select=
"string-length($content)"/>
584 <xsl:variable name=
"norm" select=
"normalize-space($content)"/>
585 <xsl:variable name=
"normlen" select=
"string-length($norm)"/>
587 <xsl:when test=
"substring($content, 1, 1) != substring($norm, 1, 1)">
588 <xsl:call-template name=
"strip">
589 <xsl:with-param name=
"content" select=
"substring($content, 2)"/>
592 <xsl:when test=
"substring($content, $len, 1) != substring($norm, $normlen, 1)">
593 <xsl:call-template name=
"strip">
594 <xsl:with-param name=
"content" select=
"substring($content, 1, $len - 1)"/>
598 <xsl:value-of select=
"$content"/>
604 normalize-space - normalises whitespace.
606 Usage: <normalize-space>
610 Converts to text, strips leading and trailing whitespace and replaces
611 sequences of whitespace characters by a single space.
613 <xsl:template name=
"normalize-space">
614 <xsl:param name=
"content"/>
615 <xsl:value-of select=
"normalize-space($content)"/>
619 lower-case - converts to lower case.
621 Usage: <lower-case>FooBar</lower-case>
623 <xsl:template name=
"lower-case">
624 <xsl:param name=
"content"/>
625 <xsl:variable name=
"lower">abcdefghijklmnopqrstuvwxyz
</xsl:variable>
626 <xsl:variable name=
"upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ
</xsl:variable>
627 <xsl:value-of select=
"translate($content, $upper, $lower)"/>
631 Helpers to convert between day numbers and names.
633 <xsl:template name=
"day-number">
634 <xsl:param name=
"content"/>
635 <xsl:param name=
"name"/>
637 <xsl:when test=
"$name = 'monday'">0</xsl:when>
638 <xsl:when test=
"$name = 'tuesday'">1</xsl:when>
639 <xsl:when test=
"$name = 'wednesday'">2</xsl:when>
640 <xsl:when test=
"$name = 'thursday'">3</xsl:when>
641 <xsl:when test=
"$name = 'friday'">4</xsl:when>
642 <xsl:when test=
"$name = 'saturday'">5</xsl:when>
643 <xsl:when test=
"$name = 'sunday'">6</xsl:when>
647 <xsl:template name=
"day-name">
648 <xsl:param name=
"content"/>
649 <xsl:param name=
"number"/>
651 <xsl:when test=
"$number = '0'">monday
</xsl:when>
652 <xsl:when test=
"$number = '1'">tuesday
</xsl:when>
653 <xsl:when test=
"$number = '2'">wednesday
</xsl:when>
654 <xsl:when test=
"$number = '3'">thursday
</xsl:when>
655 <xsl:when test=
"$number = '4'">friday
</xsl:when>
656 <xsl:when test=
"$number = '5'">saturday
</xsl:when>
657 <xsl:when test=
"$number = '6'">sunday
</xsl:when>
662 Helpers to convert between time in the format 'hhmm' and an integer
663 count of the minutes since midnight.
665 <xsl:template name=
"time-minutes">
666 <xsl:param name=
"content"/>
667 <xsl:param name=
"hhmm"/>
668 <xsl:if test=
"string-length($hhmm) = 4 and format-number($hhmm, '0000') = $hhmm">
669 <xsl:variable name=
"hour" select=
"substring($hhmm, 1, 2)"/>
670 <xsl:variable name=
"min" select=
"substring($hhmm, 3, 2)"/>
671 <xsl:if test=
"$hour >= 0 and $hour < 24 and $min >= 0 and $min < 60">
672 <xsl:value-of select=
"$hour * 60 + $min"/>
677 <xsl:template name=
"time-hhmm">
678 <xsl:param name=
"content"/>
679 <xsl:param name=
"minutes"/>
680 <xsl:value-of select=
"format-number(floor($minutes div 60) * 100 + $minutes mod 60, '0000')"/>
686 <xsl:template name=
"nightly-schedulers">
687 <xsl:param name=
"content"/>
688 <xsl:param name=
"name"/>
689 <xsl:param name=
"day"><day-number name=
"{$name}"/></xsl:param>
690 <xsl:param name=
"hour" select=
"0"/>
691 <xsl:param name=
"minute" select=
"0"/>
692 <xsl:param name=
"step" select=
"30"/>
694 <xsl:if test=
"$hour < 24">
697 <xsl:value-of select=
"concat($name, '_', format-number($hour, '00'), format-number($minute, '00'))"/>
700 <xsl:value-of select=
"$hour"/>
703 <xsl:value-of select=
"$minute"/>
705 <xsl:if test=
"$day != ''">
707 <xsl:value-of select=
"$day"/>
711 <xsl:variable name=
"next" select=
"$hour * 60 + $minute + $step"/>
712 <xsl:call-template name=
"nightly-schedulers">
713 <xsl:with-param name=
"name" select=
"$name"/>
714 <xsl:with-param name=
"day" select=
"$day"/>
715 <xsl:with-param name=
"hour" select=
"floor($next div 60)"/>
716 <xsl:with-param name=
"minute" select=
"$next mod 60"/>
717 <xsl:with-param name=
"step" select=
"$step"/>
723 scheduler - provide default for the <scheduler> build element.
725 <xsl:template name=
"scheduler">
726 <xsl:param name=
"content"/>
727 <xsl:param name=
"previous" select=
"get:property('scheduler', get:preceding-builds()[last()])"/>
728 <xsl:param name=
"step" select=
"60"/>
731 <xsl:when test=
"exsl:node-set($content)/node()">
733 <xsl:copy-of select=
"$content"/>
737 <xsl:for-each select=
"$previous">
738 <xsl:variable name=
"text">
739 <xsl:apply-templates select=
"."/>
742 <scheduler-subst text=
"{$text}" step=
"{$step}"/>
749 <xsl:template name=
"scheduler-subst">
750 <xsl:param name=
"content"/>
751 <xsl:param name=
"text"/>
752 <xsl:param name=
"step"/>
754 <xsl:variable name=
"name" select=
"substring-before($text, '_')"/>
755 <xsl:variable name=
"hhmm" select=
"substring-after($text, '_')"/>
756 <xsl:variable name=
"day"><day-number name=
"{$name}"/></xsl:variable>
757 <xsl:variable name=
"mins"><time-minutes hhmm=
"{$hhmm}"/></xsl:variable>
760 <xsl:when test=
"$mins = ''">
761 <xsl:value-of select=
"$text"/>
763 <xsl:when test=
"$day = ''">
764 <xsl:value-of select=
"$name"/>
765 <xsl:text>_
</xsl:text>
766 <time-hhmm minutes=
"{$mins + $step}"/>
769 <xsl:variable name=
"day-mins" select=
"24 * 60"/>
770 <xsl:variable name=
"week-mins" select=
"7 * $day-mins"/>
771 <xsl:variable name=
"tmp" select=
"($day + 1) * $day-mins + $mins"/>
772 <xsl:variable name=
"next" select=
"$tmp mod $week-mins + floor($tmp div $week-mins) * $step"/>
773 <day-name number=
"{floor($next div $day-mins)}"/>
774 <xsl:text>_
</xsl:text>
775 <time-hhmm minutes=
"{$next mod $day-mins}"/>
781 email - substitute '@' for ' -at- ' in email addresses.
783 <xsl:template name=
"emailfield">
784 <xsl:param name=
"content"/>
785 <xsl:param name=
"addr"/>
786 <xsl:variable name=
"at"> -at-
</xsl:variable>
788 <xsl:when test=
"contains($addr, $at)">
789 <xsl:value-of select=
"substring-before($addr, $at)"/>
790 <xsl:text>@
</xsl:text>
791 <xsl:value-of select=
"substring-after($addr, $at)"/>
794 <xsl:value-of select=
"$addr"/>
799 <xsl:template name=
"email">
800 <xsl:param name=
"content"/>
801 <xsl:param name=
"id"/>
802 <email id=
"{$id}"><emailfield addr=
"{$content}"/></email>
805 <xsl:template name=
"fromaddr">
806 <xsl:param name=
"content"/>
807 <fromaddr><emailfield addr=
"{$content}"/></fromaddr>
810 <xsl:template name=
"extraRecipient">
811 <xsl:param name=
"content"/>
812 <extraRecipient><emailfield addr=
"{$content}"/></extraRecipient>
816 mailnotifier - add a default value for <fromaddr> to <mailnotifier>
818 <xsl:template name=
"mailnotifier">
819 <xsl:param name=
"content"/>
821 <defaults content=
"{$content}">
822 <fromaddr>noreply -at- wxsite.net
</fromaddr>
824 <xsl:copy-of select=
"$content"/>