ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: XmlProperty - can I specify the property value delimiter?
Date Tue, 23 Oct 2007 06:01:25 GMT
Manual doesnt say anything to delimiters (which in general mean "there is no") and source doesnt
have one ...

XmlProperty.java:0461:     private void addProperty (String name, String value, String id)
{
XmlProperty.java:0468:         if (addedAttributes.containsKey(name)) {
XmlProperty.java:0477:             value = (String) addedAttributes.get(name) + "," + value;
--------------------------------------------------------------------------------^^^
XmlProperty.java:0489:     } 



If you want to iterate over this list with <antcontrib:for> you can specify a delimiter
there (but I think it defaults to comma ...)

You can also use <antcontrib:propertregex> for changing the delimiter. Something like
this:
  <antcontrib:propertregex
      property="newlist"
      input="${oldlist}"
      regexp=","
      replace="${newdelimiter}"
      global="true"
  />



Jan


>-----Urspr√ľngliche Nachricht-----
>Von: J MacKay [mailto:jm.junkmail@yahoo.com] 
>Gesendet: Dienstag, 23. Oktober 2007 01:22
>An: user@ant.apache.org
>Betreff: XmlProperty - can I specify the property value delimiter?
>
>I just started using ant and have a question about XMLProperty.   
>
><!-- sample-file.xml -->
><root-tag>
>  <x>x1</x>
>  <x>x2</x>
></root-tag>
>
>Using the sample above, XMLProperty will transform"x" into a 
>comma separated list of values:    
>     root-tag.x=x1,x2
>
>Is there any way to specify the delimiter used (like a "|") ? 
>ie return this instead
>  root-tag.x=x1|x2
>
>
> __________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>

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


Mime
View raw message