ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject xmltask xpath bug ?!, buffer to property ?!
Date Tue, 10 Jul 2007 12:40:05 GMT

Hi,

i have a problem with xmltask 1.14 and xpath.
i want a nodelist as property.

the relevant xml section looks like that =

<module>
<modul.0>
<name>modul_A</name>
<label>020407_134553535</label>
<buildpossible>N</buildpossible>
</modul.0>
<modul.1>
<name>modul_B</name>
<label>to_be_build</label>
<buildpossible>J</buildpossible>
</modul.1>
</module>

with the xpath expression =

//module/*/name/text()

i expect to get the nodelist containing both modulnames

modul_A
modul_B


but with =

<xmltask source="props.xml">
  <copy path="count(//module/*/name/text())" property="name.count"/>
  <copy path="//module/*/name/text()" property="moduls.text"/>
</xmltask>
<echo>
  $${name.count} = ${name.count}
  $${moduls.text} = ${moduls.text}
 </echo>

i get only =

     [echo] ${name.count} = 2
     [echo] ${moduls.text} = modul_A

Is that a bug  or works as designed ?
i expected to get the nodelist with all matches

i believe it's because the property ${moduls.text} is set
at first match - which is modul_A - and the second match
get's not appended to that, because once set a (normal) property
is immutable in ant.

so i tried a buffer =

<target name="init">
  <xmltask source="props.xml">
    <copy path="count(//module/*/name/text())" property="name.count"/>
    <copy path="//module/*/name/text()" buffer="moduls.text"
append="true"/>
    <print buffer="moduls.text"/>
   </xmltask>

that gives me =

[xmltask] { buffer 'moduls.text' output
  [xmltask] modul_A
  [xmltask] } buffer 'moduls.text' output
  [xmltask] { buffer 'moduls.text' output
  [xmltask] modul_B
  [xmltask] } buffer 'moduls.text' output

so both modulnames are contained now, but how to get
that buffer in a property ?

Any ideas ?

Regards, Gilbert





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message