Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 79458 invoked from network); 6 Oct 2004 20:09:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Oct 2004 20:09:28 -0000 Received: (qmail 59981 invoked by uid 500); 6 Oct 2004 20:09:18 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 59785 invoked by uid 500); 6 Oct 2004 20:09:17 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 59770 invoked by uid 99); 6 Oct 2004 20:09:17 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [161.107.1.138] (HELO re2xmail.freddiemac.com) (161.107.1.138) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 06 Oct 2004 13:09:16 -0700 Received: from mailgate.freddiemac.com (mailhub1.freddiemac.com [172.24.160.33]) by re2xmail.freddiemac.com (8.12.10+Sun/8.12.9) with ESMTP id i96K2xtC028902 for ; Wed, 6 Oct 2004 16:02:59 -0400 (EDT) Received: from notes-smtp01b.fhlmc.com (he2ntsp30.fhlmc.com [172.26.74.80]) by mailgate.freddiemac.com (8.12.10+Sun/8.8.5) with ESMTP id i96K9EmR001049 for ; Wed, 6 Oct 2004 16:09:14 -0400 (EDT) Received: from notes-mail01d.fhlmc.com ([172.24.125.54]) by notes-smtp01b.fhlmc.com (Lotus Domino Release 5.0.10) with ESMTP id 2004100616091259:173085 ; Wed, 6 Oct 2004 16:09:12 -0400 In-Reply-To: <688A7BC8068D7847AEFB7C8EDAD15C8D20C987@MERCURY.mmlive.com> To: "Ant Users List" Cc: "'user@ant.apache.org'" Subject: Re: XML Parsing Question MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5.1 January 21, 2004 Message-ID: From: bhaskar_karambelkar@freddiemac.com Date: Wed, 6 Oct 2004 16:09:12 -0400 X-MIMETrack: Serialize by Router on NOTES-MAIL01D/SERVERS/FHLMC(Release 6.5.2|June 01, 2004) at 10/06/2004 16:09:11, Serialize complete at 10/06/2004 16:09:11, Itemize by SMTP Server on NOTES-SMTP01B/SERVERS/FHLMC(Release 5.0.10 |March 22, 2002) at 10/06/2004 04:09:12 PM, Serialize by Router on NOTES-SMTP01B/SERVERS/FHLMC(Release 5.0.10 |March 22, 2002) at 10/06/2004 04:09:14 PM, Serialize complete at 10/06/2004 04:09:14 PM Content-Type: text/plain; charset="US-ASCII" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is what I have been doing to arrange my data in XML files. Its a bit crooked way of organizing data but it is read very easily and readily available in properties. e.g. in your case I would change the format of the XML file to something like this. Machine1 Machine2 172.16.1.24 jvm1_stopscript.sh jvm1_startscript.sh jvm3_stopscript.sh jvm3_startscript.sh Notice that the data in becomes the tag in also to uniquely identify different JVMs , you have to make the JVM1 from attribute to a tag. Now to access this code this will create properties e.g. servers.server1=Machine1 , serverdetails.Machine1.ip=172... For accessing specific machine details, the machine name has to come from outside and you can use the property-copy task in ant-contrib For itterating over all machines, use the for or for-each task of ant-contrib. This way you will have a very clean code. all the best bhaskar Hello: I am trying to figure out how to handle the data being passed to me by my IT department. They finally agreed to send me an xml document (see snippet below) and that should have made my life much simpler. Maybe I should describe what I'm trying to do: I am attempting to stop multiple resin jvm's on a given server. The xml document I am getting from IT looks like: Machine1 172.16.1.24 jvm1_stopscript.sh jvm1_startscript.sh jvm3_stopscript.sh jvm3_startscript.sh Machine2 172.16.1.25 jvm2_stopscript.sh jvm2_startscript.sh I've tried the task that Peter Reilly attached to one of the emails about a month ago for an XPath iterator but I can't seem to get it to work with the current ant-contrib tasks. I've also thought about doing this with the xslt task but that also seems like a headache (I can get a comma delimited property for the different jvm names on a given server and then another xslt step to actually pull out the script names that I will then execute -- but that just seems clunky). Has anyone else run into this type of problem or have some other solution that I'm missing? Any recommendations on the xml document (I can get IT to change it if needed). The number of servers/jvms will change depending on any number of factors so it's not always just going to be 2 machines and 3 jvms... In advance, my hair thanks you (I've been pulling it out all morning trying to grasp how to handle this!). Thanks, Brent --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org