I have a not good method like this:
Suppose your xml file uri as “/test.xml”,the content you want to insert is
assigned to $content
Element{“Sample”}
{
fn:doc(“test.xml”)/*[fn:name() ne “sample5”],
$content/sample/*
}
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Abhishek53 S
Sent: 2011年6月15日 17:06
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Node Replace
Hi All
I have my content XML as follows
<sample>
<sample1>A</sample1>
<sample2>B</sample2>
<sample3>C</sample3>
<sample4>D</sample4>
<sample5>E</sample5>
<sample6>F</sample6>
</sample>
with all the possible hierarchies. The document is already present in marklogic
repository. If the same document is going to be updated I need to replace the
entire old content XML with the new one except the element <sample5>. What is
best possible way to achieve this in a single transaction.
It is like getting the <sample5> element value from the older one setting to
the new coming content XML and the ingesting to marklogic but the problem is
there for on the fly XML modification.
Abhishek Srivastav
Systems Engineer
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com<mailto:abhishek5...@tcs.com>
Website: http://www.tcs.com<http://www.tcs.com/>
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are
not
to copy, disclose, or distribute this e-mail or its contents to any other
person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has
taken
every reasonable precaution to minimize this risk, but is not liable for any
damage
you may sustain as a result of any virus in this e-mail. You should carry out
your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this
e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general