Hi Bruce,

 

You can use xmlcatalog to specify the location of the dtd similar to the
following:

 

                 <xmlcatalog id="dtd">

                        <dtd publicId="-//Sun Microsystems, Inc.//DTD
Web Application 2.3//EN" location="./web-app_2_3.dtd"/>

                </xmlcatalog>

 

 

 

 

   Mark Coffin 
   mcof...@aalsolutions.com 
   Phone: 905.632.0864 
   1.800.668.8486 
   Fax: 905.632.2605 
   www.aalsolutions.com 

________________________________

From: Hulse, Bruce [mailto:bhu...@ptc.com] 
Sent: February 1, 2010 8:19 AM
To: xmltask-users@lists.sourceforge.net
Subject: [Xmltask-users] Issue with xmltask and ant with respect to
currentdirectory behavior

 

I have an ant task that uses the "ant" task to run a subtask that uses
xmltask to edit an xml file with a SYSTEM ID of "../../mydtd.dtd". For
some reason, no matter what I do to have that particular ant subtask
have it's basedir set to the directory where the xml file being edited
actually resides, it always falls back to the basedir directory where
the initial ant task was launched to do the resolution of
../../mydtd.dtd.

 

Primary ant task's basedir to d:\temp\anttasks\myanttask.xml.

Myanttask.xml uses <ant antfile="thesubtask.xml" dir="d:\myapp\data"> to
run the subtask in the directory where myxmlfile.xml resides.

Myxmlfile.xml is in d:\myapp\data\xmlstuff

Myxmlfile.xml has the System ID of ../../mydtd.dtd

Mydtd.dtd resides in d:\myapp

 

When the subtask runs, I use basename and dirname on ${basedir} to get
it to show me where it is running from - I see it in d:\myapp\data.

 

However, when the xmltask runs it complains that it cannot find
d:\mydtd.dtd. Does anyone know why xmltask seems to use the basedir of
the original ant task rather than the basedir of the subtask?

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to