Florent's reply is on target. You can find a little more discussion of this issue at http://blakeley.com/wordpress/archives/518 and it comes up almost every time I do code reviews.
-- Mike On 18 Jan 2011, at 07:45 , Tim Meagher wrote: > Why is that? Won't it depend on if you're using mixed content in your XML? > > From: [email protected] > [mailto:[email protected]] On Behalf Of Lee, David > Sent: Tuesday, January 18, 2011 10:41 AM > To: General MarkLogic Developer Discussion > Subject: Re: [MarkLogic Dev General] get the value from a node > > 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] > 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 _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
