ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronald Albury <>
Subject xmlproperty not expanding
Date Wed, 06 Jun 2012 13:23:41 GMT
My understanding is that the xmlproperty task is supposed to expand
references to external properties just like the regular property task
does.  However, it does not seem to work for me.  The output below is from
ant 1.7 - however I have downloaded the latest ant and it has the same

*Here is my ant file:*
<project name="test" default="show">

    <property name="global.demo" value="i am global demo"/>

    <xmlproperty keepRoot="true" file="props.xml"/>
    <property file=""/>

    <target name="show">
        <echo>ant.version = ${ant.version}</echo>
        <echo> = ${}</echo>
        <echo>java.vendor = ${java.vendor}</echo>
        <echo>java.version = ${java.version}</echo>

        <echo message="cmd.demo property = ${cmd.demo}"/>
        <echo message="global.demo property = ${global.demo}"/>
        <echo message="props.demo property = ${props.demo}"/>
        <echo message="xml.demo property = ${xmlTest.demo}"/>

        <echo message="props.cmd property = ${props.cmd}"/>
        <echo message=" property = ${}"/>

        <echo message="xml.cmd property = ${xmlTest.cmd}"/>
        <echo message=" property = ${}"/>


*Here is the regular property file:*
props.demo = This is properties demo
props.cmd = This is properties with cmd ${cmd.demo} = This is properties with global ${global.demo}

*Here is the xml property file:*
    <demo>This is xmlTest demo</demo>
    <cmd>This is xmlTest with cmd ${cmd.demo}</cmd>
    <global>This is xmlTest with global ${global.demo}</global>

*Here is the output  when I run with -Dcmd.demo="i am command demo" *
     [echo] ant.version = Apache Ant version 1.7.1 compiled on June 27 2008
     [echo] = 1.6
     [echo] java.vendor = IBM Corporation
     [echo] java.version = 1.6.0
     [echo] cmd.demo property = i am command demo
     [echo] global.demo property = i am global demo
     [echo] props.demo property = This is properties demo
     [echo] xml.demo property = This is xmlTest demo
     [echo] props.cmd property = This is properties with cmd i am command
     [echo] property = This is properties with global i am
global demo
     [echo] xml.cmd property = This is xmlTest with cmd ${cmd.demo}
     [echo] property = This is xmlTest with global ${global.demo}

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