Hi, Everyone,
I'm trying to get ejb-client-jar's value from test.xml, So i use Ant <xmlproperty>
task.
My build file is very simple and as following:
************************************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="xmltest" name="test">
<target name="xmltest">
<xmlproperty
collapseAttributes="true"
file="test.xml"
keeproot="false"
prefix="ejb-jar">
</xmlproperty>
<echo message="${ejb-jar.ejb-client-jar}"/>
</target>
</project>
************************************************************************************
test.xml is below. Tag ejb-client-jar value is "This is a test for xmlproperty task":
************************************************************************************
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN'
'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<ejb-client-jar>This is a test for xmlproperty task</ejb-client-jar>
</ejb-jar>
************************************************************************************
If my machine is online, the task can work fine. It can output message:
"This is a test for xmlproperty task". But offline, it can not work and
error message is following:
************************************************************************************
Buildfile: build.xml
xmltest:
BUILD FAILED
file:C:/isrlm/rlm_v2/wizard/dist/build1.xml:9: java.net.UnknownHostException:
java.sun.com
************************************************************************************
The reason should be that task <xmlproperty> can not get dtd from location
http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd. But my machine must be offline
. I want to get dtd file at local directory but task <xmlproperty> can not nest
<dtd> task.
How i can do?
Thanks in advance.
Sun Yong jing