Line | |
---|
1 | <?xml version="1.0"?> |
---|
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
---|
3 | <xsl:output omit-xml-declaration="yes"/> |
---|
4 | <xsl:output method="text"/> |
---|
5 | |
---|
6 | <xsl:param name="what" >Undefined</xsl:param><!-- first argument supplied on the command-line when invoking the xslt processor--> |
---|
7 | <xsl:param name="target">Undefined</xsl:param><!-- second (optional) argument supplied on the command-line when invoking the xslt processor--> |
---|
8 | |
---|
9 | <xsl:template match="/"> |
---|
10 | <xsl:choose> |
---|
11 | |
---|
12 | <xsl:when test="$what='list_targets'"> |
---|
13 | <xsl:for-each select="//target"> |
---|
14 | <xsl:value-of select="./@name"/><xsl:text> |
---|
15 | </xsl:text> |
---|
16 | </xsl:for-each> |
---|
17 | |
---|
18 | </xsl:when> |
---|
19 | <xsl:when test="$what='Undefined'">Error, this stylesheet expects _what_ argument |
---|
20 | </xsl:when> |
---|
21 | |
---|
22 | <xsl:when test="$what='list_tests'"> |
---|
23 | <xsl:choose> |
---|
24 | <xsl:when test="$target='Undefined'">Error, this stylesheet expects _target_ argument |
---|
25 | </xsl:when> |
---|
26 | <xsl:otherwise> |
---|
27 | <!-- in examples, the redirection is "> !" but the command failed to produce the output file when invoked from a perl-script. Solved the problem by removing the "!" and only retaining the ">" --> |
---|
28 | <xsl:for-each select="//target[@name=$target]/test"><xsl:choose><xsl:when test="./@program">./<xsl:value-of select="./@program"/></xsl:when><xsl:otherwise>./madx</xsl:otherwise></xsl:choose> < <xsl:value-of select="./@input"/> > <xsl:text> </xsl:text> <xsl:value-of select="./@output"/> <xsl:if test="./@subdir">, subdirectory=<xsl:value-of select="./@subdir"/></xsl:if><xsl:text> |
---|
29 | </xsl:text> |
---|
30 | </xsl:for-each> |
---|
31 | </xsl:otherwise> |
---|
32 | </xsl:choose> |
---|
33 | </xsl:when> |
---|
34 | <xsl:when test="$what='responsible'"> |
---|
35 | <xsl:value-of select="//target[@name=$target]/@responsible"/> |
---|
36 | </xsl:when> |
---|
37 | |
---|
38 | |
---|
39 | </xsl:choose> |
---|
40 | |
---|
41 | </xsl:template> |
---|
42 | |
---|
43 | |
---|
44 | </xsl:stylesheet> |
---|
Note: See
TracBrowser
for help on using the repository browser.