Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 1344 invoked from network); 3 Sep 2007 11:36:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Sep 2007 11:36:56 -0000 Received: (qmail 75534 invoked by uid 500); 3 Sep 2007 11:36:47 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 75263 invoked by uid 500); 3 Sep 2007 11:36:46 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 75252 invoked by uid 99); 3 Sep 2007 11:36:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2007 04:36:46 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of peter.kitt.reilly@gmail.com designates 209.85.198.187 as permitted sender) Received: from [209.85.198.187] (HELO rv-out-0910.google.com) (209.85.198.187) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2007 11:36:40 +0000 Received: by rv-out-0910.google.com with SMTP id k15so893168rvb for ; Mon, 03 Sep 2007 04:36:19 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KGbcG0pHb62UDBMlIXO7CZius/BZQtD+I7FxX0zWBNPIsatu8Hi6ZsOLnw1GVGvrr52vpLcVGzqMUKyi1s6MyabuWvlxz0Vvd1SvuPGnBQah3DsiI9r1mm0qXKfF+HjW2fTpbIcOT03Vkkhtm1cr0fsMx4SDdiURkOptGV2i+UQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Kur0Eh9cJyTXWoeV6mBJWWumuGFRdJufTLDPZQrGWtsySCYAt4kX7Cn4v+3XGvhWC+wWq4PQ8eHheF4lh6YleOE64eIKg/WfGnp96UFLSykaNrLUQcT0vb71oA2U97ICI34UmM1FqE8e0uVYkxkoMwAS17TBSiXDCpeijsfr2+g= Received: by 10.141.146.11 with SMTP id y11mr1923967rvn.1188819379488; Mon, 03 Sep 2007 04:36:19 -0700 (PDT) Received: by 10.140.192.15 with HTTP; Mon, 3 Sep 2007 04:36:19 -0700 (PDT) Message-ID: Date: Mon, 3 Sep 2007 12:36:19 +0100 From: "Peter Reilly" To: "Ant Users List" Subject: Re: Accessing build script's prefix-to-namespace uri mappings from a task. In-Reply-To: <46DBEFCE.7090003@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46d6b7bb.0716300a.2482.2089@mx.google.com> <46DBEFCE.7090003@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org On 9/3/07, Steve Loughran wrote: > CJ wrote: > > Hi, > > > > Hopefully someone can help me or point me in the right direction here. > > > > I have a custom Ant task which I want to use to invoke another command > > which isn't known at compilation time. It uses an approach very similar > > to Ant itself, in that it builds the command from RuntimeConfigurables/ > > UnknownElements. This all works but for running commands which have a > > prefix (such as my other custom commands). > > > > I want to be able to translate the prefix to a namespace uri that I can > > make the correct UnkownElement.setNamespace( uri ) call. > > > > For clarity, this is a simplified form of what I want to do. (I realize > > the example doesn't make a great deal of practical sense in this form; > > this is just for illustrative purposes, please humor me :) ). > > > > > xmlns:myprefix="http://some.uri" > > > > > > uri="http://some.uri" > > classpath="mylib.jar" > > /> > > > > > > > > > > > > > > > > ... > > > > > > > > > > Taskrunner is what I'm trying to get working, so it executes the task > > just as Ant would when parsing the xml form above it. I am parsing the > > 'myprefix' from the task name (atask's name attribute), but I don't > > know how to get the namespace 'http://some.uri' programmatically at > > this point. > > > > There's nothing in ant to do this yet, though you could probably write a > task (which we would gladly accept, esp if it came with docs and tests :), > This is something that needs to be in ant-core. At the moment the prefix namespace mapping is not retained. It can be a little complicated, as UEs can get copied and modified - macrodef for exmple. Peter. > -- > Steve Loughran http://www.1060.org/blogxter/publish/5 > Author: Ant in Action http://antbook.org/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org