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
{ | |
"hop": { | |
"type": "Perle (DE)", | |
"uri": "/hop/perle-de.json", | |
"use": "boil", | |
"time": { | |
"units": "min", | |
"amount": 60 | |
}, | |
"aau": 4.5 |
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
let $seq1 := (: some sequence of values :) | |
let $seq2 := (: some sequence of values :) | |
return fn:distinct-values($seq1[fn:not(.=$seq2)]) |
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
import module namespace mem = "http://xqdev.com/in-mem-update" at | |
"/MarkLogic/appservices/utils/in-mem-update.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
declare function local:change($node) | |
{ | |
typeswitch($node) | |
case element(change-me) return | |
element { xs:QName("dmc:" || fn:local-name($node)) } { | |
$node/@*, | |
$node/node() ! local:change(.) | |
} | |
case element(name) return element name { "redacted" } | |
case element(count) return |
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 functx = "http://www.functx.com" at "/MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy"; | |
declare namespace dmc = "dmc"; | |
declare variable $stuff := | |
<doc> | |
<content> | |
<change-me my-attr="look at me">some text</change-me> |
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
declare namespace dmc = "dmc"; | |
declare function local:change($node) | |
{ | |
typeswitch($node) | |
case element(change-me) return | |
element { xs:QName("dmc:" || fn:local-name($node)) } { | |
$node/@*, | |
$node/node() ! local:change(.) | |
} |
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 $stuff := | |
<doc> | |
<content> | |
<change-me my-attr="look at me">some text</change-me> | |
<count>1</count> | |
<name>Fred Smith</name> | |
</content> | |
</doc>; |
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(fn:doc(), cts:and-query(( | |
cts:period-range-query( | |
"valid", | |
"ALN_CONTAINED_BY", | |
cts:period(xs:dateTime("2015-01-09T00:00:00"), | |
xs:dateTime("2015-01-11T23:59:59.99Z"))), | |
cts:period-range-query( | |
"system", | |
"ALN_CONTAINED_BY", | |
cts:period(xs:dateTime("2015-01-13T13:00:00"), |
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
{ | |
"com.marklogic.samplestack.domain.Contributor": { | |
"aboutMe": "Twitter: [@maryadmin](http://twitter.com/maryadmin) Disclaimer: This is not me. MaryAdmin _doesn't exist_!", | |
"displayName": "MaryAdmin", | |
"id": "9611450a-0663-45a5-8a08-f1c71320475e", | |
"location": "Barrow", | |
"originalId": null, | |
"reputation": 100, | |
"userName": "mary@example.com", | |
"voteCount": 5, |
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
function highlight(node, query) { | |
var match = 0; | |
var threshold = 2; | |
// NodeBuilder is used to "inject" highlights into the flow of the matched nodes. | |
var builder = new NodeBuilder(); | |
function callback(builder, text, node, queries, start) { | |
// Keep track of the number of matches | |
match++; | |
// Inject a new element in context to highlight the match | |
builder.startElement("b") |
NewerOlder