Pragya Kapoor wrote:

  Hi,

> let $node := <result>abc</result> 
> let $strnode := xdmp:quote($node) 
> let $nodeagain := xdmp:unquote($strnode) 
> return 
> $nodeagain/text() 

> The above snippet gives me no results whereas it should give
> me abc

  Just to complete the previous answers, unquote() returns one
(or more) document node:

    document node
     +-> element node (result)
          +-> text node (abc)

so $nodeagain holds the document node, and the path to the text
node is $nodeagain/result/text().  That's the path to use to get
the text node itself.  If you want the string value of the
document, use instead fn:string($nodeagain).

  Note that $node is an element node, then when you serialize it,
there is no way to tell if it was serialized from an element or a
document node.  And when it is parsed, you get a document node.

  Regards,

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




















Any idea, what is wrong in the above code? 

   

Thanks, 

Pragya 



 

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

-----La pièce jointe associée suit-----

_______________________________________________
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