In an Ant script, I need to replace the value of javax.persistence.jdbc.url property in the following persistence.xml file.
As mentioned by @Rao, your problem is the xpath not dealing properly with namespaces. The syntax that utilizes ":" hasn't worked consistently for me. As many other XmlTask answers have shown on this site, you need to use the //*[local-name()='persistence'] syntax instead.
Also, attribute can be referenced with the @name syntax.
Last, if you want to replace the value of an attribute, don't use
Please try: