Welcome, Guest
Username Password: Remember me

Replace xml values using ant
(1 viewing) (1) Guest
Apache Ant
  • Page:
  • 1

TOPIC: Replace xml values using ant

Replace xml values using ant 1 year, 5 months ago #414

  • tpatil
  • OFFLINE
  • Junior Boarder
  • Posts: 27
  • Points: 5095
  • Karma: 0
  • Honor Medal 2009
I want to replace xml values using ant. Any idea?

e.g
 
<property name="hibernateProperties">
<props>
 
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
</props>
</property>
 


I want to replace the value of hibernate.dialect property using ant.

Re: Replace xml values using ant 1 year, 5 months ago #415

  • rajeshkumar
  • OFFLINE
  • Moderator
  • I love software configuration management
  • Posts: 370
  • Points: 44470
  • Karma: 4
  • Honor Medal 2009
You can opt for any one of these based on senario...

1. if you can your Value as holding place such as...

<prop key="hibernate.dialect">@org.hibernate.dialect.Oracle10gDialect@</prop>


Then u can use Filterset task in Ant...for more info...

ant.apache.org/manual/Types/filterset.html

2. If you have same requirement as you mentioned abobe... then probably you can try ReplaceRegExp ant task.

ant.apache.org/manual/Tasks/replaceregexp.html

Please let me know if this solve your problem. :)
Regards,
Rajesh Kumar
Build and Release Engineer
My Blog: community.scmgalaxy.com/pg/profile/rajeshkumar
  • Page:
  • 1
Time to create page: 0.86 seconds

     
    
Home Forum