1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <project name="style-test" basedir="." default="nothing">
|
---|
4 |
|
---|
5 | <property name="out.dir" value="out"/>
|
---|
6 |
|
---|
7 |
|
---|
8 | <target name="setup">
|
---|
9 | </target>
|
---|
10 |
|
---|
11 | <target name="teardown">
|
---|
12 | <delete dir="${out.dir}" failonerror="false" />
|
---|
13 | </target>
|
---|
14 |
|
---|
15 | <target name="testStyleIsSet">
|
---|
16 | <style in="data.xml" out="${out.dir}/out.xml"/>
|
---|
17 | </target>
|
---|
18 |
|
---|
19 | <target name="testTransferParameterSet">
|
---|
20 | <property name="value" value="myvalue"/>
|
---|
21 | <style in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
|
---|
22 | <param name="set" expression="${value}"/>
|
---|
23 | </style>
|
---|
24 | </target>
|
---|
25 |
|
---|
26 | <target name="testTransferParameterEmpty">
|
---|
27 | <property name="value" value=""/>
|
---|
28 | <style in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
|
---|
29 | <param name="empty" expression="${value}"/>
|
---|
30 | </style>
|
---|
31 | </target>
|
---|
32 |
|
---|
33 | <target name="testTransferParameterUnset">
|
---|
34 | <style in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
|
---|
35 | <param name="undefined" expression="${value}"/>
|
---|
36 | </style>
|
---|
37 | </target>
|
---|
38 |
|
---|
39 | <target name="testTransferParameterUnsetWithIf">
|
---|
40 | <style in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
|
---|
41 | <param name="undefined" expression="${value}" if="value" />
|
---|
42 | </style>
|
---|
43 | </target>
|
---|
44 |
|
---|
45 | <target name="testDefaultMapper">
|
---|
46 | <property name="value" value="myvalue"/>
|
---|
47 | <style style="printParams.xsl" destDir="${out.dir}" basedir=".">
|
---|
48 | <param name="set" expression="${value}"/>
|
---|
49 | </style>
|
---|
50 | </target>
|
---|
51 |
|
---|
52 | <target name="testCustomMapper">
|
---|
53 | <property name="value" value="myvalue"/>
|
---|
54 | <style style="printParams.xsl" destDir="${out.dir}" basedir=".">
|
---|
55 | <param name="set" expression="${value}"/>
|
---|
56 | <mapper type="glob" from="data.*" to="out.*"/>
|
---|
57 | </style>
|
---|
58 | </target>
|
---|
59 |
|
---|
60 | <target name="testNewerStylesheet">
|
---|
61 | <antcall target="copyXsl">
|
---|
62 | <param name="xsl.value" value="old-value"/>
|
---|
63 | </antcall>
|
---|
64 | <style in="data.xml" out="${out.dir}/out.xml" style="tmp.xsl"/>
|
---|
65 |
|
---|
66 | <antcall target="copyXsl">
|
---|
67 | <param name="xsl.value" value="new-value"/>
|
---|
68 | </antcall>
|
---|
69 | <style in="data.xml" out="${out.dir}/out.xml" style="tmp.xsl"/>
|
---|
70 | <delete file="tmp.xsl"/>
|
---|
71 | </target>
|
---|
72 |
|
---|
73 | <target name="copyXsl" if="xsl.value">
|
---|
74 | <copy file="testNewerStylesheet.xsl" tofile="tmp.xsl" overwrite="true">
|
---|
75 | <filterchain><expandproperties/></filterchain>
|
---|
76 | </copy>
|
---|
77 | </target>
|
---|
78 |
|
---|
79 | </project> |
---|