Interesting. Seems like I should be able to do something like this:
<foreach item="Line" in="${config}" delim="=" property="x,y">
<if test="${property::exists( ${x} )}">
<echo message="Read pair ${x}=${y}" />
</if>
</foreach>
But I'm getting an error on the property::exists syntax. Is it
possible to check for the existence of a variable like this?
On 11/7/05, Bill Martin <[EMAIL PROTECTED]> wrote:
> Joel,
>
> You may be able to do this with the <foreach> task. You could use something
> like:
>
> <foreach item="Line" in="myfile.ini" delim="=" property="prop,val">
> <property name="${prop}" value="${val}" />
> </foreach>
> Not sure how easily you could cope with the blank sections though. You may
> need to use a filter chain first to delete the section markers.
>
> HTH,
>
> Bill
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Joel Gwynn
> Sent: 07 November 2005 16:32
> To: [email protected]
> Subject: [Nant-users] Getting properties from an INI
>
> I'd like to import name/value pairs from an ini without regard to
> sections. So for every line with a "this=that", I'd like to end up
> with
> <property name="this" value="that" />
>
> I've currently got a little perl snippet that reads the file and spits
> out xml, which I then include, but I thought there might be a more
> elegant way.
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Nant-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
>
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Nant-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users