Hi John,

Might be a silly question but I don't understand why you want to update
last-modified? It is kept automatically by MarkLogic when you set "keep last
modified" for your database in the administration console. You don't need to
write any extra code to support that.

Would be easier to help you if I knew what it is that you are trying to
achieve?

Nuno


2011/1/14 RobinsonJohn <[email protected]>

>  Hi all,
>
> I am using MarkLogic 4.1-6 standard edition, my operation system is WinXP
> 32-bit, CQ version is v4.1-1.
>
> First, I have used xdmp:document-insert('/test.xml', <test>hello</test>) to
> load a xml file into MarkLogic via CQ. I can verify the document-properties
> as below:
>
> <prop:properties xmlns:prop="*http://marklogic.com/xdmp/property*";>
>  * * <prop:last-modified>*2011-01-14T00:09:37-04:00*</prop:last-modified>
>  </prop:properties>
>
> Then I try to use xdmp:document-set-property function to update the
> prop:last-modified value. See below:
>
> xdmp:document-set-property('/test.xml',
>   <prop:last-modified>{fn:current-dateTime()}</prop:last-modified>
> )
>
> But I encountered the below error:
>
>
> query evaluated in Documents at file::cq/ as 1.0-ml (cq v4.1-1)
>
> [1.0-ml] XDMP-ARG: xdmp:document-set-property("/test.xml",
> <prop:last-modified 
> xmlns:prop="http://marklogic.com/xdmp/property";>2011-01-14T00:33:45.484-04:00</prop:last-modified>)
> -- Invalid argument
> *Stack trace:*
> line 7:
> 6:
> 7: xdmp:document-set-property('/test.xml',
> 8: <prop:last-modified>{fn:current-dateTime()}</prop:last-modified>
> 9: )
>
> Can someone tell me what's my problem?
>
> Then I changed to use xdmp:document-set-properties function to try again,
> it worked!
>
> xdmp:document-set-properties('/test.xml',
>   (<prop:last-modified>{fn:current-dateTime()}</prop:last-modified>)
> )
>
> Thanks,
> John
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to