1 | <?xml version='1.0'?>
|
---|
2 | <!DOCTYPE project>
|
---|
3 |
|
---|
4 | <project name="xmlcatalog" default="all" basedir=".">
|
---|
5 |
|
---|
6 | <description>
|
---|
7 | This is to test XMLCatalog for external entity resolution from the
|
---|
8 | xslt task, both the simple case and using the document() function
|
---|
9 | to refer to a second file (which refers to the entity). This
|
---|
10 | buildfile is called by
|
---|
11 | org.apache.tools.ant.types.XMLCatalogBuildFileTest.java
|
---|
12 | Alternatively, you may try it out by hand by first removing the
|
---|
13 | comment symbols around the echo statements and then calling
|
---|
14 | ant -buildfile xmlcatalog.xml
|
---|
15 | </description>
|
---|
16 |
|
---|
17 | <property name="transformer" value = "xmlcatalog.xsl"/>
|
---|
18 |
|
---|
19 | <target
|
---|
20 | name = "all"
|
---|
21 | depends = "testentitynocatalog, testentitywithcatalog,
|
---|
22 | testdocumentnocatalog, testdocumentwithcatalog"/>
|
---|
23 |
|
---|
24 | <target
|
---|
25 | name = "testentitynocatalog"
|
---|
26 | description = "Test external entity resolver for simple XML
|
---|
27 | document without using XMLCatalog">
|
---|
28 | <delete
|
---|
29 | quiet = "yes"
|
---|
30 | file = "result.out"/>
|
---|
31 | <xslt
|
---|
32 | basedir = "${basedir}"
|
---|
33 | destdir = "${basedir}"
|
---|
34 | extension = ".text"
|
---|
35 | style = "${transformer}"
|
---|
36 | in = "xmlcatalog1.xml"
|
---|
37 | out = "result.out">
|
---|
38 | <param
|
---|
39 | name = "outprop"
|
---|
40 | expression = "val1"/>
|
---|
41 | </xslt>
|
---|
42 | <property file = "result.out"/>
|
---|
43 | <!-- <echo message = "${val1}"/> -->
|
---|
44 | <delete
|
---|
45 | quiet = "yes"
|
---|
46 | file = "result.out"/>
|
---|
47 | </target>
|
---|
48 |
|
---|
49 | <target
|
---|
50 | name = "testentitywithcatalog"
|
---|
51 | description = "Test external entity resolver for simple
|
---|
52 | XML document using XMLCatalog">
|
---|
53 | <delete
|
---|
54 | quiet = "yes"
|
---|
55 | file = "result.out"/>
|
---|
56 | <xslt
|
---|
57 | basedir = "${basedir}"
|
---|
58 | destdir = "${basedir}"
|
---|
59 | extension = ".text"
|
---|
60 | style = "${transformer}"
|
---|
61 | in = "xmlcatalog1.xml"
|
---|
62 | out = "result.out">
|
---|
63 | <param
|
---|
64 | name = "outprop"
|
---|
65 | expression = "val2"/>
|
---|
66 | <xmlcatalog>
|
---|
67 | <entity
|
---|
68 | publicId = "myquote"
|
---|
69 | location = "quote2.xml"/>
|
---|
70 | </xmlcatalog>
|
---|
71 | </xslt>
|
---|
72 | <property file = "result.out"/>
|
---|
73 | <!-- <echo message = "${val2}"/> -->
|
---|
74 | <delete
|
---|
75 | quiet = "yes"
|
---|
76 | file = "result.out"/>
|
---|
77 | </target>
|
---|
78 |
|
---|
79 | <target
|
---|
80 | name = "testdocumentnocatalog"
|
---|
81 | description = "Test entity resolution in XML document called
|
---|
82 | from XSLT document() function without using XMLCatalog">
|
---|
83 | <delete
|
---|
84 | quiet = "yes"
|
---|
85 | file = "result.out"/>
|
---|
86 | <xslt
|
---|
87 | basedir = "${basedir}"
|
---|
88 | destdir = "${basedir}"
|
---|
89 | extension = ".text"
|
---|
90 | style = "${transformer}"
|
---|
91 | in = "xmlcatalog2.xml"
|
---|
92 | out = "result.out">
|
---|
93 | <param
|
---|
94 | name = "outprop"
|
---|
95 | expression = "val3"/>
|
---|
96 | </xslt>
|
---|
97 | <property file = "result.out"/>
|
---|
98 | <!-- <echo message = "${val3}"/> -->
|
---|
99 | <delete
|
---|
100 | quiet = "yes"
|
---|
101 | file = "result.out"/>
|
---|
102 | </target>
|
---|
103 |
|
---|
104 | <target
|
---|
105 | name = "testdocumentwithcatalog"
|
---|
106 | description = "Test entity resolution in XML document called
|
---|
107 | from XSLT document() function using XMLCatalog">
|
---|
108 | <delete
|
---|
109 | quiet = "yes"
|
---|
110 | file = "result.out"/>
|
---|
111 | <xslt
|
---|
112 | basedir = "${basedir}"
|
---|
113 | destdir = "${basedir}"
|
---|
114 | extension = ".text"
|
---|
115 | style = "${transformer}"
|
---|
116 | in = "xmlcatalog2.xml"
|
---|
117 | out = "result.out">
|
---|
118 | <param
|
---|
119 | name = "outprop"
|
---|
120 | expression = "val4"/>
|
---|
121 | <xmlcatalog>
|
---|
122 | <entity
|
---|
123 | publicId = "myquote"
|
---|
124 | location = "quote2.xml"/>
|
---|
125 | </xmlcatalog>
|
---|
126 | </xslt>
|
---|
127 | <property file = "result.out"/>
|
---|
128 | <!-- <echo message = "${val4}"/> -->
|
---|
129 | <delete
|
---|
130 | quiet = "yes"
|
---|
131 | file = "result.out"/>
|
---|
132 | </target>
|
---|
133 |
|
---|
134 | </project>
|
---|