This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: A simple document with URI root /mini :) | |
xdmp:document-insert("/mini/test-25-1-1.xml", <test>document mini 1</test>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version '1.0-ml'; | |
(: common util module :) | |
xdmp:document-insert("/SAMPLE/MODULE/sample-library.xqy", | |
text{ ' | |
xquery version "1.0-ml"; | |
module namespace minilibrary = "minilib"; | |
declare variable $dnamespace := "http://www.sample.net/schema/datahub"; | |
declare function get-metadata() as node() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version '1.0-ml'; | |
(: evaluate this against the database specified | |
in the trigger definition minitrigger in this example) | |
:) | |
xdmp:document-insert("/action/trg-mini-create-action.xqy", | |
text{ " | |
xquery version '1.0-ml'; | |
import module namespace trgr='http://marklogic.com/xdmp/triggers' | |
at '/MarkLogic/triggers.xqy'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
import module namespace trgr="http://marklogic.com/xdmp/triggers" | |
at "/MarkLogic/triggers.xqy"; | |
trgr:create-trigger("minitrigger", "Mini trigger example", | |
trgr:trigger-data-event( | |
trgr:directory-scope("/mini/", "1"), | |
trgr:document-content("create"), | |
trgr:post-commit()), | |
trgr:trigger-module(xdmp:database("minimodule"), "/", "/action/trg-mini-create-action.xqy"), fn:true(), xdmp:default-permissions() ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare variable $xslt := | |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |
<xsl:output method="xml" /> | |
<xsl:template match="@*|node()"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*|node()"/> | |
</xsl:copy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cts:search(doc(), | |
cts:and-query( | |
( | |
cts:element-pair-geospatial-query(xs:QName("location"), xs:QName("lat"), xs:QName("long"), cts:circle(1000, cts:point(37.655983, -122.425525))), | |
cts:element-range-query(xs:QName("alt"), "<", 4) | |
))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<place> | |
<name>sixthlayer</name> | |
<uri>place6.xml</uri> | |
<location> | |
<lat>37.655983</lat> | |
<long>-122.425525</long> | |
<alt>6</alt> | |
</location> | |
</place> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var marklogic = require("marklogic"); | |
var conn = require("./env.js").connection; | |
//create DatabaseClient | |
var db = marklogic.createDatabaseClient(conn); | |
var q = marklogic.queryBuilder; | |
db.documents.query( | |
q.where( | |
q.byExample( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var marklogic = require("marklogic"); | |
var conn = require("./env.js").connection; | |
//create DatabaseClient | |
var db = marklogic.createDatabaseClient(conn); | |
var q = marklogic.queryBuilder; | |
db.documents.query( | |
q.where( | |
q.byExample( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var marklogic = require("marklogic"); | |
var conn = require("./env.js").connection; | |
//create DatabaseClient | |
var db = marklogic.createDatabaseClient(conn); | |
var q = marklogic.queryBuilder; | |
db.documents.query( | |
q.where( | |
q.byExample( |
NewerOlder