|
|
xdmp:document-get(
|
|
$location as xs:string,
|
|
[$options as node()]
|
| ) as node() |
|
 |
Summary:
Returns the document in the XML file specified by $location.
|
Parameters:
$location
:
The location of the input document. If the scheme of the location is
HTTP (that is, if the string starts with "http://"), then the document is
requested over HTTP. Otherwise, the document is fetched from the local
filesystem. On the filesystem, the path can be fully qualifed or relative.
Relative pathnames are resolved from the directory in which
MarkLogic Server is installed.
|
$options
(optional):
The options node for getting this document. The default value is ().
The node for the xdmp:document-get options must be in the
xdmp:document-get namespace. This parameter can also include
option elements in the xdmp:http namespace for the HTTP
parameters.
The xdmp:document-get options include:
<default-namespace>
- The namespace to use if there is no namespace at the root node of
the document. The default value is "".
<repair>
- A value of "full" specifies that malformed XML content be repaired.
A value of "none" specifies that malformed XML content is rejected.
This option has no effect on binary or text documents.
<format>
- A value of
text specifies to get the document as a
text document, regardless of the URI specified. A value of
binary specifies to get the document as a binary
document, regardless of the URI specified. A value of xml
specifies to get the document as an XML document, regardless of the
URI specified.
<lang>
- A value of "en" specifies that the document is in english.
|
|
Usage Notes:
If no format is specified in $options, it is specified by the
document content type specified by the extension of the document URI.
The mimetype extensions and corresponding content types are set in the
Admin console.
If neither "repair" option is specified, malformed XML content
will be repaired.
|
Example:
xdmp:document-get("myDocument.xml")
=> the xml contained in myDocument.xml,
for example, <myDocument/>
|
Example:
xdmp:document-get("myDocument.html",
<options xmlns="xdmp:document-get">
<repair>full</repair>
</options>)
=> myDocument.html as an XML document that has gone
through any needed tag repair
|
Example:
xdmp:document-get("http://myCompany.com/file.xml",
<options xmlns="xdmp:document-get"
xmlns:http="xdmp:http">
<format>xml</format>
<http:authentication>
<username>user</username>
<password>pass</pass>
</http:authentication>
</options>)
=> gets an XML document named file.xml, sending the
authentication credentials user/pass to the
http://myCompany.com server
|
|
|