Summary:
To fix this problem, make sure there is a file 
"org/apache/torque/engine/database/transform/database.dtd" in your 
classpath when running the tasks.

Detail:
org.apache.torque.engine.database.transform.DTDResolver has the 
following code:

     private static final String WEB_SITE_DTD =
         "http://jakarta.apache.org/turbine/dtd/database.dtd";;

             InputStream dtdStream =
                 getClass().getResourceAsStream("database.dtd");
             databaseDTD = new InputSource(dtdStream);

     public InputSource resolveEntity(String publicId, String systemId)
     {
         if (databaseDTD != null && WEB_SITE_DTD.equals(systemId))
         {
             String pkg = getClass().getName()
                 .substring(0, getClass().getName().lastIndexOf("."));
             System.out.println("Resolver: used database.dtd from " +
                  pkg + " package ");
             return databaseDTD;
         }
         else

i.e. if the DTD is declared as:
<!DOCTYPE database SYSTEM 
"http://jakarta.apache.org/turbine/dtd/database.dtd";>

Then the DTD will be picked up from the resource "database.dtd" found 
using getResourceAsStream() by the resolver. Unfortunately, the build 
does not put the database.dtd file into the 
org.apache.torque.engine.database.transform package, so this never 
happens.

But you can make sure it is on your classpath yourself in the right 
package, and then the automatic mapping of the URL to the local resource 
will happen, and you can work offline.

Hope this helps,
Gareth

On Wednesday, August 28, 2002, at 12:10  am, Scott Eade wrote:

> Walt,
>
> I think you need to make yourself an EntityResolver.  You create a class
> (implements EntityResolver) that maps from the DTD reference to a local 
> file
> reference over which you have much better control.  When you parse the 
> XML
> file you tell the parser to use your entity resolver.
>
> There are examples in the turbine source - see:
> org.apache.turbine.services.intake.transform.DTDResolver.java
>
> Cheers,
>
> Scott
> --
> Scott Eade
> Backstage Technologies Pty. Ltd.
> http://www.backstagetech.com.au
>
>> From: Walt Armour <[EMAIL PROTECTED]>
>> Reply-To: "Turbine Torque Users List" <turbine-torque-
>> [EMAIL PROTECTED]>
>> Date: Tue, 27 Aug 2002 13:20:35 -0700
>> To: Turbine Torque Users List <[EMAIL PROTECTED]>
>> Subject: TorqueDataModelTask and cross-platform XML
>>
>>
>> For our project we have done all of the work so far on Win2K.  I am now
>> trying to bring it up on Linux.
>>
>> The blocking hurdle I have is dealing with our XML files and their 
>> DTDs.  We
>> initially specified the DOCTYPE tag using the SYSTEM attribute and a 
>> file://
>> <file://>  URI specified for the DTD.  This of course won't work cross
>> platform since it has filesystem specific pathing (e.g. C:).  I 
>> modified the
>> reference to be relative without the file:// <file://>  scheme and this
>> works fine for our XML validator but fails in TorqueDataModelTask (at 
>> line
>> 313 of current cvs, in initControlContext at xmlParser.parsefile() ).  
>> It
>> appears that the underlying parser (SAX) wants this reference to be
>> absolute.
>>
>> I have looked through the code (gotta love
>> http://jakarta.apache.org/turbine/torque/xref/org/apache/torque/task/TorqueD
>> ataModelTask.html
>> <http://jakarta.apache.org/turbine/torque/xref/org/apache/torque/task/Torque
>> DataModelTask.html> ) and don't see anything obvious to answer this: is
>> there any way to make the task (via SAX) ignore/not validate/not care 
>> about
>> this reference?
>>
>> Alternatively, does anyone have suggestions on how to make this work
>> cross-platform without using network type schemes (e.g. http:// 
>> <http://> )?
>> I've toyed with doing that but it would then require us to be either
>> connected to the network when we build or that we have a webserver 
>> running
>> locally whenever we build.  Both of those are restrictions we would 
>> prefer
>> not to have.
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>>
>
>
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>
>
>
---
Development Team Leader, eGS, 5-7 Singer Street, London EC2A 4BQ. +44 
(0)20 7336 1440

CONFIDENTIALITY: This is email is confidential and intended solely for 
the use of the individual to whom it is addressed.� Any views or 
opinions presented are solely those of the author and do not necessarily 
represent those of eGovernment Solutions (UK) Ltd.� If you are not the 
intended recipient, be advised that you have received this email in 
error and that any use, dissemination, forwarding, or copying of this 
email is strictly prohibited.� If you have received this email in error 
please contact the sender.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to