I'd suggest

  let $var2 := $var1/data/state/string()

 

so the result is a string, not a text node.

 

 

----------------------------------------

David A. Lee

Senior Principal Software Engineer

Epocrates, Inc.

[email protected] <mailto:[email protected]> 

812-482-5224

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Harry
Bakken
Sent: Tuesday, January 18, 2011 10:22 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] get the value from a node

 

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
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain 
> confidential or privileged information. If you are 
> not the intended recipient, any dissemination, use, 
> review, distribution, printing or copying of the 
> information contained in this e-mail message 
> and/or attachments to it are strictly prohibited. If 
> you have received this communication in error, 
> please notify us by reply e-mail or telephone and 
> immediately and permanently delete the message 
> and any attachments. Thank you
> 
> 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to