Skip to content

Instantly share code, notes, and snippets.

@zachary-johnson
Created October 27, 2017 20:08
Show Gist options
  • Save zachary-johnson/bfbcc3dac54263023809ae02328c9053 to your computer and use it in GitHub Desktop.
Save zachary-johnson/bfbcc3dac54263023809ae02328c9053 to your computer and use it in GitHub Desktop.
xquery version "3.1";
declare default element namespace "http://www.w3.org/1999/xhtml";
(: This returns html because we have told it to only validate if it's actually html. <ead>1</ead> wouldn't work. Unless we "call" the html schema, it won't actually check to see if it's a valid html doc. :)
declare function local:template($title as xs:string, $h1 as xs:integer, $p as xs:string) as element(html) {
<html>
<head>
<title>{$title||" - "}</title>
</head>
<body>
<h1>{$h1 + 1}</h1>
<p>{$p}</p>
</body>
</html>
};
let $title := "Title of tab"
let $h1 := 1
let $p := "I'm now creating a paragraph with some info in it."
return local:template($title, $h1, $p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment