Van,

You're right - you cannot assign the output type when using fn:doc(). You need 
to set it correctly when you load the document, which you can do one of two 
ways:

1) go to the mimetype settings for your server and make .dat an xml document 
format. There are three options (text, xml, binary), and if the file format is 
not listed, the default is binary. I believe this is what occurred with your 
.dat file.

2) explicitly using xdmp:document-load() in the options node at the element 
<format/>.

For more info on this, see section 10.2 of the developer guide: 
http://developer.marklogic.com/pubs/4.0/books/dev_guide.pdf

I would also recommend reading section 10.1, which describes how the different 
document formats are treated for indexing. If you were having issues searching 
your .dat files, or issuing XPath expressions against them, it is because 
documents that are stored as binary are not indexed, and cannot be queried with 
XPath (even if they are *actually* XML).

Hope this helps.

Kelly

Message: 2
Date: Mon, 25 May 2009 07:21:50 +0100
From: "Baranov, Ivan - Moscow" <[email protected]>
Subject: RE: [MarkLogic Dev General] document-get() couldn't find the
        existing        file
To: General Mark Logic Developer Discussion
        <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Danny

Yes you're right but the problem is that fn:doc() does not allow to explicitly 
assign a document the XML format (at least I couldn't find any information on 
it). When I try to get, say, *.dat file from the database, its content is 
concerned as a binary() node even when it actually contains only XML tags. Is 
there any way to solve this?

Van

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

Reply via email to