[MarkLogic Dev General] XDMP-CHILDLINK error

Prasanth N V R prasanth.nvr04 at gmail.com
Thu Jan 14 16:28:27 PST 2016


Thanks for your reply Justin.

We usually have fragments created for the node element. So it is considered
as individual document I guess.
Moreover it is the existing design.So probably I will look at that option
as well.

We normally update the category inside the node element, whenever the
latest values are populated.
To achieve this we use xdmp:node-replace().

This is only happening for specific node. For other nodes the node replace
is working fine.

So am not sure, whether the node replace inserted as separate fragment and
caused to break the link from the document or something else.

Thanks,
Prasanth

On Thu, Jan 14, 2016 at 4:18 PM, Justin Makeig <Justin.Makeig at marklogic.com>
wrote:

> Taking a step back from your immediate problem, your document structure
> looks like you're trying to model many atomic entities in a single
> document. Generally in MarkLogic, each atomic item should be its own
> document. This how we've optimized our indexes and I/O. The relational
> database analog would be that documents map to rows, not tables. In your
> case, you'd have 4,000+ individual documents, each with <node> root
> elements. (Even better would be to give a semantically meaningful name to
> your node elements, for example, "product" or "user".)
>
> If you can provide more detail around what you're trying to accomplish we
> might be able to provide more/better guidance.
>
> Justin
>
>
> --
> Justin Makeig
> Director, Product Management
> MarkLogic
>
>
> On Jan 14, 2016, at 10:36 AM, Prasanth N V R <prasanth.nvr04 at gmail.com>
> wrote:
>
> Hi,
>
> I have 4000+ nodes in a document. Below is the structure of the document
> and loaded under "/test/testDocument.xml".
>
> <rootnode>
>     <node>
>         <name>a</name>
>         <number>1234</name>
>         <category>A</name>
>     </node>
>      <node>
>         <name>b</name>
>         <number>1234</name>
>         <category>B</name>
>     </node>
>     <node>
>         <name>c</name>
>         <number>1234</name>
>         <category>C</name>
>     </node>
> :
> :
> </rootnode>
>
> If a node name matches my input, then I will do a xdmp:node-replace of
> that.
> let $result := cts:search(my search query goes here)
> return xdmp:node-replace($result/category,<category>newCategory</category>
>
> When I try to do node replace, am getting error like,
> *XDMP-CHILDLINK:* (err:XPTY0004) *Invalid child link node*
> fn:doc("/test/testDocument.xml")/rootnode/node[257]
>
> Your help is much appreciated!
>
> Thanks,
> Prasanth
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160114/5af123b4/attachment-0001.html 


More information about the General mailing list