[MarkLogic Dev General] RE: document-get() couldn't find the
Kelly.Stirman at marklogic.com
Mon May 25 14:19:57 PDT 2009
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.
Date: Mon, 25 May 2009 07:21:50 +0100
From: "Baranov, Ivan - Moscow" <ibaranov at wiley.com>
Subject: RE: [MarkLogic Dev General] document-get() couldn't find the
To: General Mark Logic Developer Discussion
<general at developer.marklogic.com>
<D2E91026C051394EB15AB8B0F20CBE9101F7B88A27 at CHI-MB.wiley.com>
Content-Type: text/plain; charset="us-ascii"
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?
More information about the General