On Tue, Jan 18, 2011 at 7:22 AM, Harry Bakken <[email protected]> wrote:

> do you mean,
> let $var2 := $var1/data/state/text()
> On Jan 18, 2011 8:17 AM, "Santhosh Raj" <[email protected]> wrote:
> > Hi All
> >
> > I have doc(some-uri) and the xpath in two separate variables can I get
> the
> > value of the element Its like
> >
> > let $var1 := doc("abc.xml")/content
> > let $var2 := /data/state
> >
> > final query will assume to work like what exactly the query
> > doc("abc.xml")/content/data/state will do
> >
> > I need to find the fn:data() of the "state" tag.Can any one please
> suggest
> > the options without using xdmp:eval() as because in actual query I have
> > local variables and in eval I need to pass the value through external
> > variables.
> >
> >
> > thanks in advance
> > Santhosh Rajasekaran
>


hmm, I think OP means to evaluate a dynamic path without using xdmp:eval()

if that's the case xdmp:value() is awfully useful:

       xdmp:value(fn:concat('doc("abc.xml")/content', '/data/state'))

or..

       doc("abc.xml")/content/xdmp:value($var2)
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to