thanks rob - i'd thought of this but wanted to avoid many prop files - i'll stick with a java prop file.
-----Original Message----- From: Rob van Oostrum [mailto:[EMAIL PROTECTED]] Sent: 09 October 2002 13:04 To: Ant Users List Subject: Re: xmlproperty - clarification please what I would probably do in your situation is have 3 different property files: something like u01.xml - u03.xml <xmlproperty file="${env}.xml}> then you pass -Denv=u02 on the command line et voila ... haven't tested it but you should get the desired result somewhere along these lines. Hope this helped you in some way ... Rob ----- Original Message ----- From: "Simon Baker" <[EMAIL PROTECTED]> To: "'Ant Users List'" <[EMAIL PROTECTED]> Sent: Wednesday, October 09, 2002 1:32 PM Subject: xmlproperty - clarification please > > I am playing around with using an xml file to load properties into my build > file. The xml properties are as follows .... > > <environments> > > <env name="u03"> > <server.app.hostname>caix01</server.app.hostname> > <server.app.username>root</server.app.username> > <server.app.password>root</server.app.password> > <server.app.rootdir>/clearstage/env/u03</server.app.rootdir> > > <billers>amexc,barcc,brgas,brtel,gfish,mbnac,mnsfs,morst,jlpac,onetl,orang,t > elew,tmobl,virgc,virge,vodaf</billers> > <debug>on</debug> > </env> > > <env name="u02"> > <server.app.hostname>caix01</server.app.hostname> > <server.app.username>root</server.app.username> > <server.app.password>root</server.app.password> > <server.app.rootdir>/clearstage/env/u02</server.app.rootdir> > > <billers>amexc,barcc,brgas,brtel,gfish,mbnac,mnsfs,morst,jlpac,onetl,orang,t > elew,tmobl,virgc,virge,vodaf</billers> > <debug>on</debug> > </env> > > </environments> > > My ant code looks like: > > <project name="play" default="init" basedir="."> > > <target name="init"> > > <property name="env" value="u02"/> > > <xmlproperty file="${basedir}/env.xml" > keeproot="false"/> > > <echo>server.app.hostname=${env.server.app.hostname}</echo> > <echo>server.app.username=${env.server.app.username}</echo> > <echo>server.app.password=${env.server.app.password}</echo> > <echo>server.app.rootdir=${env.server.app.rootdir}</echo> > <echo>billers=${env.billers}</echo> > <echo>debug=${env.debug}</echo> > > </target> > > </project> > > In a similar example in the book by Steve Loughran/Erik Hatcher, on page 76 > it says that a customer property (aka my env property) can be overridden at > the command line like: ant -Dcustomer=joes_garage. However, further in the > text it describes a limitation of xmproperty - it handles only the first of > duplicate elements. > > So does this mean that my example cannot successfully load the correct > properties based upon the command line, eg. ant -Denv=u02 or ant -Denv=u03? > > Certainly i only get the first sibling element, ie. u03 nomatter what i > specify the env property to be .... > > > > > > > > > Simon Baker > Clear Money Ltd. > 84-86 Regent Street > London > W1B 5RR > t: +44 (0)20 7025 6605 > f: +44 (0)20 7025 6501 > e: [EMAIL PROTECTED] > > Visit our web site at: <http://www.clear.co.uk> > > > ********************************************************************** > Confidentiality: this e-mail and any attachments may be confidential. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use the information in this e-mail and any attachments. Please reply to this e-mail highlighting the error and delete the e-mail and any attachments from your system. > > Security Warning: please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We suggest that you consider this when e-mailing us. > > Viruses: although we have taken steps to ensure that this e-mail and attachments are free from any virus we advise that in keeping with good computing practice the recipients should ensure that they are actually virus free. > > Clear, Clear Money and the Clear logo are trade marks of Clear Money Limited and they should not be used, nor should any part of the material in this e-mail be copied, without our prior written permission. Clear Money Limited is a limited liability company incorporated in the UK. Registered Office: 84-86 Regent Street, London. W1B 5RR. Telephone: 020 7025 6500. Fax: 020 7025 6501. Corporation No: 03873527. VAT No: 751 8550 22. > ********************************************************************** > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ********************************************************************** Confidentiality: this e-mail and any attachments may be confidential. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use the information in this e-mail and any attachments. Please reply to this e-mail highlighting the error and delete the e-mail and any attachments from your system. Security Warning: please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We suggest that you consider this when e-mailing us. Viruses: although we have taken steps to ensure that this e-mail and attachments are free from any virus we advise that in keeping with good computing practice the recipients should ensure that they are actually virus free. Clear, Clear Money and the Clear logo are trade marks of Clear Money Limited and they should not be used, nor should any part of the material in this e-mail be copied, without our prior written permission. Clear Money Limited is a limited liability company incorporated in the UK. Registered Office: 84-86 Regent Street, London. W1B 5RR. Telephone: 020 7025 6500. Fax: 020 7025 6501. Corporation No: 03873527. VAT No: 751 8550 22. ********************************************************************** -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
