[MarkLogic Dev General] Getting Value of Filename

Betty Harvey harvey at eccnet.com
Wed Jan 14 16:22:09 PST 2009


Bindu:

Thank you so much!!! Works like a charm|-)!

Betty

<quote who="Bindu Wavell">
> If you want to get the filename of all documents that match your
> filter... you might try something like:
>
> for $doc in fn:doc()//myelement[@id = "abcd"]
> return xdmp:node-uri($doc)
>
> I believe you can pass a document or any materialized element to
> xdmp:node-uri() and it will return the fully qualified uri to your
> document...
>
> If you just want the filename without path you might want something
> more like:
>
> ...
> return fn:tokenize(xdmp:node-uri($doc), "/")[last()]
>
>
>
> -- Bindu
>
> On Jan 14, 2009, at 4:45 PM, Betty Harvey wrote:
>
>>
>> <quote who="Bindu Wavell">
>>> Are you looking for xdmp:node-uri()?
>>
>> I am not sure if is the right function.  The example for the
>> documentation is:
>>
>> xdmp:node-uri(doc("http://marklogic.com/document"))
>>
>> The document name is unknown. I want to give an XPath
>> and get the filename.  For example if I didn't know the
>> element I could use the root() function.
>>
>> /root()[descendant::myelement/@id = "abcd"]
>>
>>
>>
>>>
>>> On Jan 14, 2009, at 4:07 PM, Betty Harvey wrote:
>>>
>>>> I have a dataset that points to xml filenames instead of internal
>>>> ID's.
>>>> Example:
>>>>
>>>> <myref refid="12345">  Points to 12345.xml <mydata id="abc456">
>>>>
>>>> There is possibly thousands of XML instances that point to
>>>> 12345.xml.
>>>> I want to find all the instances that point to 12345.xml.
>>>> Unfortunately,
>>>> there isn't anything in 12345.xml that describes it's filename.
>>>>
>>>> TIA!
>>>>
>>>> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
>>>> \/
>>>> Betty Harvey                         | Phone: 410-787-9200 FAX: 9830
>>>> Electronic Commerce Connection, Inc. |
>>>> harvey at eccnet.com                    | Washington,DC SGML/XML Users
>>>> Grp
>>>> URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
>>>> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
>>>>
>>>> _______________________________________________
>>>> General mailing list
>>>> General at developer.marklogic.com
>>>> http://xqzone.com/mailman/listinfo/general
>>>
>>
>>
>> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
>> Betty Harvey                         | Phone: 410-787-9200 FAX: 9830
>> Electronic Commerce Connection, Inc. |
>> harvey at eccnet.com                    | Washington,DC SGML/XML Users
>> Grp
>> URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
>> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
>>
>


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey                         | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
harvey at eccnet.com                    | Washington,DC SGML/XML Users Grp
URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/



More information about the General mailing list