Created
December 2, 2014 22:40
-
-
Save apb2006/2f1a6ec32de4b0aefcdd to your computer and use it in GitHub Desktop.
BaseX RESTXQ JSON test
This file contains hidden or 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
(:~ | |
: JSON test apb 2dec 2014 | |
:) | |
module namespace page = 'json-test'; | |
declare variable $page:data:=<json objects="json _"> | |
<total type="number">15</total> | |
<entity>app</entity> | |
<items type="array"> | |
<_> | |
<logo type="string">/static/abide/logo.svg</logo> | |
<name type="string">abide</name> | |
<uri type="string">/abide</uri> | |
<description type="string">todo this</description> | |
</_> | |
</items> | |
</json> | |
; | |
declare %rest:path("/json") %output:method("json") | |
function page:json(){ $page:data} | |
; | |
declare %rest:path("/json2") %output:method("text") | |
function page:json2(){json:serialize($page:data)} | |
; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment