Return-Path: Delivered-To: apmail-jakarta-velocity-dev-archive@apache.org Received: (qmail 52801 invoked from network); 8 Sep 2002 15:07:47 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Sep 2002 15:07:47 -0000 Received: (qmail 5328 invoked by uid 97); 8 Sep 2002 15:08:17 -0000 Delivered-To: qmlist-jakarta-archive-velocity-dev@jakarta.apache.org Received: (qmail 5155 invoked by uid 97); 8 Sep 2002 15:08:16 -0000 Mailing-List: contact velocity-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Velocity Developers List" Reply-To: "Velocity Developers List" Delivered-To: mailing list velocity-dev@jakarta.apache.org Received: (qmail 6757 invoked by uid 98); 5 Sep 2002 20:15:29 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) X-Originating-IP: [193.195.0.102] From: "Andrew Stevens" To: velocity-dev@jakarta.apache.org Bcc: Subject: [PATCH] for Bug (enhancement) 12191 nested element Date: Thu, 05 Sep 2002 21:14:54 +0100 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_2a76_4735_115" Message-ID: X-OriginalArrivalTime: 05 Sep 2002 20:14:54.0588 (UTC) FILETIME=[E5FC2BC0:01C25518] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_2a76_4735_115 Content-Type: text/plain; format=flowed Hello, folks. I'm at a machine with diff now, so here's a patch file for the modified AnakiaTask.java I attached earlier to the bug report ( http://issues.apache.org/bugzilla/show_bug.cgi?id=12191 ) It adds optional nested elements to the anakia task for and , with the same syntax as the Ant xmlvalidate task (unsurprisingly, since it uses the standard Ant types to do it and I lifted most of the code from Ant's own source). Hope this can be applied reasonably soon; without it I can't build xdoclet behind the firewall at work (I get no such host xdoclet.sourceforge.net exceptions), but if I commit a modified version of velocity's jar to xdoclet's CVS it'll break a whole bunch of GUMP builds... Andrew. _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com ------=_NextPart_000_2a76_4735_115 Content-Type: text/plain; name="xmlcatalog.txt"; format=flowed Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="xmlcatalog.txt" Index: jakarta-velocity/src/java/org/apache/velocity/anakia/AnakiaTask.java =================================================================== RCS file: /home/cvspublic/jakarta-velocity/src/java/org/apache/velocity/anakia/AnakiaTask.java,v retrieving revision 1.33 diff -u -r1.33 AnakiaTask.java --- jakarta-velocity/src/java/org/apache/velocity/anakia/AnakiaTask.java 9 Nov 2001 00:12:56 -0000 1.33 +++ jakarta-velocity/src/java/org/apache/velocity/anakia/AnakiaTask.java 5 Sep 2002 19:56:12 -0000 @@ -66,6 +66,8 @@ import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.MatchingTask; +import org.apache.tools.ant.types.DTDLocation; +import org.apache.tools.ant.types.XMLCatalog; import org.xml.sax.SAXParseException; @@ -140,6 +142,9 @@ /** the VelocityEngine instance to use */ private VelocityEngine ve = new VelocityEngine(); + /** for resolving entities such as dtds */ + private XMLCatalog xmlCatalog = new XMLCatalog(); + /** * Constructor creates the SAXBuilder. */ @@ -238,6 +243,32 @@ } /** + * add an XMLCatalog as a nested element; optional. + */ + public void addConfiguredXMLCatalog(XMLCatalog catalog) { + xmlCatalog.addConfiguredXMLCatalog(catalog); + } + + /** + * Create a DTD location record; optional. + * This stores the location of a DTD. The DTD is identified + * by its public Id. + */ + public DTDLocation createDTD() { + DTDLocation dtdLocation = new DTDLocation(); + xmlCatalog.addDTD(dtdLocation); + return dtdLocation; + } + + /** + * Initialize internal instance of XMLCatalog + */ + public void init() throws BuildException { + super.init(); + xmlCatalog.setProject(project); + } + + /** * Main body of the application */ public void execute () throws BuildException @@ -294,6 +325,9 @@ } } + // use the supplied xmlCatalog to resolve DTDs etc. when reading source files + builder.setEntityResolver(xmlCatalog); + Document projectDocument = null; try { ------=_NextPart_000_2a76_4735_115 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------=_NextPart_000_2a76_4735_115--