Thank you very much. It works, the problem was the use of namespace and the xml didn’t throw any error or warning.

If any body is interested on how it should look my xpath query:


        <xmltask source="${basedir}/ejb-jar.xml" dest="${basedir}/ejb-jar.xml">

            <replace path="//*[local-name()='env-entry-name' and text()='ConfigurationFolder']/parent::*[1]/*[local-name()='env-entry-value']/text()" withText="WORKS!!"/>

            <replace path="//*[local-name()='env-entry-name' and text()='ScanInterval']/parent::*[1]/*[local-name()='env-entry-value']/text()" withText="777"/>



 All the best, Lucian!


From: Brian Agnew []
Sent: 24 martie 2005 11:17
To: Lucian Liviu Furtos
Subject: Re: [Xmltask-users] problem parsing xml with schema


Without more detailed info I suspect you have a naming issue (I haven't validated your xpath references below). From the examples page:

Identifying elements with namespaces. This example copies the
node element which is tied to a namespace via an xmlns directive. See this article for namespace-related issues.

    <xmltask source="input.xml">
      <copy path="//*[local-name()='node']" property="count"/>

So that may be of relevance. If not, can you forward any exceptions or errors that xmltask is giving you ?



Lucian Liviu Furtos wrote:



 I have a problem parsing an ejb-jar.xml with xmltask. It has a long schema definition. If I remove that definition everything is working fine. Can you tell me what is the problem?


 This is some part of ejb-jar.xml :


 <?xml version="1.0" encoding="UTF-8"?>


<ejb-jar xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="2.1">


   <description><![CDATA[No Description.]]></description>

   <display-name>Generated by XDoclet</display-name>




      <!-- Session Beans -->


         <description><![CDATA[Description for AccountingImporter]]></description>




 And the script:


        <xmltask source="${basedir}/${temp.module.dir}/ejb-jar.xml" dest="${basedir}/${temp.module.dir}/ejb-jar.xml">

            <replace path="//env-entry-name[text()='ConfigurationFolder']/parent::*[1]/env-entry-value/text()" withText="CONFIGDIR"/>

            <replace path="/ejb-jar/enterprise-beans/session/env-entry/env-entry-name[text()='ScanInterval']/parent::*[1]/env-entry-value/text()" withText="SCAN INTERVAL"/>


Brian Agnew        
OOPS Consultancy Ltd         brian @
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012