Dear Brian,

Brian Agnew <[EMAIL PROTECTED]> wrote:
I would suspect that

<generator class="native" />

doesn't have a text node under it. It would be interesting to see if:

<generator class="native"></generator>

had the same problem, btw.
 
I have checked that using replace action it works, because the copy actions needs /text() and replace not. This replace action works in both cases:
 
<xmltask dest="${build.mapping.dir}/ContractTmp.hbm.xml">
   <fileset file="${build.mapping.dir}/Contract.hbm.xml"/>
      <replace path="/hibernate-mapping/class/id/[EMAIL PROTECTED]'native']"
        >
       <![CDATA[<generator class="sequence">
     <param name="sequence">lra_contract_id_seq</param>
     </generator>]]>       
      </replace>
  </xmltask> 
thanks any way,
 
David
David wrote:
Dear members,
 
I have the following task:
 
<my.xmltask dest="${build.mapping.dir}/ContractTmp.hbm.xml">
   <fileset file="${build.mapping.dir}/Contract.hbm.xml"/>
      <copy path="/hibernate-mapping/class/id/[EMAIL PROTECTED]'native']/text()"
            property="pty"
        />
     </replace-->  
  </my.xmltask>
 
in order to match the following structure:
 
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.schinvest.lra.domain.Contract" table="lra_contract" catalog="lra">
        <meta attribute="class-description">Plain old Java object that maps onto the contract table. &lt;br&gt; It was auto-generated on 12-mar-2006 10:25:49 by Hibernate Tools
        3.1.0.beta4.</meta>
        <id name="id" type="int">
            <meta attribute="use-in-tostring">true</meta>
            <column name="id" />
            <generator class="native" />
        </id>
    </class>
</hibernate-mapping>
 
nevertheless I get the following result:
 
Buildfile: P:\LRA\build.xml
prueba:
BUILD FAILED
P:\LRA\build.xml:2126: <xmltask> subtasks failed to find matches
Total time: 4 seconds
 
I have tried with the following possible values for path attribute:
path="hibernate-mapping/class/id/generator/text()
path="hibernate-mapping/class/id/[EMAIL PROTECTED]'native']/text()
path="[EMAIL PROTECTED]'native']/text()
 
with the same result.
 
On my opinion this is a correct Xpath syntax, so why it doesn't match the appropiate _expression_?
 
Thanks in advance,
 
David
 
P.S.: I suspect it could be a problem because the are node name and attributes with the same name, for example: class, id, etc, but I am not sure.

Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.

--   Brian Agnew                  http://www.oopsconsultancy.com  OOPS Consultancy Ltd         brian @ oopsconsultancy.com  Tel: +44 (0)7720 397526  Fax: +44 (0)20 8682 0012


Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2ยข/min with Yahoo! Messenger with Voice.

Reply via email to