Hello All,

Could someone advise on the XQUERY syntax for inserting multiple nodes from one 
XQUERY variable into another. Following is a sample code depicting the problem.

#############################
let $xmlNode1 := 
<chapters-source>
   <chapter>Chapter 1</chapter>
   <chapter>Chapter 2</chapter>
   <chapter>Chapter 3</chapter>
   ..
   ..
   ..
</chapters-source>

let $xmlNode2 := 
<chapters-destination>   
   <chapter>Source Chapter 1</chapter>
   <chapter>Source Chapter 2</chapter>
   <chapter>Source Chapter 3</chapter>
</chapters-destination>
.
.
##########################################################

All the <chapter> nodes that exist in $xmlNode1 need to be inserted into 
$xmlNode2 i.e. $xmlNode2 should end up as:

<chapters-destination>   
   <chapter>Source Chapter 1</chapter>
   <chapter>Source Chapter 2</chapter>
   <chapter>Source Chapter 3</chapter>
   <chapter>Chapter 1</chapter>
   <chapter>Chapter 2</chapter>
   <chapter>Chapter 3</chapter>
   ..
   ..
   ..
</chapters-destination>

Thank you in advance.

Regards,
Deshbir



_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to