ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Find value between xml tags
Date Thu, 18 Nov 2004 13:49:59 GMT
"Sanjeev_Das" <> wrote ..
> Hi All,
> I need to find out the value present in between the xml tags. Is there
> any specific task in Ant to do so? If not can anyone suggest a
> workaround.

you could use antcontrib's regular expression capabilities in its propertyregex task.....the
following is untested though!

<target name="matchxml" description="match xml using regular expression">

<!-- load xml file into property -->
<loadfile property="xml.conf"

<!-- match <test> </test> element -->
<propertyregex property="output"
              casesensitive="false" />

<!-- print out the value -->
<echo message="${output}"/>


note my regex is untested...though it should be something like this...cant remember how I
dealt with the entity issues before.

hth, Jim Fuller

View raw message