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:
<root>
<a atr="tag1">
<b> one </b>
<b> two </b>
</a>
<a atr="tag2">
<b> three </b>
<b> four </b>
</a>
</root>
If I understand the XMLProperty documentation the attribute value does not
influence the ant property name.
Solutions?
------------------
1. Maybe XMLProperty can have setting where attribute value does influence
property name. For instance the above example could translate into:
root.a.atr=tag1,tag2
root.a.atr_tag1.b=one,two
root.a.atr_tag2.b=three,four
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 [mailto:[EMAIL PROTECTED]]
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
then
> simple load the property file. This is not ideal.
> 2. Use XMLProperty, I however could not get it to handle repetitive tags
as
> 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 :-)
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12045
--
Nicola Ken Barozzi [EMAIL PROTECTED]
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
**********************************************************************
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: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>