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
{ | |
"p-pipeline": [ | |
{ | |
"name": "my-pipeline", | |
"p-import": "../test.xpl", | |
"p-source": { | |
"sequence": false | |
}, | |
"p-results": {}, | |
"myuri": "http://www.example.org/test.xslt", |
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"; | |
(: extracts //p from web page and tokenizes to lower case words :) | |
declare function local:generate-corpus( | |
$uri | |
){ |
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
(: -------------------------------------------------------------------------- :) | |
(: XSLT and XQuery Serialization 3.0 :) | |
(: -------------------------------------------------------------------------- :) | |
declare | |
%rxq:produces('text/plain') | |
%output:method('text') | |
%output:encoding('iso-8859-1') | |
%output:omit-xml-declaration('no') |
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
### Keybase proof | |
I hereby claim: | |
* I am xquery on github. | |
* I am jimfuller (https://keybase.io/jimfuller) on keybase. | |
* I have a public key whose fingerprint is F971 F4C2 13BB BE1A FF88 9AB4 0617 80A7 7257 D3E2 | |
To claim this, I am signing this object: |
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
the following is an example of a left fold xslt | |
java -jar /Applications/depify-1.0/deps/xmlcalabash/calabash.jar -isource=test.xml -istylesheets=test1.xsl -istylesheets=test2.xsl -oresult=- xslt-fold.xpl | |
<p:declare-step version="1.0" | |
xmlns:p="http://www.w3.org/ns/xproc" | |
xmlns:c="http://www.w3.org/ns/xproc-step" | |
xmlns:ex="http://www.example.com" | |
name="main"> |
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
apply plugin: 'izpack' | |
defaultTasks 'assemble', 'test' | |
ant.importBuild 'build.xml' | |
buildscript { | |
repositories { | |
mavenCentral() | |
jcenter() |
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
gradle -b test.gradle -Dexec.args="-isource=test1.xpl -oresult=- test1.xpl" |
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"; | |
(: xquery memoization example for use with MarkLogic :) | |
declare variable $cache := map:map(); | |
declare function local:factorial($n as xs:integer) as xs:integer { | |
if ($n < 0) then | |
(0) | |
else if ($n = 0) then |
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"; | |
(: The idiv operator returns an integer as a result, rounding toward 0. :) | |
let $a as xs:decimal := 20.1 | |
let $b as xs:decimal := 1.678 | |
let $result := $a idiv $b | |
return | |
$result |
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
(: xml:id attribute needs to be unique within the specific document scope :) | |
let $xml := document{ <employees> | |
<employee xml:id="n001"> | |
<name>Johny Rotten</name> | |
</employee> | |
<employee xml:id="n002"> | |
<name>Billy Idol</name> | |
</employee> | |
</employees>} |
OlderNewer