Hi..!
We are planning to store the metadata and orginal xml content in the
following format, so that a search can be performed on both original
content and metadata at one shot.
<wrapper>
<metadata>
<metdata content>
</metadata>
<original-content>
<!-- original content goes here -->
</original-content>
</wrapper>
The XQUERY function I have created (given below) receives document URI
and meta data (as a node)
define function load-document($document_uri as xs:string, $metadata
as node()
{
let $document_name := "abc.xml"
return
xdmp:document-load($document_uri,<options
xmlns="xdmp:document-load"><uri>{$document_name}</uri></options>),
xdmp:document-insert($document_name,<wrapper>{$metadata}<original-conten
t>{fn:doc($document_name)/node()}</original-content></wrapper>)
}
In the first function xdmp:document-load I am creating the document from
the URI received and in the
second function xdmp:document-insert I am trying to retrieve original
content as a node
(using fn:doc($document_name)/node() ) and then attach metadata to
it and then load it into marklogic, but as the data will not be
committed untill the control exits the module, even after the first
function document-load gets executed when I try to retrieve the original
content as a node I receive nothing.
Is there any function like commit which could solve the problem or else
is there any work around for this other than having two different
functions and invoking them one after another from front end.
Thanks in advance.
Regards,
Pradeep Maddireddy
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general