Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 22522 invoked from network); 21 Apr 2006 17:07:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Apr 2006 17:07:13 -0000 Received: (qmail 20447 invoked by uid 500); 21 Apr 2006 17:07:12 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 20425 invoked by uid 500); 21 Apr 2006 17:07:12 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 20414 invoked by uid 99); 21 Apr 2006 17:07:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Apr 2006 10:07:12 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Apr 2006 10:07:10 -0700 Received: from brutus (localhost.localdomain [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EF4457142BC for ; Fri, 21 Apr 2006 17:06:06 +0000 (GMT) Message-ID: <3301.1145639166850.JavaMail.jira@brutus> Date: Fri, 21 Apr 2006 17:06:06 +0000 (GMT+00:00) From: "Thomas Fischer (JIRA)" To: torque-dev@db.apache.org Subject: [jira] Commented: (TORQUE-3) Generator: resolving database.dtd in org.apache.torque.engine.database.transform.DTDResolver.java In-Reply-To: <25037910.1145523966004.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/TORQUE-3?page=comments#action_12375604 ] Thomas Fischer commented on TORQUE-3: ------------------------------------- The behaviour has already been changed in svn. The behaviour is now to check whether the dtd equals the current dtd name, http://db.apache.org/torque/dtd/database_3_2.dtd If yes, the dtd is loaded from the claspath, if not, null is returned and the dtd resolution is left to the xml parser. So if the standard dtd uri is given, the dtd is loaded from the jar, if not, it is assumed that the user wishes to use another dtd, and he can do so. Do you still propose to change this behaviour ? If yes, why ? > Generator: resolving database.dtd in org.apache.torque.engine.database.transform.DTDResolver.java > ------------------------------------------------------------------------------------------------- > > Key: TORQUE-3 > URL: http://issues.apache.org/jira/browse/TORQUE-3 > Project: Torque > Type: Improvement > Components: Generator > Versions: 3.2 > Environment: Windows XP, JDK 1.4 (I don't think this matters) > Reporter: Joerg Friedrich > Priority: Minor > Attachments: DTDResolver.java, XmlToAppData.java > > In class org.apache.torque.engine.database.transform.DTDResolver the DTD for the XMP schema files is retrieved via either a (1) getResourceAsStream("database.dtd") call, a (2) getInputSource("http://db.apache.org/torque/dtd/database_3_2.dtd") or a (3) getInputSource("systemId"), where systemId is typically made up of the system designator in the DOCTYPE statement inside the XML schema file prepended with the absolute path of the location of the current working directory or directory from which the generator. > Usually the database.dtd is found in the class path (method 1), since it is delivered with the generator jar. However, as soon as we do something like this in the XML file: the generator does not work any more, unless we place a copy of database.dtd at the current working directory (thus, system reverts to (3)). This behaviour comes from this line in method resolveEntity: > if (databaseDTD != null && (WEB_SITE_DTD.equals(systemId)) > since the systemId in this case looks something like this: file:///d:torque/torque-gen-3.2/database.dtd and of course does not match the WEB_SITE_DTD string. > My suggestion : change this line to > if (databaseDTD != null) > and everything works fine. > The attachments contain another modification: with the current implementation it is not possible to include another XML file into an XML schema file. This is quite useful if schema files are very large or one wants to separate database dependencies of SQL data types into database specific mapping files using the directive. This should be possible with the patch provided. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org