[MarkLogic Dev General] XQUERY question - Inserting nodes in memory
Deshbir
deshbir.dugal at comprotechnologies.com
Mon Feb 16 05:55:55 PST 2009
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
More information about the General
mailing list