ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Bain <Bre...@mmlive.com>
Subject XML Parsing Question
Date Wed, 06 Oct 2004 19:56:18 GMT
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:
<servers>
    <server>
        <name>Machine1</name>
        <ip>172.16.1.24</ip>
        <jvm name="JVM1">
        <scripts>
             <jvmStop>jvm1_stopscript.sh</jvmStop>
             <jvmStart>jvm1_startscript.sh</jvmStart>
        </scripts>
        </jvm>
        <jvm name="JVM3">
        <scripts>
             <jvmStop>jvm3_stopscript.sh</jvmStop>
             <jvmStart>jvm3_startscript.sh</jvmStart>
        </scripts>
        </jvm>
    </server>
    <server>
        <name>Machine2</name>
        <ip>172.16.1.25</ip>
        <jvm name="JVM2">
        <scripts>
             <jvmStop>jvm2_stopscript.sh</jvmStop>
             <jvmStart>jvm2_startscript.sh</jvmStart>
        </scripts>
        </jvm>
    </server>
</servers>
 
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message