[MarkLogic Dev General] how to find uri of a document associated with node

Aaron Redalen Aaron.Redalen at marklogic.com
Mon Oct 12 10:07:14 PDT 2009


Rahul, one additional suggestion:

Although fn:base-uri will typically return the desired result, it's safer to use the MarkLogic function xdmp:node-uri. The difference is that fn:base-uri returns the base-uri of the node to which the document belongs, which can actually be defined in the document to any arbitrary URI, and not necessarily the URI of the document, whereas xdmp:node-uri will always give you the URI of the document in which the node exists.


Aaron

________________________________
From: general-bounces at developer.marklogic.com [general-bounces at developer.marklogic.com] On Behalf Of Rahul Saluja [rahul.saluja at gmail.com]
Sent: Monday, October 12, 2009 7:51 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] how to find uri of a document associated with node

Hi All,

Thank you for your responses i just found that i have got what i have been looking for its just that the element which is been returned by my query can its self be used as an arguement to fn:base-uri($arg as node()?) as xs:anyURI .

cheers

On Mon, Oct 12, 2009 at 5:13 PM, Lee, David <dlee at epocrates.com<mailto:dlee at epocrates.com>> wrote:
an element is a node.

From: general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com> [mailto:general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com>] On Behalf Of Rahul Saluja
Sent: Monday, October 12, 2009 7:43 AM

To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] how to find uri of a document associated with node

well if my function returns an element then how can i use that element to get node, i am sorry if i am asking silly question, as i have noot been very much into xml lately.

regards
Rahul
On Mon, Oct 12, 2009 at 5:11 PM, Lee, David <dlee at epocrates.com<mailto:dlee at epocrates.com>> wrote:
fn:base-uri($arg as node()?) as xs:anyURI?
might do the trick
http://www.w3.org/TR/xpath-functions/#func-base-uri


From: general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com> [mailto:general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com>] On Behalf Of Rahul Saluja
Sent: Monday, October 12, 2009 7:33 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] how to find uri of a document associated with node

Hi Frank,

Appreciate your quick response, and is there any api using which we can find node associated with particular element.
On Mon, Oct 12, 2009 at 4:52 PM, Frank Sanders <Frank.Sanders at marklogic.com<mailto:Frank.Sanders at marklogic.com>> wrote:
Rahul,

You can try either of the below, one of them should give you what you’re looking for.

http://developer.marklogic.com/pubs/4.1/apidocs/AccessorBuiltins.html#fn:base-uri

http://developer.marklogic.com/pubs/4.1/apidocs/Ext-6.html#xdmp:node-uri

-fs


From: general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com> [mailto:general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com>] On Behalf Of Rahul Saluja
Sent: Monday, October 12, 2009 12:20 PM
To: general at developer.marklogic.com<mailto:general at developer.marklogic.com>
Subject: [MarkLogic Dev General] how to find uri of a document associated with node

Helo all,

is there any api available using which i can find the uri of a document from the node returned back from my search application.


Regards
Rahul Saluja

_______________________________________________
General mailing list
General at developer.marklogic.com<mailto:General at developer.marklogic.com>
http://xqzone.com/mailman/listinfo/general


_______________________________________________
General mailing list
General at developer.marklogic.com<mailto:General at developer.marklogic.com>
http://xqzone.com/mailman/listinfo/general


_______________________________________________
General mailing list
General at developer.marklogic.com<mailto:General at developer.marklogic.com>
http://xqzone.com/mailman/listinfo/general


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20091012/0ad8a134/attachment.html


More information about the General mailing list