[Xmltask-users] Replace text in an xml document containing namespace
Brought to you by:
bagnew
From: Abram A. <aa...@cf...> - 2011-01-28 01:27:18
|
I am trying to do a simple replace in an xml document where the root node has a namespace. Here's my latest attempt: <xmltask preservetype="true" report="true" source="${DEPLOY_DIR}/installer/update.xml" dest="${DEPLOY_DIR}/installer/update.xml"> <replace path="//*[local-name()='update']/exe/version/text()" withXML="1.0.${build.number}"/> </xmltask> The XML document looks like: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <update xmlns="http://ns.riaspace.com/air/framework/update/description/1.1"> <exe> <version>1.0.1</version> </exe> </update> For the life of me I cannot get it to replace the <version> text with the text I supply. I've tried all sorts of xPath, but it simply does not find it. Now, if I remove the namespace and use this as the path: /update/exe/version/text() It works fine. Problem is the xml file needs to have the namespace. Any ideas? --Abram |