Skip to content

Instantly share code, notes, and snippets.

View eedeebee's full-sized avatar

Eric Bloch eedeebee

  • Hillsborough, CA
View GitHub Profile

Lost in Recursion - Generate XML from name value pairs (HTML Form)

Meta

  • Pre-requisites

MarkLogic Server 4.2. Knowing your way around http://localhost:8001 or a working cq instalation

  • Difficulty: Medium
  • Keywords: XML, XForms, HTML, Forms, XQuery, Functional, Map, Fold, High Order Functions, Application Buider, Search, git, github, XQuery 1.1

Nuno Job

xdmp:invoke("hello.xqy")
xdmp:xslt-invoke("hello.xsl", doc("input.xml"))
xdmp:eval("'Hello, World!'")
@eedeebee
eedeebee / gist:654314
Created October 29, 2010 20:10 — forked from anonymous/gist:462145
invoking xslt
xdmp:xslt-eval(
<xsl:stylesheet version="2.0"/>,
doc("input.xml")
)
xdmp:invoke("hello.xqy", (xs:QName("name1"), "value1",
xs:QName("name2"), "value2"))
@eedeebee
eedeebee / gist:659095
Created November 2, 2010 00:16 — forked from anonymous/gist:462219
invoking xslt
let $map := map:map()
let $_ := (map:put($map, "name1", "value1"),
map:put($map, "name2", "value2"))
xdmp:xslt-invoke("hello.xsl", doc("input.xml"), $map)
<options xmlns="xdmp:eval">
<!-- ... -->
</options>
xdmp:xslt-invoke("hello.xsl", doc("input.xml"), map:map(),
<options xmlns="xdmp:eval">
<mode>main</mode>
</options>)
xdmp:xslt-invoke("hello.xsl", doc("input.xml"),
map:map(
<map:map xmlns:map="http://marklogic.com/xdmp/map">
<map:entry>
<map:key>name1</map:key>
<map:value>value1</map:value>
</map:entry>
<map:entry>
<map:key>name2</map:key>
<map:value>value2</map:value>