Move/Copy XMLBean object to another Bean

707 views Asked by At
<xml-fragment>
<currentClinicalNote>
    <patientFamilyHistory disorderName="CurrentCN" id="23423"/>
    <patientFamilyHistory disorderName="CurrentCN1" id="23424"/>
    <patientFamilyHistory disorderName="CurrentCN1" id="23424"/>
  </currentClinicalNote>
</xml-fragment>

I have an XMLBean like above, now I want to replace the node[@id=23423] with a new same type node. How can I do that?

Below is sample code I tried to work..

XmlCursor xmlCursor = cursor.execQuery(nameSpace + pathExpression1);

I found the node with above code, now I have that node in cursor, How do I replace that with another?

Any replies would be appreciated.

1

There are 1 answers

0
Phani On BEST ANSWER

DOM3 is not yet implemented in XML Beans,so need to work with DOM Nodes directly to fetch by finding first child in cursor.