Hi,

  Note that depending on what you're trying to achieve exactly, and on
your exact requirements, there might be better solution(s) than
dynamically evaluating an expression provided as a string.

  An of course, one has to be very careful with dynamic evaluation
(e.g. sanitizing the input, etc.)

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 12 May 2015 at 22:04, Joe Bryan wrote:
> Hi Tim,
>
> Try xdmp:value("$doc" || $path).
>
> Thanks.
>
> -jb
>
> From: Tim <[email protected]>
> Reply-To: MarkLogic Developer Discussion <[email protected]>
> Date: Tuesday, May 12, 2015 at 4:01 PM
> To: 'MarkLogic Developer Discussion' <[email protected]>
> Subject: [MarkLogic Dev General] Dynamically creating an xpath expression in
> xquery
>
> Hi Folks,
>
>
>
> What’s the best way to dynamically create and access the value of a field
> give a document and the xpath, e.g.
>
>
>
> let $doc := doc(“/record.xml”)
>
> let $path := “/xyz:root/xyz:name
>
> return the concatenation of the two…
>
>
>
> Thank you!
>
>
>
> Tim M.
>
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to