ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Baker <>
Subject RE: Read repetitive tags as properties from an XML file
Date Tue, 27 Aug 2002 15:18:38 GMT
Hi Nicola

Thanks for the patch. Some further questions:

1. Do i need to try it out before it gets into a nightly build?
2. I've examined the source and was wondering what will happen to the
following XML:
<a atr="tag1">
	<b> one </b>
	<b> two </b>
<a atr="tag2">
	<b> three </b>
	<b> four </b>

If I understand the XMLProperty documentation the attribute value does not
influence the ant property name. 

1. Maybe XMLProperty can have setting where attribute value does influence
property name. For instance the above example could translate into:
root.a.b=?maybe? one,two,three,four

2. Maybe a simple XPath like task would be more appropriate.

Any thoughts/advice?

-----Original Message-----
From: Nicola Ken Barozzi []
Sent: 26 August 2002 17:14
To: Ant Users List
Subject: Re: Read repetitive tags as properties from an XML file

Simon Baker wrote:
> Problem:
> Retrieve a number of properties from a given XML file.
> Some tags are repeated in the XML file, for instance:
> <b>
>   <a> one </a>
>   <a> two </a>
>   <a> three </a>
> </b>
> The property 'b.a' in ant should be set to 'one,two,three'
> Known solutions:
> 1. With xsl I have managed to convert the xml file to property file and
> simple load the property file. This is not ideal.
> 2. Use XMLProperty, I however could not get it to handle repetitive tags
> in the above example.
> 3. Write my own ant command, to retrieve repetitive tags.
> Any better ideas?

Added a patch to do as you ask :-)

Nicola Ken Barozzi         
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

Confidentiality: this e-mail and any attachments may be confidential. If you are not the intended
recipient you should not read, copy, distribute, disclose or otherwise use the information
in this e-mail and any attachments. Please reply to this e-mail highlighting the error and
delete the e-mail and any attachments from your system.

Security Warning: please note that this e-mail has been created in the knowledge that Internet
e-mail is not a 100% secure communications medium. We suggest that you consider this when
e-mailing us.

Viruses: although we have taken steps to ensure that this e-mail and attachments are free
from any virus we advise that in keeping with good computing practice the recipients should
ensure that they are actually virus free.

Clear, Clear Money and the Clear logo are trade marks of Clear Money Limited and they should
not be used, nor should any part of the material in this e-mail be copied, without our prior
written permission. Clear Money Limited is a limited liability company incorporated in the
UK. Registered Office: 84-86 Regent Street, London. W1B 5RR. Telephone: 020 7025 6500. Fax:
020 7025 6501. Corporation No: 03873527. VAT No: 751 8550 22.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message