Created
September 9, 2014 15:24
-
-
Save xquery/885d227151ee9ee9ac06 to your computer and use it in GitHub Desktop.
check out the new annotations for RXQ functions (%output: , %xdmp:gzip) ... neat
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') | |
%output:indent('no') | |
%rxq:GET | |
%rxq:path('/text-serialization-iso-8859-1') | |
function text-serialization-iso-8859-1(){ | |
<e>Hello World</e> | |
}; | |
declare | |
%rxq:produces('text/html') | |
%output:method('xhtml') | |
%output:indent('no') | |
%output:doctype-system('http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd') | |
%output:doctype-public('-//W3C//DTD XHTML 1.0 Strict//EN') | |
%output:omit-xml-declaration('no') | |
%output:standalone('no') | |
%rxq:GET | |
%rxq:path('/xhtml-with-doctype') | |
function xhtml-with-doctype(){ | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head /> | |
<body> | |
<p>Hello World</p> | |
</body> | |
</html> | |
}; | |
(: -------------------------------------------------------------------------- :) | |
(: xdmp annotations, e.g. xdmp:gzip, maybe multipart etc :) | |
(: -------------------------------------------------------------------------- :) | |
declare | |
%rxq:produces('text/plain') | |
%output:method('text') | |
%rxq:GET | |
%xdmp:gzip | |
%rxq:path('/text-content-gzipped') | |
function text-content-gzipped(){ | |
text { "Hello World, gzipped" } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment