diff --git a/xqdoc/lib/lang-xq.js b/xqdoc/lib/lang-xq.js new file mode 100644 index 0000000..5956f22 --- /dev/null +++ b/xqdoc/lib/lang-xq.js @@ -0,0 +1,62 @@ +// Copyright (C) 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for XQuery. + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *

+ *
+ *
+ * @author Patrick Wied ( patpa7p@live.de )
+ * @version	2010-09-28
+ */
+
+PR['registerLangHandler'](
+    PR['createSimpleLexer'](
+        [
+	     // Matching $var-ia_bles
+	     [PR['PR_VARIABLE'], /^\$[A-Za-z0-9_\-]+/, null, "$"]
+        ],
+        [
+         // Matching lt and gt operators
+         // Not the best matching solution but you have to differentiate between the gt operator and the tag closing char
+         [PR['PR_PLAIN'], /^[\s=][<>][\s=]/],
+         // Matching @Attributes
+         [PR['PR_LITERAL'], /^\@[\w-]+/],
+         // Matching xml tags
+         [PR['PR_TAG'], /^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
+         // Matching single or multiline xquery comments -> (:  :)
+         [PR['PR_COMMENT'], /^\(:[\s\S]*?:\)/],
+         // Tokenizing /{}:=;*,[]() as plain
+	     [PR['PR_PLAIN'], /^[\/\{\};,\[\]\(\)]$/],
+         // Matching a double or single quoted, possibly multi-line, string.
+         // with the special condition that a { in a string changes to xquery context 
+	     [PR['PR_STRING'], /^(?:\"(?:[^\"\\\{]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\\{]|\\[\s\S])*(?:\'|$))/, null, '"\''],
+	     // Matching standard xquery keywords
+         [PR['PR_KEYWORD'], /^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/],
+         // Matching standard xquery types
+         [PR['PR_TYPE'], /^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/, null],
+         // Matching standard xquery functions
+         [PR['PR_FUNCTION'], /^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/],
+         // Matching normal words if none of the previous regular expressions matched
+         [PR['PR_PLAIN'], /^[A-Za-z0-9_\-\:]+/],
+         // Matching whitespaces
+         [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/]
+         ]),
+    ['xq', 'xquery']);
diff --git a/xqdoc/lib/prettify.css b/xqdoc/lib/prettify.css
new file mode 100644
index 0000000..54a14e1
--- /dev/null
+++ b/xqdoc/lib/prettify.css
@@ -0,0 +1,48 @@
+/* Pretty printing styles. Used with prettify.js. */
+
+.str { color: #080; }
+.kwd { color: #008; }
+.com { color: #800; }
+.typ { color: #606; }
+.lit { color: #066; }
+.pun { color: #660; }
+.pln { color: #000; }
+.tag { color: #008; }
+.atn { color: #606; }
+.atv { color: #080; }
+.dec { color: #606; }
+/* pw */
+.fun { color: red;	}
+.var { color: #606; }
+/* pw end */
+pre.prettyprint { padding: 2px; border: 1px solid #888 }
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L5,
+li.L6,
+li.L7,
+li.L8 { list-style-type: none }
+/* Alternate shading for lines */
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 { background: #eee }
+
+@media print {
+  .str { color: #060; }
+  .kwd { color: #006; font-weight: bold; }
+  .com { color: #600; font-style: italic; }
+  .typ { color: #404; font-weight: bold; }
+  .lit { color: #044; }
+  .pun { color: #440; }
+  .pln { color: #000; }
+  .tag { color: #006; font-weight: bold; }
+  .atn { color: #404; }
+  .atv { color: #060; }
+}
diff --git a/xqdoc/lib/prettify.js b/xqdoc/lib/prettify.js
new file mode 100644
index 0000000..1d2da79
--- /dev/null
+++ b/xqdoc/lib/prettify.js
@@ -0,0 +1,1520 @@
+// Copyright (C) 2006 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+/**
+ * @fileoverview
+ * some functions for browser-side pretty printing of code contained in html.
+ * 

+ * + * For a fairly comprehensive set of languages see the + * README + * file that came with this source. At a minimum, the lexer should work on a + * number of languages including C and friends, Java, Python, Bash, SQL, HTML, + * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk + * and a subset of Perl, but, because of commenting conventions, doesn't work on + * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. + *

+ * Usage:

    + *
  1. include this source file in an html page via + * {@code } + *
  2. define style rules. See the example page for examples. + *
  3. mark the {@code
    } and {@code } tags in your source with
    + *    {@code class=prettyprint.}
    + *    You can also use the (html deprecated) {@code } tag, but the pretty
    + *    printer needs to do more substantial DOM manipulations to support that, so
    + *    some css styles may not be preserved.
    + * </ol>
    + * That's it.  I wanted to keep the API as simple as possible, so there's no
    + * need to specify which language the code is in, but if you wish, you can add
    + * another class to the {@code <pre>} or {@code <code>} element to specify the
    + * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
    + * starts with "lang-" followed by a file extension, specifies the file type.
    + * See the "lang-*.js" files in this directory for code that implements
    + * per-language file handlers.
    + * <p>
    + * Change log:<br>
    + * cbeust, 2006/08/22
    + * <blockquote>
    + *   Java annotations (start with "@") are now captured as literals ("lit")
    + * </blockquote>
    + * @requires console
    + */
    +
    +// JSLint declarations
    +/*global console, document, navigator, setTimeout, window */
    +
    +/**
    + * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
    + * UI events.
    + * If set to {@code false}, {@code prettyPrint()} is synchronous.
    + */
    +window['PR_SHOULD_USE_CONTINUATION'] = true;
    +
    +/** the number of characters between tab columns */
    +window['PR_TAB_WIDTH'] = 8;
    +
    +/** Walks the DOM returning a properly escaped version of innerHTML.
    +  * @param {Node} node
    +  * @param {Array.<string>} out output buffer that receives chunks of HTML.
    +  */
    +window['PR_normalizedHtml']
    +
    +/** Contains functions for creating and registering new language handlers.
    +  * @type {Object}
    +  */
    +  = window['PR']
    +
    +/** Pretty print a chunk of code.
    +  *
    +  * @param {string} sourceCodeHtml code as html
    +  * @return {string} code as html, but prettier
    +  */
    +  = window['prettyPrintOne']
    +/** Find all the {@code <pre>} and {@code <code>} tags in the DOM with
    +  * {@code class=prettyprint} and prettify them.
    +  * @param {Function?} opt_whenDone if specified, called when the last entry
    +  *     has been finished.
    +  */
    +  = window['prettyPrint'] = void 0;
    +
    +/** browser detection. @extern @returns false if not IE, otherwise the major version. */
    +window['_pr_isIE6'] = function () {
    +  var ieVersion = navigator && navigator.userAgent &&
    +      navigator.userAgent.match(/\bMSIE ([678])\./);
    +  ieVersion = ieVersion ? +ieVersion[1] : false;
    +  window['_pr_isIE6'] = function () { return ieVersion; };
    +  return ieVersion;
    +};
    +
    +
    +(function () {
    +  // Keyword lists for various languages.
    +  var FLOW_CONTROL_KEYWORDS =
    +      "break continue do else for if return while ";
    +  var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
    +      "double enum extern float goto int long register short signed sizeof " +
    +      "static struct switch typedef union unsigned void volatile ";
    +  var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
    +      "new operator private protected public this throw true try typeof ";
    +  var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
    +      "concept concept_map const_cast constexpr decltype " +
    +      "dynamic_cast explicit export friend inline late_check " +
    +      "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
    +      "template typeid typename using virtual wchar_t where ";
    +  var JAVA_KEYWORDS = COMMON_KEYWORDS +
    +      "abstract boolean byte extends final finally implements import " +
    +      "instanceof null native package strictfp super synchronized throws " +
    +      "transient ";
    +  var CSHARP_KEYWORDS = JAVA_KEYWORDS +
    +      "as base by checked decimal delegate descending event " +
    +      "fixed foreach from group implicit in interface internal into is lock " +
    +      "object out override orderby params partial readonly ref sbyte sealed " +
    +      "stackalloc string select uint ulong unchecked unsafe ushort var ";
    +  var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
    +      "debugger eval export function get null set undefined var with " +
    +      "Infinity NaN ";
    +  var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
    +      "goto if import last local my next no our print package redo require " +
    +      "sub undef unless until use wantarray while BEGIN END ";
    +  var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
    +      "elif except exec finally from global import in is lambda " +
    +      "nonlocal not or pass print raise try with yield " +
    +      "False True None ";
    +  var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
    +      " defined elsif end ensure false in module next nil not or redo rescue " +
    +      "retry self super then true undef unless until when yield BEGIN END ";
    +  var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
    +      "function in local set then until ";
    +
    +  var ALL_KEYWORDS = (
    +      CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
    +      PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS );
    +
    +  // token style names.  correspond to css classes
    +  /** token style for a string literal */
    +  var PR_STRING = 'str';
    +  /** token style for a keyword */
    +  var PR_KEYWORD = 'kwd';
    +  /** token style for a comment */
    +  var PR_COMMENT = 'com';
    +  /** token style for a type */
    +  var PR_TYPE = 'typ';
    +  /** token style for a literal value.  e.g. 1, null, true. */
    +  var PR_LITERAL = 'lit';
    +  /** token style for a punctuation string. */
    +  var PR_PUNCTUATION = 'pun';
    +  /** token style for a punctuation string. */
    +  var PR_PLAIN = 'pln';
    +
    +  /** token style for an sgml tag. */
    +  var PR_TAG = 'tag';
    +  /** token style for a markup declaration such as a DOCTYPE. */
    +  var PR_DECLARATION = 'dec';
    +  /** token style for embedded source. */
    +  var PR_SOURCE = 'src';
    +  /** token style for an sgml attribute name. */
    +  var PR_ATTRIB_NAME = 'atn';
    +  /** token style for an sgml attribute value. */
    +  var PR_ATTRIB_VALUE = 'atv';
    +  
    +  //pw
    +  /** token style for functions */
    +  var PR_FUNCTION = "fun";
    +  /** token style for variables */
    +  var PR_VARIABLE = "var";
    +  //pw end
    +  
    +  /**
    +   * A class that indicates a section of markup that is not code, e.g. to allow
    +   * embedding of line numbers within code listings.
    +   */
    +  var PR_NOCODE = 'nocode';
    +
    +  /** A set of tokens that can precede a regular expression literal in
    +    * javascript.
    +    * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
    +    * list, but I've removed ones that might be problematic when seen in
    +    * languages that don't support regular expression literals.
    +    *
    +    * <p>Specifically, I've removed any keywords that can't precede a regexp
    +    * literal in a syntactically legal javascript program, and I've removed the
    +    * "in" keyword since it's not a keyword in many languages, and might be used
    +    * as a count of inches.
    +    *
    +    * <p>The link a above does not accurately describe EcmaScript rules since
    +    * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
    +    * very well in practice.
    +    *
    +    * @private
    +    */
    +  var REGEXP_PRECEDER_PATTERN = function () {
    +      var preceders = [
    +          "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
    +          "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
    +          "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
    +          "<", "<<", "<<=", "<=", "=", "==", "===", ">",
    +          ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
    +          "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
    +          "||=", "~" /* handles =~ and !~ */,
    +          "break", "case", "continue", "delete",
    +          "do", "else", "finally", "instanceof",
    +          "return", "throw", "try", "typeof"
    +          ];
    +      var pattern = '(?:^^|[+-]';
    +      for (var i = 0; i < preceders.length; ++i) {
    +        pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
    +      }
    +      pattern += ')\\s*';  // matches at end, and matches empty string
    +      return pattern;
    +      // CAVEAT: this does not properly handle the case where a regular
    +      // expression immediately follows another since a regular expression may
    +      // have flags for case-sensitivity and the like.  Having regexp tokens
    +      // adjacent is not valid in any language I'm aware of, so I'm punting.
    +      // TODO: maybe style special characters inside a regexp as punctuation.
    +    }();
    +
    +  // Define regexps here so that the interpreter doesn't have to create an
    +  // object each time the function containing them is called.
    +  // The language spec requires a new object created even if you don't access
    +  // the $1 members.
    +  var pr_amp = /&/g;
    +  var pr_lt = /</g;
    +  var pr_gt = />/g;
    +  var pr_quot = /\"/g;
    +  /** like textToHtml but escapes double quotes to be attribute safe. */
    +  function attribToHtml(str) {
    +    return str.replace(pr_amp, '&amp;')
    +        .replace(pr_lt, '&lt;')
    +        .replace(pr_gt, '&gt;')
    +        .replace(pr_quot, '&quot;');
    +  }
    +
    +  /** escapest html special characters to html. */
    +  function textToHtml(str) {
    +    return str.replace(pr_amp, '&amp;')
    +        .replace(pr_lt, '&lt;')
    +        .replace(pr_gt, '&gt;');
    +  }
    +
    +
    +  var pr_ltEnt = /&lt;/g;
    +  var pr_gtEnt = /&gt;/g;
    +  var pr_aposEnt = /&apos;/g;
    +  var pr_quotEnt = /&quot;/g;
    +  var pr_ampEnt = /&amp;/g;
    +  var pr_nbspEnt = /&nbsp;/g;
    +  /** unescapes html to plain text. */
    +  function htmlToText(html) {
    +    var pos = html.indexOf('&');
    +    if (pos < 0) { return html; }
    +    // Handle numeric entities specially.  We can't use functional substitution
    +    // since that doesn't work in older versions of Safari.
    +    // These should be rare since most browsers convert them to normal chars.
    +    for (--pos; (pos = html.indexOf('&#', pos + 1)) >= 0;) {
    +      var end = html.indexOf(';', pos);
    +      if (end >= 0) {
    +        var num = html.substring(pos + 3, end);
    +        var radix = 10;
    +        if (num && num.charAt(0) === 'x') {
    +          num = num.substring(1);
    +          radix = 16;
    +        }
    +        var codePoint = parseInt(num, radix);
    +        if (!isNaN(codePoint)) {
    +          html = (html.substring(0, pos) + String.fromCharCode(codePoint) +
    +                  html.substring(end + 1));
    +        }
    +      }
    +    }
    +
    +    return html.replace(pr_ltEnt, '<')
    +        .replace(pr_gtEnt, '>')
    +        .replace(pr_aposEnt, "'")
    +        .replace(pr_quotEnt, '"')
    +        .replace(pr_nbspEnt, ' ')
    +        .replace(pr_ampEnt, '&');
    +  }
    +
    +  /** is the given node's innerHTML normally unescaped? */
    +  function isRawContent(node) {
    +    return 'XMP' === node.tagName;
    +  }
    +
    +  var newlineRe = /[\r\n]/g;
    +  /**
    +   * Are newlines and adjacent spaces significant in the given node's innerHTML?
    +   */
    +  function isPreformatted(node, content) {
    +    // PRE means preformatted, and is a very common case, so don't create
    +    // unnecessary computed style objects.
    +    if ('PRE' === node.tagName) { return true; }
    +    if (!newlineRe.test(content)) { return true; }  // Don't care
    +    var whitespace = '';
    +    // For disconnected nodes, IE has no currentStyle.
    +    if (node.currentStyle) {
    +      whitespace = node.currentStyle.whiteSpace;
    +    } else if (window.getComputedStyle) {
    +      // Firefox makes a best guess if node is disconnected whereas Safari
    +      // returns the empty string.
    +      whitespace = window.getComputedStyle(node, null).whiteSpace;
    +    }
    +    return !whitespace || whitespace === 'pre';
    +  }
    +
    +  function normalizedHtml(node, out, opt_sortAttrs) {
    +    switch (node.nodeType) {
    +      case 1:  // an element
    +        var name = node.tagName.toLowerCase();
    +
    +        out.push('<', name);
    +        var attrs = node.attributes;
    +        var n = attrs.length;
    +        if (n) {
    +          if (opt_sortAttrs) {
    +            var sortedAttrs = [];
    +            for (var i = n; --i >= 0;) { sortedAttrs[i] = attrs[i]; }
    +            sortedAttrs.sort(function (a, b) {
    +                return (a.name < b.name) ? -1 : a.name === b.name ? 0 : 1;
    +              });
    +            attrs = sortedAttrs;
    +          }
    +          for (var i = 0; i < n; ++i) {
    +            var attr = attrs[i];
    +            if (!attr.specified) { continue; }
    +            out.push(' ', attr.name.toLowerCase(),
    +                     '="', attribToHtml(attr.value), '"');
    +          }
    +        }
    +        out.push('>');
    +        for (var child = node.firstChild; child; child = child.nextSibling) {
    +          normalizedHtml(child, out, opt_sortAttrs);
    +        }
    +        if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {
    +          out.push('<\/', name, '>');
    +        }
    +        break;
    +      case 3: case 4: // text
    +        out.push(textToHtml(node.nodeValue));
    +        break;
    +    }
    +  }
    +
    +  /**
    +   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
    +   * matches the union o the sets o strings matched d by the input RegExp.
    +   * Since it matches globally, if the input strings have a start-of-input
    +   * anchor (/^.../), it is ignored for the purposes of unioning.
    +   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
    +   * @return {RegExp} a global regex.
    +   */
    +  function combinePrefixPatterns(regexs) {
    +    var capturedGroupIndex = 0;
    +
    +    var needToFoldCase = false;
    +    var ignoreCase = false;
    +    for (var i = 0, n = regexs.length; i < n; ++i) {
    +      var regex = regexs[i];
    +      if (regex.ignoreCase) {
    +        ignoreCase = true;
    +      } else if (/[a-z]/i.test(regex.source.replace(
    +                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
    +        needToFoldCase = true;
    +        ignoreCase = false;
    +        break;
    +      }
    +    }
    +
    +    function decodeEscape(charsetPart) {
    +      if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
    +      switch (charsetPart.charAt(1)) {
    +        case 'b': return 8;
    +        case 't': return 9;
    +        case 'n': return 0xa;
    +        case 'v': return 0xb;
    +        case 'f': return 0xc;
    +        case 'r': return 0xd;
    +        case 'u': case 'x':
    +          return parseInt(charsetPart.substring(2), 16)
    +              || charsetPart.charCodeAt(1);
    +        case '0': case '1': case '2': case '3': case '4':
    +        case '5': case '6': case '7':
    +          return parseInt(charsetPart.substring(1), 8);
    +        default: return charsetPart.charCodeAt(1);
    +      }
    +    }
    +
    +    function encodeEscape(charCode) {
    +      if (charCode < 0x20) {
    +        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
    +      }
    +      var ch = String.fromCharCode(charCode);
    +      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
    +        ch = '\\' + ch;
    +      }
    +      return ch;
    +    }
    +
    +    function caseFoldCharset(charSet) {
    +      var charsetParts = charSet.substring(1, charSet.length - 1).match(
    +          new RegExp(
    +              '\\\\u[0-9A-Fa-f]{4}'
    +              + '|\\\\x[0-9A-Fa-f]{2}'
    +              + '|\\\\[0-3][0-7]{0,2}'
    +              + '|\\\\[0-7]{1,2}'
    +              + '|\\\\[\\s\\S]'
    +              + '|-'
    +              + '|[^-\\\\]',
    +              'g'));
    +      var groups = [];
    +      var ranges = [];
    +      var inverse = charsetParts[0] === '^';
    +      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
    +        var p = charsetParts[i];
    +        switch (p) {
    +          case '\\B': case '\\b':
    +          case '\\D': case '\\d':
    +          case '\\S': case '\\s':
    +          case '\\W': case '\\w':
    +            groups.push(p);
    +            continue;
    +        }
    +        var start = decodeEscape(p);
    +        var end;
    +        if (i + 2 < n && '-' === charsetParts[i + 1]) {
    +          end = decodeEscape(charsetParts[i + 2]);
    +          i += 2;
    +        } else {
    +          end = start;
    +        }
    +        ranges.push([start, end]);
    +        // If the range might intersect letters, then expand it.
    +        if (!(end < 65 || start > 122)) {
    +          if (!(end < 65 || start > 90)) {
    +            ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
    +          }
    +          if (!(end < 97 || start > 122)) {
    +            ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
    +          }
    +        }
    +      }
    +
    +      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
    +      // -> [[1, 12], [14, 14], [16, 17]]
    +      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
    +      var consolidatedRanges = [];
    +      var lastRange = [NaN, NaN];
    +      for (var i = 0; i < ranges.length; ++i) {
    +        var range = ranges[i];
    +        if (range[0] <= lastRange[1] + 1) {
    +          lastRange[1] = Math.max(lastRange[1], range[1]);
    +        } else {
    +          consolidatedRanges.push(lastRange = range);
    +        }
    +      }
    +
    +      var out = ['['];
    +      if (inverse) { out.push('^'); }
    +      out.push.apply(out, groups);
    +      for (var i = 0; i < consolidatedRanges.length; ++i) {
    +        var range = consolidatedRanges[i];
    +        out.push(encodeEscape(range[0]));
    +        if (range[1] > range[0]) {
    +          if (range[1] + 1 > range[0]) { out.push('-'); }
    +          out.push(encodeEscape(range[1]));
    +        }
    +      }
    +      out.push(']');
    +      return out.join('');
    +    }
    +
    +    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
    +      // Split into character sets, escape sequences, punctuation strings
    +      // like ('(', '(?:', ')', '^'), and runs of characters that do not
    +      // include any of the above.
    +      var parts = regex.source.match(
    +          new RegExp(
    +              '(?:'
    +              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
    +              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
    +              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
    +              + '|\\\\[0-9]+'  // a back-reference or octal escape
    +              + '|\\\\[^ux0-9]'  // other escape sequence
    +              + '|\\(\\?[:!=]'  // start of a non-capturing group
    +              + '|[\\(\\)\\^]'  // start/emd of a group, or line start
    +              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
    +              + ')',
    +              'g'));
    +      var n = parts.length;
    +
    +      // Maps captured group numbers to the number they will occupy in
    +      // the output or to -1 if that has not been determined, or to
    +      // undefined if they need not be capturing in the output.
    +      var capturedGroups = [];
    +
    +      // Walk over and identify back references to build the capturedGroups
    +      // mapping.
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        var p = parts[i];
    +        if (p === '(') {
    +          // groups are 1-indexed, so max group index is count of '('
    +          ++groupIndex;
    +        } else if ('\\' === p.charAt(0)) {
    +          var decimalValue = +p.substring(1);
    +          if (decimalValue && decimalValue <= groupIndex) {
    +            capturedGroups[decimalValue] = -1;
    +          }
    +        }
    +      }
    +
    +      // Renumber groups and reduce capturing groups to non-capturing groups
    +      // where possible.
    +      for (var i = 1; i < capturedGroups.length; ++i) {
    +        if (-1 === capturedGroups[i]) {
    +          capturedGroups[i] = ++capturedGroupIndex;
    +        }
    +      }
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        var p = parts[i];
    +        if (p === '(') {
    +          ++groupIndex;
    +          if (capturedGroups[groupIndex] === undefined) {
    +            parts[i] = '(?:';
    +          }
    +        } else if ('\\' === p.charAt(0)) {
    +          var decimalValue = +p.substring(1);
    +          if (decimalValue && decimalValue <= groupIndex) {
    +            parts[i] = '\\' + capturedGroups[groupIndex];
    +          }
    +        }
    +      }
    +
    +      // Remove any prefix anchors so that the output will match anywhere.
    +      // ^^ really does mean an anchored match though.
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
    +      }
    +
    +      // Expand letters to groupts to handle mixing of case-sensitive and
    +      // case-insensitive patterns if necessary.
    +      if (regex.ignoreCase && needToFoldCase) {
    +        for (var i = 0; i < n; ++i) {
    +          var p = parts[i];
    +          var ch0 = p.charAt(0);
    +          if (p.length >= 2 && ch0 === '[') {
    +            parts[i] = caseFoldCharset(p);
    +          } else if (ch0 !== '\\') {
    +            // TODO: handle letters in numeric escapes.
    +            parts[i] = p.replace(
    +                /[a-zA-Z]/g,
    +                function (ch) {
    +                  var cc = ch.charCodeAt(0);
    +                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
    +                });
    +          }
    +        }
    +      }
    +
    +      return parts.join('');
    +    }
    +
    +    var rewritten = [];
    +    for (var i = 0, n = regexs.length; i < n; ++i) {
    +      var regex = regexs[i];
    +      if (regex.global || regex.multiline) { throw new Error('' + regex); }
    +      rewritten.push(
    +          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
    +    }
    +
    +    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
    +  }
    +
    +  var PR_innerHtmlWorks = null;
    +  function getInnerHtml(node) {
    +    // inner html is hopelessly broken in Safari 2.0.4 when the content is
    +    // an html description of well formed XML and the containing tag is a PRE
    +    // tag, so we detect that case and emulate innerHTML.
    +    if (null === PR_innerHtmlWorks) {
    +      var testNode = document.createElement('PRE');
    +      testNode.appendChild(
    +          document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));
    +      PR_innerHtmlWorks = !/</.test(testNode.innerHTML);
    +    }
    +
    +    if (PR_innerHtmlWorks) {
    +      var content = node.innerHTML;
    +      // XMP tags contain unescaped entities so require special handling.
    +      if (isRawContent(node)) {
    +        content = textToHtml(content);
    +      } else if (!isPreformatted(node, content)) {
    +        content = content.replace(/(<br\s*\/?>)[\r\n]+/g, '$1')
    +            .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');
    +      }
    +      return content;
    +    }
    +
    +    var out = [];
    +    for (var child = node.firstChild; child; child = child.nextSibling) {
    +      normalizedHtml(child, out);
    +    }
    +    return out.join('');
    +  }
    +
    +  /** returns a function that expand tabs to spaces.  This function can be fed
    +    * successive chunks of text, and will maintain its own internal state to
    +    * keep track of how tabs are expanded.
    +    * @return {function (string) : string} a function that takes
    +    *   plain text and return the text with tabs expanded.
    +    * @private
    +    */
    +  function makeTabExpander(tabWidth) {
    +    var SPACES = '                ';
    +    var charInLine = 0;
    +
    +    return function (plainText) {
    +      // walk over each character looking for tabs and newlines.
    +      // On tabs, expand them.  On newlines, reset charInLine.
    +      // Otherwise increment charInLine
    +      var out = null;
    +      var pos = 0;
    +      for (var i = 0, n = plainText.length; i < n; ++i) {
    +        var ch = plainText.charAt(i);
    +
    +        switch (ch) {
    +          case '\t':
    +            if (!out) { out = []; }
    +            out.push(plainText.substring(pos, i));
    +            // calculate how much space we need in front of this part
    +            // nSpaces is the amount of padding -- the number of spaces needed
    +            // to move us to the next column, where columns occur at factors of
    +            // tabWidth.
    +            var nSpaces = tabWidth - (charInLine % tabWidth);
    +            charInLine += nSpaces;
    +            for (; nSpaces >= 0; nSpaces -= SPACES.length) {
    +              out.push(SPACES.substring(0, nSpaces));
    +            }
    +            pos = i + 1;
    +            break;
    +          case '\n':
    +            charInLine = 0;
    +            break;
    +          default:
    +            ++charInLine;
    +        }
    +      }
    +      if (!out) { return plainText; }
    +      out.push(plainText.substring(pos));
    +      return out.join('');
    +    };
    +  }
    +
    +  var pr_chunkPattern = new RegExp(
    +      '[^<]+'  // A run of characters other than '<'
    +      + '|<\!--[\\s\\S]*?--\>'  // an HTML comment
    +      + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'  // a CDATA section
    +      // a probable tag that should not be highlighted
    +      + '|<\/?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>'
    +      + '|<',  // A '<' that does not begin a larger chunk
    +      'g');
    +  var pr_commentPrefix = /^<\!--/;
    +  var pr_cdataPrefix = /^<!\[CDATA\[/;
    +  var pr_brPrefix = /^<br\b/i;
    +  var pr_tagNameRe = /^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/;
    +
    +  /** split markup into chunks of html tags (style null) and
    +    * plain text (style {@link #PR_PLAIN}), converting tags which are
    +    * significant for tokenization (<br>) into their textual equivalent.
    +    *
    +    * @param {string} s html where whitespace is considered significant.
    +    * @return {Object} source code and extracted tags.
    +    * @private
    +    */
    +  function extractTags(s) {
    +    // since the pattern has the 'g' modifier and defines no capturing groups,
    +    // this will return a list of all chunks which we then classify and wrap as
    +    // PR_Tokens
    +    var matches = s.match(pr_chunkPattern);
    +    var sourceBuf = [];
    +    var sourceBufLen = 0;
    +    var extractedTags = [];
    +    if (matches) {
    +      for (var i = 0, n = matches.length; i < n; ++i) {
    +        var match = matches[i];
    +        if (match.length > 1 && match.charAt(0) === '<') {
    +          if (pr_commentPrefix.test(match)) { continue; }
    +          if (pr_cdataPrefix.test(match)) {
    +            // strip CDATA prefix and suffix.  Don't unescape since it's CDATA
    +            sourceBuf.push(match.substring(9, match.length - 3));
    +            sourceBufLen += match.length - 12;
    +          } else if (pr_brPrefix.test(match)) {
    +            // <br> tags are lexically significant so convert them to text.
    +            // This is undone later.
    +            sourceBuf.push('\n');
    +            ++sourceBufLen;
    +          } else {
    +            if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) {
    +              // A <span class="nocode"> will start a section that should be
    +              // ignored.  Continue walking the list until we see a matching end
    +              // tag.
    +              var name = match.match(pr_tagNameRe)[2];
    +              var depth = 1;
    +              var j;
    +              end_tag_loop:
    +              for (j = i + 1; j < n; ++j) {
    +                var name2 = matches[j].match(pr_tagNameRe);
    +                if (name2 && name2[2] === name) {
    +                  if (name2[1] === '/') {
    +                    if (--depth === 0) { break end_tag_loop; }
    +                  } else {
    +                    ++depth;
    +                  }
    +                }
    +              }
    +              if (j < n) {
    +                extractedTags.push(
    +                    sourceBufLen, matches.slice(i, j + 1).join(''));
    +                i = j;
    +              } else {  // Ignore unclosed sections.
    +                extractedTags.push(sourceBufLen, match);
    +              }
    +            } else {
    +              extractedTags.push(sourceBufLen, match);
    +            }
    +          }
    +        } else {
    +          var literalText = htmlToText(match);
    +          sourceBuf.push(literalText);
    +          sourceBufLen += literalText.length;
    +        }
    +      }
    +    }
    +    return { source: sourceBuf.join(''), tags: extractedTags };
    +  }
    +
    +  /** True if the given tag contains a class attribute with the nocode class. */
    +  function isNoCodeTag(tag) {
    +    return !!tag
    +        // First canonicalize the representation of attributes
    +        .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
    +                 ' $1="$2$3$4"')
    +        // Then look for the attribute we want.
    +        .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);
    +  }
    +
    +  /**
    +   * Apply the given language handler to sourceCode and add the resulting
    +   * decorations to out.
    +   * @param {number} basePos the index of sourceCode within the chunk of source
    +   *    whose decorations are already present on out.
    +   */
    +  function appendDecorations(basePos, sourceCode, langHandler, out) {
    +    if (!sourceCode) { return; }
    +    var job = {
    +      source: sourceCode,
    +      basePos: basePos
    +    };
    +    langHandler(job);
    +    out.push.apply(out, job.decorations);
    +  }
    +
    +  /** Given triples of [style, pattern, context] returns a lexing function,
    +    * The lexing function interprets the patterns to find token boundaries and
    +    * returns a decoration list of the form
    +    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
    +    * where index_n is an index into the sourceCode, and style_n is a style
    +    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
    +    * all characters in sourceCode[index_n-1:index_n].
    +    *
    +    * The stylePatterns is a list whose elements have the form
    +    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
    +    *
    +    * Style is a style constant like PR_PLAIN, or can be a string of the
    +    * form 'lang-FOO', where FOO is a language extension describing the
    +    * language of the portion of the token in $1 after pattern executes.
    +    * E.g., if style is 'lang-lisp', and group 1 contains the text
    +    * '(hello (world))', then that portion of the token will be passed to the
    +    * registered lisp handler for formatting.
    +    * The text before and after group 1 will be restyled using this decorator
    +    * so decorators should take care that this doesn't result in infinite
    +    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
    +    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
    +    * '<script>foo()<\/script>', which would cause the current decorator to
    +    * be called with '<script>' which would not match the same rule since
    +    * group 1 must not be empty, so it would be instead styled as PR_TAG by
    +    * the generic tag rule.  The handler registered for the 'js' extension would
    +    * then be called with 'foo()', and finally, the current decorator would
    +    * be called with '<\/script>' which would not match the original rule and
    +    * so the generic tag rule would identify it as a tag.
    +    *
    +    * Pattern must only match prefixes, and if it matches a prefix, then that
    +    * match is considered a token with the same style.
    +    *
    +    * Context is applied to the last non-whitespace, non-comment token
    +    * recognized.
    +    *
    +    * Shortcut is an optional string of characters, any of which, if the first
    +    * character, gurantee that this pattern and only this pattern matches.
    +    *
    +    * @param {Array} shortcutStylePatterns patterns that always start with
    +    *   a known character.  Must have a shortcut string.
    +    * @param {Array} fallthroughStylePatterns patterns that will be tried in
    +    *   order if the shortcut ones fail.  May have shortcuts.
    +    *
    +    * @return {function (Object)} a
    +    *   function that takes source code and returns a list of decorations.
    +    */
    +  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
    +    var shortcuts = {};
    +    var tokenizer;
    +    (function () {
    +      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
    +      var allRegexs = [];
    +      var regexKeys = {};
    +      for (var i = 0, n = allPatterns.length; i < n; ++i) {
    +        var patternParts = allPatterns[i];
    +        var shortcutChars = patternParts[3];
    +        if (shortcutChars) {
    +          for (var c = shortcutChars.length; --c >= 0;) {
    +            shortcuts[shortcutChars.charAt(c)] = patternParts;
    +          }
    +        }
    +        var regex = patternParts[1];
    +        var k = '' + regex;
    +        if (!regexKeys.hasOwnProperty(k)) {
    +          allRegexs.push(regex);
    +          regexKeys[k] = null;
    +        }
    +      }
    +      allRegexs.push(/[\0-\uffff]/);
    +      tokenizer = combinePrefixPatterns(allRegexs);
    +    })();
    +
    +    var nPatterns = fallthroughStylePatterns.length;
    +    var notWs = /\S/;
    +
    +    /**
    +     * Lexes job.source and produces an output array job.decorations of style
    +     * classes preceded by the position at which they start in job.source in
    +     * order.
    +     *
    +     * @param {Object} job an object like {@code
    +     *    source: {string} sourceText plain text,
    +     *    basePos: {int} position of job.source in the larger chunk of
    +     *        sourceCode.
    +     * }
    +     */
    +    var decorate = function (job) {
    +      var sourceCode = job.source, basePos = job.basePos;
    +      /** Even entries are positions in source in ascending order.  Odd enties
    +        * are style markers (e.g., PR_COMMENT) that run from that position until
    +        * the end.
    +        * @type {Array.<number|string>}
    +        */
    +      var decorations = [basePos, PR_PLAIN];
    +      var pos = 0;  // index into sourceCode
    +      var tokens = sourceCode.match(tokenizer) || [];
    +      var styleCache = {};
    +      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
    +        var token = tokens[ti];
    +        var style = styleCache[token];
    +        var match = void 0;
    +
    +        var isEmbedded;
    +        if (typeof style === 'string') {
    +          isEmbedded = false;
    +        } else {
    +          var patternParts = shortcuts[token.charAt(0)];
    +          if (patternParts) {
    +            match = token.match(patternParts[1]);
    +            style = patternParts[0];
    +          } else {
    +            for (var i = 0; i < nPatterns; ++i) {
    +              patternParts = fallthroughStylePatterns[i];
    +              match = token.match(patternParts[1]);
    +              if (match) {
    +                style = patternParts[0];
    +                break;
    +              }
    +            }
    +
    +            if (!match) {  // make sure that we make progress
    +              style = PR_PLAIN;
    +            }
    +          }
    +
    +          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
    +          if (isEmbedded && !(match && typeof match[1] === 'string')) {
    +            isEmbedded = false;
    +            style = PR_SOURCE;
    +          }
    +
    +          if (!isEmbedded) { styleCache[token] = style; }
    +          //console.log("MATCHED STYLE: " + style);
    +        }
    +
    +        var tokenStart = pos;
    +        pos += token.length;
    +
    +        if (!isEmbedded) {
    +          decorations.push(basePos + tokenStart, style);
    +        } else {  // Treat group 1 as an embedded block of source code.
    +          var embeddedSource = match[1];
    +          var embeddedSourceStart = token.indexOf(embeddedSource);
    +          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
    +          if (match[2]) {
    +            // If embeddedSource can be blank, then it would match at the
    +            // beginning which would cause us to infinitely recurse on the
    +            // entire token, so we catch the right context in match[2].
    +            embeddedSourceEnd = token.length - match[2].length;
    +            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
    +          }
    +          var lang = style.substring(5);
    +          // Decorate the left of the embedded source
    +          appendDecorations(
    +              basePos + tokenStart,
    +              token.substring(0, embeddedSourceStart),
    +              decorate, decorations);
    +          // Decorate the embedded source
    +          appendDecorations(
    +              basePos + tokenStart + embeddedSourceStart,
    +              embeddedSource,
    +              langHandlerForExtension(lang, embeddedSource),
    +              decorations);
    +          // Decorate the right of the embedded section
    +          appendDecorations(
    +              basePos + tokenStart + embeddedSourceEnd,
    +              token.substring(embeddedSourceEnd),
    +              decorate, decorations);
    +        }
    +      }
    +      job.decorations = decorations;
    +    };
    +    return decorate;
    +  }
    +
    +  /** returns a function that produces a list of decorations from source text.
    +    *
    +    * This code treats ", ', and ` as string delimiters, and \ as a string
    +    * escape.  It does not recognize perl's qq() style strings.
    +    * It has no special handling for double delimiter escapes as in basic, or
    +    * the tripled delimiters used in python, but should work on those regardless
    +    * although in those cases a single string literal may be broken up into
    +    * multiple adjacent string literals.
    +    *
    +    * It recognizes C, C++, and shell style comments.
    +    *
    +    * @param {Object} options a set of optional parameters.
    +    * @return {function (Object)} a function that examines the source code
    +    *     in the input job and builds the decoration list.
    +    */
    +  function sourceDecorator(options) {
    +    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
    +    if (options['tripleQuotedStrings']) {
    +      // '''multi-line-string''', 'single-line-string', and double-quoted
    +      shortcutStylePatterns.push(
    +          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
    +           null, '\'"']);
    +    } else if (options['multiLineStrings']) {
    +      // 'multi-line-string', "multi-line-string"
    +      shortcutStylePatterns.push(
    +          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
    +           null, '\'"`']);
    +    } else {
    +      // 'single-line-string', "single-line-string"
    +      shortcutStylePatterns.push(
    +          [PR_STRING,
    +           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
    +           null, '"\'']);
    +    }
    +    if (options['verbatimStrings']) {
    +      // verbatim-string-literal production from the C# grammar.  See issue 93.
    +      fallthroughStylePatterns.push(
    +          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
    +    }
    +    if (options['hashComments']) {
    +      if (options['cStyleComments']) {
    +        // Stop C preprocessor declarations at an unclosed open comment
    +        shortcutStylePatterns.push(
    +            [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
    +             null, '#']);
    +        fallthroughStylePatterns.push(
    +            [PR_STRING,
    +             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
    +             null]);
    +      } else {
    +        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
    +      }
    +    }
    +    if (options['cStyleComments']) {
    +      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
    +      fallthroughStylePatterns.push(
    +          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
    +    }
    +    if (options['regexLiterals']) {
    +      var REGEX_LITERAL = (
    +          // A regular expression literal starts with a slash that is
    +          // not followed by * or / so that it is not confused with
    +          // comments.
    +          '/(?=[^/*])'
    +          // and then contains any number of raw characters,
    +          + '(?:[^/\\x5B\\x5C]'
    +          // escape sequences (\x5C),
    +          +    '|\\x5C[\\s\\S]'
    +          // or non-nesting character sets (\x5B\x5D);
    +          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
    +          // finally closed by a /.
    +          + '/');
    +      fallthroughStylePatterns.push(
    +          ['lang-regex',
    +           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
    +           ]);
    +    }
    +
    +    var keywords = options['keywords'].replace(/^\s+|\s+$/g, '');
    +    if (keywords.length) {
    +      fallthroughStylePatterns.push(
    +          [PR_KEYWORD,
    +           new RegExp('^(?:' + keywords.replace(/\s+/g, '|') + ')\\b'), null]);
    +    }
    +
    +    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
    +    fallthroughStylePatterns.push(
    +        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
    +        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
    +        [PR_TYPE,        /^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, null],
    +        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
    +        [PR_LITERAL,
    +         new RegExp(
    +             '^(?:'
    +             // A hex number
    +             + '0x[a-f0-9]+'
    +             // or an octal or decimal number,
    +             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
    +             // possibly in scientific notation
    +             + '(?:e[+\\-]?\\d+)?'
    +             + ')'
    +             // with an optional modifier like UL for unsigned long
    +             + '[a-z]*', 'i'),
    +         null, '0123456789'],
    +        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#]*/, null]);
    +
    +    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
    +  }
    +
    +  var decorateSource = sourceDecorator({
    +        'keywords': ALL_KEYWORDS,
    +        'hashComments': true,
    +        'cStyleComments': true,
    +        'multiLineStrings': true,
    +        'regexLiterals': true
    +      });
    +
    +  /** Breaks {@code job.source} around style boundaries in
    +    * {@code job.decorations} while re-interleaving {@code job.extractedTags},
    +    * and leaves the result in {@code job.prettyPrintedHtml}.
    +    * @param {Object} job like {
    +    *    source: {string} source as plain text,
    +    *    extractedTags: {Array.<number|string>} extractedTags chunks of raw
    +    *                   html preceded by their position in {@code job.source}
    +    *                   in order
    +    *    decorations: {Array.<number|string} an array of style classes preceded
    +    *                 by the position at which they start in job.source in order
    +    * }
    +    * @private
    +    */
    +  function recombineTagsAndDecorations(job) {
    +    var sourceText = job.source;
    +    var extractedTags = job.extractedTags;
    +    var decorations = job.decorations;
    +
    +    var html = [];
    +    // index past the last char in sourceText written to html
    +    var outputIdx = 0;
    +
    +    var openDecoration = null;
    +    var currentDecoration = null;
    +    var tagPos = 0;  // index into extractedTags
    +    var decPos = 0;  // index into decorations
    +    var tabExpander = makeTabExpander(window['PR_TAB_WIDTH']);
    +
    +    var adjacentSpaceRe = /([\r\n ]) /g;
    +    var startOrSpaceRe = /(^| ) /gm;
    +    var newlineRe = /\r\n?|\n/g;
    +    var trailingSpaceRe = /[ \r\n]$/;
    +    var lastWasSpace = true;  // the last text chunk emitted ended with a space.
    +
    +    // See bug 71 and http://stackoverflow.com/questions/136443/why-doesnt-ie7-
    +    var isIE678 = window['_pr_isIE6']();
    +    var lineBreakHtml = (
    +        isIE678
    +        ? (job.sourceNode.tagName === 'PRE'
    +           // Use line feeds instead of <br>s so that copying and pasting works
    +           // on IE.
    +           // Doing this on other browsers breaks lots of stuff since \r\n is
    +           // treated as two newlines on Firefox.
    +           ? (isIE678 === 6 ? '&#160;\r\n' :
    +              isIE678 === 7 ? '&#160;<br>\r' : '&#160;\r')
    +           // IE collapses multiple adjacent <br>s into 1 line break.
    +           // Prefix every newline with '&#160;' to prevent such behavior.
    +           // &nbsp; is the same as &#160; but works in XML as well as HTML.
    +           : '&#160;<br />')
    +        : '<br />');
    +
    +    // Look for a class like linenums or linenums:<n> where <n> is the 1-indexed
    +    // number of the first line.
    +    var numberLines = job.sourceNode.className.match(/\blinenums\b(?::(\d+))?/);
    +    var lineBreaker;
    +    if (numberLines) {
    +      var lineBreaks = [];
    +      for (var i = 0; i < 10; ++i) {
    +        lineBreaks[i] = lineBreakHtml + '</li><li class="L' + i + '">';
    +      }
    +      var lineNum = numberLines[1] && numberLines[1].length 
    +          ? numberLines[1] - 1 : 0;  // Lines are 1-indexed
    +      html.push('<ol class="linenums"><li class="L', (lineNum) % 10, '"');
    +      if (lineNum) {
    +        html.push(' value="', lineNum + 1, '"');
    +      }
    +      html.push('>');
    +      lineBreaker = function () {
    +        var lb = lineBreaks[++lineNum % 10];
    +        // If a decoration is open, we need to close it before closing a list-item
    +        // and reopen it on the other side of the list item.
    +        return openDecoration
    +            ? ('</span>' + lb + '<span class="' + openDecoration + '">') : lb;
    +      };
    +    } else {
    +      lineBreaker = lineBreakHtml;
    +    }
    +
    +    // A helper function that is responsible for opening sections of decoration
    +    // and outputing properly escaped chunks of source
    +    function emitTextUpTo(sourceIdx) {
    +      if (sourceIdx > outputIdx) {
    +        if (openDecoration && openDecoration !== currentDecoration) {
    +          // Close the current decoration
    +          html.push('</span>');
    +          openDecoration = null;
    +        }
    +        if (!openDecoration && currentDecoration) {
    +          openDecoration = currentDecoration;
    +          html.push('<span class="', openDecoration, '">');
    +        }
    +        // This interacts badly with some wikis which introduces paragraph tags
    +        // into pre blocks for some strange reason.
    +        // It's necessary for IE though which seems to lose the preformattedness
    +        // of <pre> tags when their innerHTML is assigned.
    +        // http://stud3.tuwien.ac.at/~e0226430/innerHtmlQuirk.html
    +        // and it serves to undo the conversion of <br>s to newlines done in
    +        // chunkify.
    +        var htmlChunk = textToHtml(
    +            tabExpander(sourceText.substring(outputIdx, sourceIdx)))
    +            .replace(lastWasSpace
    +                     ? startOrSpaceRe
    +                     : adjacentSpaceRe, '$1&#160;');
    +        // Keep track of whether we need to escape space at the beginning of the
    +        // next chunk.
    +        lastWasSpace = trailingSpaceRe.test(htmlChunk);
    +        html.push(htmlChunk.replace(newlineRe, lineBreaker));
    +        outputIdx = sourceIdx;
    +      }
    +    }
    +
    +    while (true) {
    +      // Determine if we're going to consume a tag this time around.  Otherwise
    +      // we consume a decoration or exit.
    +      var outputTag;
    +      if (tagPos < extractedTags.length) {
    +        if (decPos < decorations.length) {
    +          // Pick one giving preference to extractedTags since we shouldn't open
    +          // a new style that we're going to have to immediately close in order
    +          // to output a tag.
    +          outputTag = extractedTags[tagPos] <= decorations[decPos];
    +        } else {
    +          outputTag = true;
    +        }
    +      } else {
    +        outputTag = false;
    +      }
    +      // Consume either a decoration or a tag or exit.
    +      if (outputTag) {
    +        emitTextUpTo(extractedTags[tagPos]);
    +        if (openDecoration) {
    +          // Close the current decoration
    +          html.push('</span>');
    +          openDecoration = null;
    +        }
    +        html.push(extractedTags[tagPos + 1]);
    +        tagPos += 2;
    +      } else if (decPos < decorations.length) {
    +        emitTextUpTo(decorations[decPos]);
    +        currentDecoration = decorations[decPos + 1];
    +        decPos += 2;
    +      } else {
    +        break;
    +      }
    +    }
    +    emitTextUpTo(sourceText.length);
    +    if (openDecoration) {
    +      html.push('</span>');
    +    }
    +    if (numberLines) { html.push('</li></ol>'); }
    +    job.prettyPrintedHtml = html.join('');
    +  }
    +
    +  /** Maps language-specific file extensions to handlers. */
    +  var langHandlerRegistry = {};
    +  /** Register a language handler for the given file extensions.
    +    * @param {function (Object)} handler a function from source code to a list
    +    *      of decorations.  Takes a single argument job which describes the
    +    *      state of the computation.   The single parameter has the form
    +    *      {@code {
    +    *        source: {string} as plain text.
    +    *        decorations: {Array.<number|string>} an array of style classes
    +    *                     preceded by the position at which they start in
    +    *                     job.source in order.
    +    *                     The language handler should assigned this field.
    +    *        basePos: {int} the position of source in the larger source chunk.
    +    *                 All positions in the output decorations array are relative
    +    *                 to the larger source chunk.
    +    *      } }
    +    * @param {Array.<string>} fileExtensions
    +    */
    +  function registerLangHandler(handler, fileExtensions) {
    +    for (var i = fileExtensions.length; --i >= 0;) {
    +      var ext = fileExtensions[i];
    +      if (!langHandlerRegistry.hasOwnProperty(ext)) {
    +        langHandlerRegistry[ext] = handler;
    +      } else if ('console' in window) {
    +        console['warn']('cannot override language handler %s', ext);
    +      }
    +    }
    +  }
    +  function langHandlerForExtension(extension, source) {
    +    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
    +      // Treat it as markup if the first non whitespace character is a < and
    +      // the last non-whitespace character is a >.
    +      extension = /^\s*</.test(source)
    +          ? 'default-markup'
    +          : 'default-code';
    +    }
    +    return langHandlerRegistry[extension];
    +  }
    +  registerLangHandler(decorateSource, ['default-code']);
    +  registerLangHandler(
    +      createSimpleLexer(
    +          [],
    +          [
    +           [PR_PLAIN,       /^[^<?]+/],
    +           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
    +           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
    +           // Unescaped content in an unknown language
    +           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
    +           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
    +           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
    +           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
    +           // Unescaped content in javascript.  (Or possibly vbscript).
    +           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    +           // Contains unescaped stylesheet content
    +           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
    +           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
    +          ]),
    +      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
    +  registerLangHandler(
    +      createSimpleLexer(
    +          [
    +           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
    +           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
    +           ],
    +          [
    +           //pw: 	^^ -> error?
    +           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
    +           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
    +           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
    +           [PR_PUNCTUATION,  /^[=<>\/]+/],
    +           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
    +           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
    +           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
    +           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
    +           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
    +           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
    +           ]),
    +      ['in.tag']);
    +  registerLangHandler(
    +      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': CPP_KEYWORDS,
    +          'hashComments': true,
    +          'cStyleComments': true
    +        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': 'null true false'
    +        }), ['json']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': CSHARP_KEYWORDS,
    +          'hashComments': true,
    +          'cStyleComments': true,
    +          'verbatimStrings': true
    +        }), ['cs']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': JAVA_KEYWORDS,
    +          'cStyleComments': true
    +        }), ['java']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': SH_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true
    +        }), ['bsh', 'csh', 'sh']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': PYTHON_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'tripleQuotedStrings': true
    +        }), ['cv', 'py']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': PERL_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'regexLiterals': true
    +        }), ['perl', 'pl', 'pm']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': RUBY_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'regexLiterals': true
    +        }), ['rb']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': JSCRIPT_KEYWORDS,
    +          'cStyleComments': true,
    +          'regexLiterals': true
    +        }), ['js']);
    +  registerLangHandler(
    +      createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
    +
    +  function applyDecorator(job) {
    +    var sourceCodeHtml = job.sourceCodeHtml;
    +    var opt_langExtension = job.langExtension;
    +
    +    // Prepopulate output in case processing fails with an exception.
    +    job.prettyPrintedHtml = sourceCodeHtml;
    +
    +    try {
    +      // Extract tags, and convert the source code to plain text.
    +      var sourceAndExtractedTags = extractTags(sourceCodeHtml);
    +      /** Plain text. @type {string} */
    +      var source = sourceAndExtractedTags.source;
    +      job.source = source;
    +      job.basePos = 0;
    +
    +      /** Even entries are positions in source in ascending order.  Odd entries
    +        * are tags that were extracted at that position.
    +        * @type {Array.<number|string>}
    +        */
    +      job.extractedTags = sourceAndExtractedTags.tags;
    +
    +      // Apply the appropriate language handler
    +      langHandlerForExtension(opt_langExtension, source)(job);
    +      // Integrate the decorations and tags back into the source code to produce
    +      // a decorated html string which is left in job.prettyPrintedHtml.
    +      recombineTagsAndDecorations(job);
    +    } catch (e) {
    +      if ('console' in window) {
    +        console['log'](e && e['stack'] ? e['stack'] : e);
    +      }
    +    }
    +  }
    +
    +  function prettyPrintOne(sourceCodeHtml, opt_langExtension) {
    +    var job = {
    +      sourceCodeHtml: sourceCodeHtml,
    +      langExtension: opt_langExtension
    +    };
    +    applyDecorator(job);
    +    return job.prettyPrintedHtml;
    +  }
    +
    +  function prettyPrint(opt_whenDone) {
    +    function byTagName(tn) { return document.getElementsByTagName(tn); }
    +    // fetch a list of nodes to rewrite
    +    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
    +    var elements = [];
    +    for (var i = 0; i < codeSegments.length; ++i) {
    +      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
    +        elements.push(codeSegments[i][j]);
    +      }
    +    }
    +    codeSegments = null;
    +
    +    var clock = Date;
    +    if (!clock['now']) {
    +      clock = { 'now': function () { return (new Date).getTime(); } };
    +    }
    +
    +    // The loop is broken into a series of continuations to make sure that we
    +    // don't make the browser unresponsive when rewriting a large page.
    +    var k = 0;
    +    var prettyPrintingJob;
    +
    +    function doWork() {
    +      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
    +                     clock.now() + 250 /* ms */ :
    +                     Infinity);
    +      for (; k < elements.length && clock.now() < endTime; k++) {
    +        var cs = elements[k];
    +        if (cs.className && cs.className.indexOf('prettyprint') >= 0) {
    +          // If the classes includes a language extensions, use it.
    +          // Language extensions can be specified like
    +          //     <pre class="prettyprint lang-cpp">
    +          // the language extension "cpp" is used to find a language handler as
    +          // passed to PR_registerLangHandler.
    +          var langExtension = cs.className.match(/\blang-(\w+)\b/);
    +          if (langExtension) { langExtension = langExtension[1]; }
    +
    +          // make sure this is not nested in an already prettified element
    +          var nested = false;
    +          for (var p = cs.parentNode; p; p = p.parentNode) {
    +            if ((p.tagName === 'pre' || p.tagName === 'code' ||
    +                 p.tagName === 'xmp') &&
    +                p.className && p.className.indexOf('prettyprint') >= 0) {
    +              nested = true;
    +              break;
    +            }
    +          }
    +          if (!nested) {
    +            // fetch the content as a snippet of properly escaped HTML.
    +            // Firefox adds newlines at the end.
    +            var content = getInnerHtml(cs);
    +            content = content.replace(/(?:\r\n?|\n)$/, '');
    +
    +            // do the pretty printing
    +            prettyPrintingJob = {
    +              sourceCodeHtml: content,
    +              langExtension: langExtension,
    +              sourceNode: cs
    +            };
    +            applyDecorator(prettyPrintingJob);
    +            replaceWithPrettyPrintedHtml();
    +          }
    +        }
    +      }
    +      if (k < elements.length) {
    +        // finish up in a continuation
    +        setTimeout(doWork, 250);
    +      } else if (opt_whenDone) {
    +        opt_whenDone();
    +      }
    +    }
    +
    +    function replaceWithPrettyPrintedHtml() {
    +      var newContent = prettyPrintingJob.prettyPrintedHtml;
    +      if (!newContent) { return; }
    +      var cs = prettyPrintingJob.sourceNode;
    +
    +      // push the prettified html back into the tag.
    +      if (!isRawContent(cs)) {
    +        // just replace the old html with the new
    +        cs.innerHTML = newContent;
    +      } else {
    +        // we need to change the tag to a <pre> since <xmp>s do not allow
    +        // embedded tags such as the span tags used to attach styles to
    +        // sections of source code.
    +        var pre = document.createElement('PRE');
    +        for (var i = 0; i < cs.attributes.length; ++i) {
    +          var a = cs.attributes[i];
    +          if (a.specified) {
    +            var aname = a.name.toLowerCase();
    +            if (aname === 'class') {
    +              pre.className = a.value;  // For IE 6
    +            } else {
    +              pre.setAttribute(a.name, a.value);
    +            }
    +          }
    +        }
    +        pre.innerHTML = newContent;
    +
    +        // remove the old
    +        cs.parentNode.replaceChild(pre, cs);
    +        cs = pre;
    +      }
    +    }
    +
    +    doWork();
    +  }
    +
    +  window['PR_normalizedHtml'] = normalizedHtml;
    +  window['prettyPrintOne'] = prettyPrintOne;
    +  window['prettyPrint'] = prettyPrint;
    +  window['PR'] = {
    +        'combinePrefixPatterns': combinePrefixPatterns,
    +        'createSimpleLexer': createSimpleLexer,
    +        'registerLangHandler': registerLangHandler,
    +        'sourceDecorator': sourceDecorator,
    +        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
    +        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
    +        'PR_COMMENT': PR_COMMENT,
    +        'PR_DECLARATION': PR_DECLARATION,
    +        'PR_KEYWORD': PR_KEYWORD,
    +        'PR_LITERAL': PR_LITERAL,
    +        'PR_NOCODE': PR_NOCODE,
    +        'PR_PLAIN': PR_PLAIN,
    +        'PR_PUNCTUATION': PR_PUNCTUATION,
    +        'PR_SOURCE': PR_SOURCE,
    +        'PR_STRING': PR_STRING,
    +        'PR_TAG': PR_TAG,
    +        'PR_TYPE': PR_TYPE,
    +        //pw
    +        'PR_FUNCTION' : PR_FUNCTION,
    +        'PR_VARIABLE' : PR_VARIABLE
    +      };
    +})();
    diff --git a/xqdoc/xqdoc_src__framework_base_base-controller.xqy.md b/xqdoc/xqdoc_src__framework_base_base-controller.xqy.md
    new file mode 100644
    index 0000000..06c1126
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_base-controller.xqy.md
    @@ -0,0 +1,219 @@
    +# library module: http://www.xquerrail-framework.com/controller/base
    +  Controller :  Base Controller                Provides Base Controller support for dynamic domain controllers support  
    +
    +
    +Author:    : Gary Vidal  
    +Version:   : 1.0   ~
    +
    +## Table of Contents
    +
    +* Variables: [$collation](#var_collation)
    +* Functions: [initialize\#1](#func_initialize_1), [model\#0](#func_model_0), [controller\#0](#func_controller_0), [invoke\#1](#func_invoke_1), [name\#0](#func_name_0), [main\#0](#func_main_0), [info\#0](#func_info_0), [create\#0](#func_create_0), [get\#0](#func_get_0), [update\#0](#func_update_0), [delete\#0](#func_delete_0), [search\#0](#func_search_0), [list\#0](#func_list_0), [index\#0](#func_index_0), [show\#0](#func_show_0), [new\#0](#func_new_0), [save\#0](#func_save_0), [edit\#0](#func_edit_0), [remove\#0](#func_remove_0), [lookup\#0](#func_lookup_0), [put\#0](#func_put_0), [post\#0](#func_post_0), [fields\#0](#func_fields_0)
    +
    +
    +## Variables
    +
    +### <a name="var_collation"/> $collation
    +```xquery
    +$collation as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_initialize_1"/> initialize\#1
    +```xquery
    +initialize($request
    +)
    +```
    +  Initializes the request with the controller.  This is important to support the ability to use the request and response functions properly. ~
    +
    +
    +#### Params
    +
    +* request as 
    +
    +
    +### <a name="func_model_0"/> model\#0
    +```xquery
    +model(
    +)
    +```
    +  Returns the model associated with a given controller. ~
    +
    +
    +### <a name="func_controller_0"/> controller\#0
    +```xquery
    +controller(
    +)
    +```
    +  Returns the controller definition defined in $application/$application-domain.xml ~
    +
    +
    +### <a name="func_invoke_1"/> invoke\#1
    +```xquery
    +invoke($action
    +)
    +```
    +  This supports the ability to dynamically invoke the controller directly.  The dispatcher will call invoke.  Changes to this function allow to support   new methods not available across all controllers. ~
    +
    +
    +#### Params
    +
    +* action as 
    +
    +
    +### <a name="func_name_0"/> name\#0
    +```xquery
    +name(
    +)
    +```
    +  Returns the name of a given controller   ~
    +
    +
    +### <a name="func_main_0"/> main\#0
    +```xquery
    +main(
    +)
    +```
    +  The Main controller method is the fall through method  when no method/action is specified.  This is done to support  actionless methods such as put, post, get, delete, head, options ~
    +
    +
    +### <a name="func_info_0"/> info\#0
    +```xquery
    +info(
    +)
    +```
    +  Returns an XML representation of the calls and parameters available  from a given controller.  This information should be based on the  public methods of the base controller and action parameters. ~
    +
    +
    +### <a name="func_create_0"/> create\#0
    +```xquery
    +create(
    +)
    +```
    +  Creates an asset based on supplied parameters ~
    +
    +
    +### <a name="func_get_0"/> get\#0
    +```xquery
    +get(
    +)
    +```
    +   Gets a model instance based on its defined parameters for retrieval ~
    +
    +
    +### <a name="func_update_0"/> update\#0
    +```xquery
    +update(
    +)
    +```
    +  Updates a model instance. 
    +
    +
    +### <a name="func_delete_0"/> delete\#0
    +```xquery
    +delete(
    +)
    +```
    +   Deletes a model instance ~
    +
    +
    +### <a name="func_search_0"/> search\#0
    +```xquery
    +search(
    +)
    +```
    +  Provide search interface for a model instance.  
    +
    +                   attribute defined. ~
    +### <a name="func_list_0"/> list\#0
    +```xquery
    +list(
    +)
    +```
    +  Returns a list of records ~
    +
    +
    +### <a name="func_index_0"/> index\#0
    +```xquery
    +index(
    +)
    +```
    +  Default Index Page  ~
    +
    +
    +### <a name="func_show_0"/> show\#0
    +```xquery
    +show(
    +)
    +```
    +   Show a record  ~
    +
    +
    +### <a name="func_new_0"/> new\#0
    +```xquery
    +new(
    +)
    +```
    +   Create a new Record with Edit Capabilites for HTML forms  ~
    +
    +
    +### <a name="func_save_0"/> save\#0
    +```xquery
    +save(
    +)
    +```
    +   HTML Action to make Saves a controller ~
    +
    +
    +### <a name="func_edit_0"/> edit\#0
    +```xquery
    +edit(
    +)
    +```
    +
    +### <a name="func_remove_0"/> remove\#0
    +```xquery
    +remove(
    +)
    +```
    +
    +### <a name="func_lookup_0"/> lookup\#0
    +```xquery
    +lookup(
    +)
    +```
    +  Performs a lookup list from domain model based on   key and keyLabel fields.  Make sure your model defines   these keys for lookup to work properly ~
    +
    +
    +### <a name="func_put_0"/> put\#0
    +```xquery
    +put(
    +)
    +```
    +  Controller action to use HTTP PuT verb.  A put against the controller  will create a new instance of a given model ~
    +
    +
    +### <a name="func_post_0"/> post\#0
    +```xquery
    +post(
    +)
    +```
    +  Controller action to perform POST(update) against a given controller model  It is required to pass in the uuid or id field defined by 
    +
    + attribute  for this to work properly. ~
    +### <a name="func_fields_0"/> fields\#0
    +```xquery
    +fields(
    +)
    +```
    +  HTML Method to support rendering only the fields with values populated  Will render only the fields from an html form. ~
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_base-model.xqy.md b/xqdoc/xqdoc_src__framework_base_base-model.xqy.md
    new file mode 100644
    index 0000000..8f48398
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_base-model.xqy.md
    @@ -0,0 +1,297 @@
    +# library module: http://www.xquerrail-framework.com/model/base
    +  Model : Base  
    +
    +
    +Author:    
    +Version:     ~
    +
    +## Table of Contents
    +
    +* Variables: [$collation](#var_collation)
    +* Functions: [create-id\#0](#func_create-id_0), [get-root-node\#1](#func_get-root-node_1), [get-id-from-params\#2](#func_get-id-from-params_2), [create\#2](#func_create_2), [get\#2](#func_get_2), [update\#2](#func_update_2), [delete\#2](#func_delete_2), [lookup\#2](#func_lookup_2), [list\#2](#func_list_2), [build-search-options\#1](#func_build-search-options_1), [search\#2](#func_search_2), [reference\#2](#func_reference_2), [get-references\#2](#func_get-references_2), [validate\#2](#func_validate_2), [put\#2](#func_put_2), [post\#2](#func_post_2)
    +
    +
    +## Variables
    +
    +### <a name="var_collation"/> $collation
    +```xquery
    +$collation as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_create-id_0"/> create-id\#0
    +```xquery
    +create-id(
    +) as  xs:string
    +```
    +  Generate a random id   
    +
    +
    +#### Returns
    +*  xs:string: a random string
    +
    +### <a name="func_get-root-node_1"/> get-root-node\#1
    +```xquery
    +get-root-node($doc as node()
    +) as  node()
    +```
    +  returns the root element of a given node ~
    +
    +
    +#### Params
    +
    +* doc as  node()
    +
    +
    +#### Returns
    +*  node()
    +
    +### <a name="func_get-id-from-params_2"/> get-id-from-params\#2
    +```xquery
    +get-id-from-params($domain-model as element(domain:model), $params as map:map
    +) as  xs:string?
    +```
    +  Gets the idfield from a given param or UUID as default ~
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model)
    +
    +* params as  map:map
    +
    +
    +#### Returns
    +*  xs:string?
    +
    +### <a name="func_create_2"/> create\#2
    +```xquery
    +create($domain-model as element(domain:model), $params as map:map
    +) as  element()?
    +```
    +  Create packageType  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model) the model of the document
    +
    +* params as  map:map the values to fill into the element
    +
    +
    +#### Returns
    +*  element()?
    +
    +### <a name="func_get_2"/> get\#2
    +```xquery
    +get($domain-model as element(domain:model), $params as map:map
    +) as  element()?
    +```
    +  Retrieves a model document by id  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model) the model of the document
    +
    +* params as  map:map the values to pull the id from
    +
    +
    +#### Returns
    +*  element()?: the document ~
    +
    +### <a name="func_update_2"/> update\#2
    +```xquery
    +update($domain-model as element(domain:model), $params as map:map
    +) as  element()?
    +```
    +  Update Operation packageType  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model) the model of the document
    +
    +* params as  map:map the values to fill into the element
    +
    +
    +#### Returns
    +*  element()?
    +
    +### <a name="func_delete_2"/> delete\#2
    +```xquery
    +delete($domain-model as element(domain:model),$params as map:map
    +) as  xs:boolean
    +```
    +  Deletes the model document  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model) the model of the document
    +
    +* params as  map:map the values to fill into the element
    +
    +
    +#### Returns
    +*  xs:boolean: xs:boolean denoted whether delete occurred
    +
    +### <a name="func_lookup_2"/> lookup\#2
    +```xquery
    +lookup($domain-model as element(domain:model), $params as map:map
    +)
    +```
    +  Returns a key value pair of lookup values for use in populating comboboxes from a model  You must define your key/keyLabel attributes on the model for this to work. ~
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model)
    +
    +* params as  map:map
    +
    +
    +### <a name="func_list_2"/> list\#2
    +```xquery
    +list($domain-model as element(domain:model), $params as map:map
    +) as  element(list)?
    +```
    +  Returns a list of model instances  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model)
    +
    +* params as  map:map
    +
    +
    +#### Returns
    +*  element(list)?: element({model})\*
    +
    +### <a name="func_build-search-options_1"/> build-search-options\#1
    +```xquery
    +build-search-options($domain-model as element(domain:model)
    +) as  element(search:options)
    +```
    +  Build search options for a given domain model  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model) the model of the content type
    +
    +
    +#### Returns
    +*  element(search:options): search options for the given model
    +
    +### <a name="func_search_2"/> search\#2
    +```xquery
    +search($domain-model as element(domain:model), $params as map:map
    +) as  element(search:response)
    +```
    +  Provide search interface for the model  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model) the model of the content type
    +
    +* params as  map:map the values to fill into the search
    +
    +
    +#### Returns
    +*  element(search:response): search response element ~
    +
    +### <a name="func_reference_2"/> reference\#2
    +```xquery
    +reference($domain-model as element(domain:model), $params as map:map
    +) as  element()?
    +```
    +   This function will create a sequence of nodes that represent each  model for inlining in other references.   
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model)
    +
    +* params as  map:map
    +
    +
    +#### Returns
    +*  element()?: a sequence of packageType
    +
    +### <a name="func_get-references_2"/> get-references\#2
    +```xquery
    +get-references($reference as element(domain:element), $params as map:map
    +) as  element()*
    +```
    +  This function will call the appropriate reference type model to build   a relationship between two models types.  
    +
    +
    +#### Params
    +
    +* reference as  element(domain:element) is the reference element that is used to contain the references
    +
    +* params as  map:map the params items to build the relationship
    +
    +
    +#### Returns
    +*  element()\*
    +
    +### <a name="func_validate_2"/> validate\#2
    +```xquery
    +validate($domain-model as element(domain:model), $params as map:map
    +) as  element(validationError)*
    +```
    +   This is a function that will validate the params with the domain model  
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model) the model to validate against
    +
    +* params as  map:map the params to validate
    +
    +
    +#### Returns
    +*  element(validationError)\*: return a set of validation errors if any occur.
    +
    +### <a name="func_put_2"/> put\#2
    +```xquery
    +put($domain-model as element(domain:model), $body as node()
    +)
    +```
    +  Provides the ability to put a new document in the database. ~
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model)
    +
    +* body as  node()
    +
    +
    +### <a name="func_post_2"/> post\#2
    +```xquery
    +post($domain-model as element(domain:model), $body as node()
    +)
    +```
    +  Provides the ability to post an update to an existing model in the database ~
    +
    +
    +#### Params
    +
    +* domain-model as  element(domain:model)
    +
    +* body as  node()
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_footer.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_footer.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_footer.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_head.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_head.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_head.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_header.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_header.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_header.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_index.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_index.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_index.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_login.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_login.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_login.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_main.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_main.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_main.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_navigation.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_navigation.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_navigation.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_sidebar.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_sidebar.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_sidebar.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_templates_subnavigation.html.xqy.md b/xqdoc/xqdoc_src__framework_base_templates_subnavigation.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_templates_subnavigation.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.edit.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.edit.html.xqy.md
    new file mode 100644
    index 0000000..1775df7
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.edit.html.xqy.md
    @@ -0,0 +1,20 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +* Variables: [$response](#var_response)
    +
    +
    +## Variables
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as  map:map
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.fields.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.fields.html.xqy.md
    new file mode 100644
    index 0000000..4032eed
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.fields.html.xqy.md
    @@ -0,0 +1,10 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.index.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.index.html.xqy.md
    new file mode 100644
    index 0000000..1775df7
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.index.html.xqy.md
    @@ -0,0 +1,20 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +* Variables: [$response](#var_response)
    +
    +
    +## Variables
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as  map:map
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.info.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.info.html.xqy.md
    new file mode 100644
    index 0000000..74aed6e
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.info.html.xqy.md
    @@ -0,0 +1,10 @@
    +# library module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.new.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.new.html.xqy.md
    new file mode 100644
    index 0000000..1775df7
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.new.html.xqy.md
    @@ -0,0 +1,20 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +* Variables: [$response](#var_response)
    +
    +
    +## Variables
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as  map:map
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.remove.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.remove.html.xqy.md
    new file mode 100644
    index 0000000..1775df7
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.remove.html.xqy.md
    @@ -0,0 +1,20 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +* Variables: [$response](#var_response)
    +
    +
    +## Variables
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as  map:map
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.save.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.save.html.xqy.md
    new file mode 100644
    index 0000000..1775df7
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.save.html.xqy.md
    @@ -0,0 +1,20 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +* Variables: [$response](#var_response)
    +
    +
    +## Variables
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as  map:map
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_base_views_base.show.html.xqy.md b/xqdoc/xqdoc_src__framework_base_views_base.show.html.xqy.md
    new file mode 100644
    index 0000000..1775df7
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_base_views_base.show.html.xqy.md
    @@ -0,0 +1,20 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +* Variables: [$response](#var_response)
    +
    +
    +## Variables
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as  map:map
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_builders_controller-builder.xqy.md b/xqdoc/xqdoc_src__framework_builders_controller-builder.xqy.md
    new file mode 100644
    index 0000000..74aed6e
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_builders_controller-builder.xqy.md
    @@ -0,0 +1,10 @@
    +# library module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_config.xqy.md b/xqdoc/xqdoc_src__framework_config.xqy.md
    new file mode 100644
    index 0000000..055d751
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_config.xqy.md
    @@ -0,0 +1,149 @@
    +# library module: http://www.xquerrail-framework.com/config
    +
    +
    +## Table of Contents
    +
    +* Variables: [$CONFIG](#var_CONFIG), [$ENGINE-PATH](#var_ENGINE-PATH), [$ERROR-RESOURCE-CONFIGURATION](#var_ERROR-RESOURCE-CONFIGURATION)
    +* Functions: [default-controller\#0](#func_default-controller_0), [resource-directory\#0](#func_resource-directory_0), [default-action\#0](#func_default-action_0), [default-format\#0](#func_default-format_0), [get-dispatcher\#0](#func_get-dispatcher_0), [get-application\#1](#func_get-application_1), [application-directory\#1](#func_application-directory_1), [get-domain\#1](#func_get-domain_1), [get-routes\#0](#func_get-routes_0), [get-engine\#1](#func_get-engine_1), [get-model-xqy-path\#1](#func_get-model-xqy-path_1)
    +
    +
    +## Variables
    +
    +### <a name="var_CONFIG"/> $CONFIG
    +```xquery
    +$CONFIG as 
    +```
    +
    +### <a name="var_ENGINE-PATH"/> $ENGINE-PATH
    +```xquery
    +$ENGINE-PATH as 
    +```
    +
    +### <a name="var_ERROR-RESOURCE-CONFIGURATION"/> $ERROR-RESOURCE-CONFIGURATION
    +```xquery
    +$ERROR-RESOURCE-CONFIGURATION as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_default-controller_0"/> default-controller\#0
    +```xquery
    +default-controller(
    +)
    +```
    +  Returns the default controller for entire application usually default 
    +
    +
    +### <a name="func_resource-directory_0"/> resource-directory\#0
    +```xquery
    +resource-directory(
    +) as  xs:string
    +```
    +  Returns the resource directory for framework defined in /_config/config.xml ~
    +
    +
    +#### Returns
    +*  xs:string
    +
    +### <a name="func_default-action_0"/> default-action\#0
    +```xquery
    +default-action(
    +)
    +```
    +  Returns the default action  
    +
    +
    +### <a name="func_default-format_0"/> default-format\#0
    +```xquery
    +default-format(
    +)
    +```
    +  Returns the default format 
    +
    +
    +### <a name="func_get-dispatcher_0"/> get-dispatcher\#0
    +```xquery
    +get-dispatcher(
    +)
    +```
    +  returns the default dispatcher for entire framework. ~
    +
    +
    +### <a name="func_get-application_1"/> get-application\#1
    +```xquery
    +get-application($application-name as xs:string
    +)
    +```
    +  returns the application configuration for a given application by name  
    +
    +
    +#### Params
    +
    +* application-name as  xs:string - Application name ~
    +
    +
    +### <a name="func_application-directory_1"/> application-directory\#1
    +```xquery
    +application-directory($name
    +)
    +```
    +  Get the current application directory 
    +
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_get-domain_1"/> get-domain\#1
    +```xquery
    +get-domain($application-name
    +)
    +```
    +   Get the domain for a given asset ~
    +
    +
    +#### Params
    +
    +* application-name as 
    +
    +
    +### <a name="func_get-routes_0"/> get-routes\#0
    +```xquery
    +get-routes(
    +)
    +```
    +  Returns the routes configuration file  
    +
    +
    +### <a name="func_get-engine_1"/> get-engine\#1
    +```xquery
    +get-engine($response as map:map
    +)
    +```
    +  Returns the engine for processing requests satisfying the request ~
    +
    +
    +#### Params
    +
    +* response as  map:map
    +
    +
    +### <a name="func_get-model-xqy-path_1"/> get-model-xqy-path\#1
    +```xquery
    +get-model-xqy-path($model-name as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* model-name as  xs:string
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_dispatchers_dispatcher.web.xqy.md b/xqdoc/xqdoc_src__framework_dispatchers_dispatcher.web.xqy.md
    new file mode 100644
    index 0000000..fe93070
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_dispatchers_dispatcher.web.xqy.md
    @@ -0,0 +1,126 @@
    +# main module: 
    +
    +
    +## Table of Contents
    +
    +* Variables: [$REPORT-HTML-ERRORS](#var_REPORT-HTML-ERRORS)
    +* Functions: [report-error\#3](#func_report-error_3), [html-wrapper\#3](#func_html-wrapper_3), [controller-exists\#1](#func_controller-exists_1), [view-exists\#1](#func_view-exists_1), [controller\#0](#func_controller_0), [render\#2](#func_render_2)
    +
    +
    +## Variables
    +
    +### <a name="var_REPORT-HTML-ERRORS"/> $REPORT-HTML-ERRORS
    +```xquery
    +$REPORT-HTML-ERRORS as  xs:boolean
    +```
    + convert error into html page or as simple element 
    +
    +
    +
    +
    +## Functions
    +
    +### <a name="func_report-error_3"/> report-error\#3
    +```xquery
    +report-error(
    +   $response-code as xs:integer, 
    +   $title as xs:string, 
    +   $response-text as xs:string
    +) as  element()
    +```
    +  handle formatting the error message as html or as element(error)  
    +
    +
    +#### Params
    +
    +* response-code as  xs:integer
    +
    +* title as  xs:string
    +
    +* response-text as  xs:string The string message of the error
    +
    +
    +#### Returns
    +*  element(): element containing error
    +
    +### <a name="func_html-wrapper_3"/> html-wrapper\#3
    +```xquery
    +html-wrapper(
    +    $response-code as xs:integer, 
    +    $title as xs:string, 
    +    $response-text as xs:string
    +) as  element()
    +```
    +  Wrap the specified string in html for friendly message display.  
    +
    +
    +#### Params
    +
    +* response-code as  xs:integer
    +
    +* title as  xs:string
    +
    +* response-text as  xs:string The string message of the errror
    +
    +
    +#### Returns
    +*  element(): element(htm:html) An element(htm:html) containing the html response.
    +
    +### <a name="func_controller-exists_1"/> controller-exists\#1
    +```xquery
    +controller-exists($controller-uri as xs:string
    +) as  xs:boolean
    +```
    +  Returns wether the controller exists or not ~
    +
    +
    +#### Params
    +
    +* controller-uri as  xs:string
    +
    +
    +#### Returns
    +*  xs:boolean
    +
    +### <a name="func_view-exists_1"/> view-exists\#1
    +```xquery
    +view-exists($view-uri as xs:string
    +) as  xs:boolean
    +```
    +
    +#### Params
    +
    +* view-uri as  xs:string
    +
    +
    +#### Returns
    +*  xs:boolean
    +
    +### <a name="func_controller_0"/> controller\#0
    +```xquery
    +controller(
    +)
    +```
    +   Executes a named controller using REST methods interface ~
    +
    +
    +### <a name="func_render_2"/> render\#2
    +```xquery
    +render($response,$request
    +)
    +```
    +  Renders the output  ~
    +
    +
    +#### Params
    +
    +* response as 
    +
    +* request as 
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_dispatchers_dispatcher.xcc.xqy.md b/xqdoc/xqdoc_src__framework_dispatchers_dispatcher.xcc.xqy.md
    new file mode 100644
    index 0000000..74aed6e
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_dispatchers_dispatcher.xcc.xqy.md
    @@ -0,0 +1,10 @@
    +# library module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_domain.xqy.md b/xqdoc/xqdoc_src__framework_domain.xqy.md
    new file mode 100644
    index 0000000..4de4a29
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_domain.xqy.md
    @@ -0,0 +1,124 @@
    +# library module: http://www.xquerrail-framework.com/domain
    +  Domain Operations and functions for accessing domain configuration  ~
    +
    +
    +
    +## Table of Contents
    +
    +* Functions: [resolve-datatype\#1](#func_resolve-datatype_1), [get-controllers\#1](#func_get-controllers_1), [get-controller\#2](#func_get-controller_2), [get-controller-model\#2](#func_get-controller-model_2), [get-domain-model\#2](#func_get-domain-model_2), [get-domain-model\#1](#func_get-domain-model_1)
    +
    +
    +## Functions
    +
    +### <a name="func_resolve-datatype_1"/> resolve-datatype\#1
    +```xquery
    +resolve-datatype($field
    +)
    +```
    +  Returns the XDM/ML datatype of a XQuerrail datatype.  
    +
    +
    +#### Params
    +
    +* field as  - Domain Field such as domain:element|domain:container|domain:attribute ~
    +
    +
    +### <a name="func_get-controllers_1"/> get-controllers\#1
    +```xquery
    +get-controllers(
    +   $application-name as xs:string
    +) as  element(domain:controller)*
    +```
    +  Returns a list of controllers defined for a given domain  
    +
    +
    +#### Params
    +
    +* application-name as  xs:string - Name of the application to retrieve the controllers ~
    +
    +
    +#### Returns
    +*  element(domain:controller)\*
    +
    +### <a name="func_get-controller_2"/> get-controller\#2
    +```xquery
    +get-controller(
    +   $application-name as xs:string,
    +   $controller-name as xs:string
    +) as  element(domain:controller)?
    +```
    +  Gets the definition of a controller from the domain configuration  
    +
    +
    +#### Params
    +
    +* application-name as  xs:string - Name of the application
    +
    +* controller-name as  xs:string - Name of the controller ~
    +
    +
    +#### Returns
    +*  element(domain:controller)?
    +
    +### <a name="func_get-controller-model_2"/> get-controller-model\#2
    +```xquery
    +get-controller-model(
    +    $application-name as xs:string, 
    +    $controller-name as xs:string
    +) as  element(domain:model)?
    +```
    +  Returns the model defined by a given controller  
    +
    +
    +#### Params
    +
    +* application-name as  xs:string - Name of the application
    +
    +* controller-name as  xs:string - Name of the controller
    +
    +
    +#### Returns
    +*  element(domain:model)?: Model assigned by controller ~
    +
    +### <a name="func_get-domain-model_2"/> get-domain-model\#2
    +```xquery
    +get-domain-model(
    +    $application-name as xs:string,
    +    $domain-name as xs:string
    +) as  element()?
    +```
    +  Returns a model from an application domain  
    +
    +
    +#### Params
    +
    +* application-name as  xs:string - Name of the application
    +
    +* domain-name as  xs:string
    +
    +
    +#### Returns
    +*  element()?
    +
    +### <a name="func_get-domain-model_1"/> get-domain-model\#1
    +```xquery
    +get-domain-model(
    +    $model-name as xs:string
    +) as  element()?
    +```
    +  Returns a model from the application domain.  Deprecated use full function to get appropriate model  
    +
    +
    +#### Params
    +
    +* model-name as  xs:string
    +
    +
    +#### Returns
    +*  element()?
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_engines_engine.base.xqy.md b/xqdoc/xqdoc_src__framework_engines_engine.base.xqy.md
    new file mode 100644
    index 0000000..a2dc491
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_engines_engine.base.xqy.md
    @@ -0,0 +1,317 @@
    +# library module: http://www.xquerrail-framework.com/engine
    +  Performs core engine for transformation and base implementation for   different format engines ~
    +
    +
    +
    +## Table of Contents
    +
    +* Variables: [$engine-transformer](#var_engine-transformer), [$visitor](#var_visitor), [$_child-engine-tags](#var__child-engine-tags), [$_helpers](#var__helpers), [$_for_vars](#var__for_vars)
    +* Functions: [set-engine-transformer\#1](#func_set-engine-transformer_1), [register-tags\#1](#func_register-tags_1), [tag-is-registered\#1](#func_tag-is-registered_1), [consume\#1](#func_consume_1), [visit\#1](#func_visit_1), [visited\#1](#func_visited_1), [transform-if\#1](#func_transform-if_1), [process-for-this\#2](#func_process-for-this_2), [process-for-context\#2](#func_process-for-context_2), [transform-for\#1](#func_transform-for_1), [transform-has_slot\#1](#func_transform-has_slot_1), [transform-slot\#1](#func_transform-slot_1), [template-uri\#1](#func_template-uri_1), [view-exists\#1](#func_view-exists_1), [view-uri\#2](#func_view-uri_2), [render-template\#1](#func_render-template_1), [render-partial\#1](#func_render-partial_1), [render-view\#0](#func_render-view_0), [transform-template\#1](#func_transform-template_1), [transform-view\#1](#func_transform-view_1), [transform-dynamic\#1](#func_transform-dynamic_1), [transform\#1](#func_transform_1)
    +
    +
    +## Variables
    +
    +### <a name="var_engine-transformer"/> $engine-transformer
    +```xquery
    +$engine-transformer as  xdmp:function?
    +```
    +
    +### <a name="var_visitor"/> $visitor
    +```xquery
    +$visitor as 
    +```
    +
    +### <a name="var__child-engine-tags"/> $_child-engine-tags
    +```xquery
    +$_child-engine-tags as 
    +```
    +
    +### <a name="var__helpers"/> $_helpers
    +```xquery
    +$_helpers as 
    +```
    +
    +### <a name="var__for_vars"/> $_for_vars
    +```xquery
    +$_for_vars as 
    +```
    +  The for iterator requires a global stack 
    +
    +
    +
    +
    +## Functions
    +
    +### <a name="func_set-engine-transformer_1"/> set-engine-transformer\#1
    +```xquery
    +set-engine-transformer($func as xdmp:function
    +)
    +```
    +  To allow your engine to route transform calls from base  You must register your engines transformer function in  order for the base engine to route any functions you will handle ~
    +
    +
    +#### Params
    +
    +* func as  xdmp:function
    +
    +
    +### <a name="func_register-tags_1"/> register-tags\#1
    +```xquery
    +register-tags($tagnames as xs:QName*
    +)
    +```
    +  Register any custom tags you will be overriding from custom engine ~
    +
    +
    +#### Params
    +
    +* tagnames as  xs:QName\*
    +
    +
    +### <a name="func_tag-is-registered_1"/> tag-is-registered\#1
    +```xquery
    +tag-is-registered(
    +  $tag as xs:string
    +)
    +```
    +  Check to see if a tag has been registered with the engine ~
    +
    +
    +#### Params
    +
    +* tag as  xs:string
    +
    +
    +### <a name="func_consume_1"/> consume\#1
    +```xquery
    +consume($node
    +)
    +```
    +  Marks that a node has been visited during transformation  When building custom tag that requires a closing tag   ensure that you consume the results you process or you  will find duplicate or spurious output results  ~
    +
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_visit_1"/> visit\#1
    +```xquery
    +visit($node
    +)
    +```
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_visited_1"/> visited\#1
    +```xquery
    +visited($node
    +)
    +```
    +   Returns boolean value of whether a node has been visited. ~
    +
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_transform-if_1"/> transform-if\#1
    +```xquery
    +transform-if($node as node()
    +)
    +```
    +  Transforms an if tag for processing ~
    +
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_process-for-this_2"/> process-for-this\#2
    +```xquery
    +process-for-this(
    +   $this-tag as processing-instruction("this"),
    +   $this
    +)
    +```
    +  The for tag must handle its one process  and return the context to the user ~
    +
    +
    +#### Params
    +
    +* this-tag as  processing-instruction("this")
    +
    +* this as 
    +
    +
    +### <a name="func_process-for-context_2"/> process-for-context\#2
    +```xquery
    +process-for-context($nodes,$context
    +)
    +```
    +  The for tag must handle its one process  and return the context to the user ~
    +
    +
    +#### Params
    +
    +* nodes as 
    +
    +* context as 
    +
    +
    +### <a name="func_transform-for_1"/> transform-for\#1
    +```xquery
    +transform-for(
    +   $for-tag as processing-instruction("for")
    +)
    +```
    +
    +#### Params
    +
    +* for-tag as  processing-instruction("for")
    +
    +
    +### <a name="func_transform-has_slot_1"/> transform-has_slot\#1
    +```xquery
    +transform-has_slot($node as node()
    +)
    +```
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_transform-slot_1"/> transform-slot\#1
    +```xquery
    +transform-slot($node as node()
    +)
    +```
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_template-uri_1"/> template-uri\#1
    +```xquery
    +template-uri($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_view-exists_1"/> view-exists\#1
    +```xquery
    +view-exists($view-uri as xs:string
    +) as  xs:boolean
    +```
    +
    +#### Params
    +
    +* view-uri as  xs:string
    +
    +
    +#### Returns
    +*  xs:boolean
    +
    +### <a name="func_view-uri_2"/> view-uri\#2
    +```xquery
    +view-uri($controller,$action
    +)
    +```
    +
    +#### Params
    +
    +* controller as 
    +
    +* action as 
    +
    +
    +### <a name="func_render-template_1"/> render-template\#1
    +```xquery
    +render-template($response
    +)
    +```
    +
    +#### Params
    +
    +* response as 
    +
    +
    +### <a name="func_render-partial_1"/> render-partial\#1
    +```xquery
    +render-partial($response
    +)
    +```
    +  Partial rendering intercepts a call and routes only the view, even if a template is defined.  This is to support ajax type calls for rendering views in a frame or container ~
    +
    +
    +#### Params
    +
    +* response as 
    +
    +
    +### <a name="func_render-view_0"/> render-view\#0
    +```xquery
    +render-view(
    +)
    +```
    +
    +### <a name="func_transform-template_1"/> transform-template\#1
    +```xquery
    +transform-template($node
    +)
    +```
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_transform-view_1"/> transform-view\#1
    +```xquery
    +transform-view($node
    +)
    +```
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_transform-dynamic_1"/> transform-dynamic\#1
    +```xquery
    +transform-dynamic($node as node()
    +)
    +```
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_transform_1"/> transform\#1
    +```xquery
    +transform($node as item()
    +)
    +```
    +
    +#### Params
    +
    +* node as  item()
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_engines_engine.html.xqy.md b/xqdoc/xqdoc_src__framework_engines_engine.html.xqy.md
    new file mode 100644
    index 0000000..46f7e9d
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_engines_engine.html.xqy.md
    @@ -0,0 +1,206 @@
    +# library module: http://www.xquerrail-framework.com/engine
    +
    +
    +## Table of Contents
    +
    +* Variables: [$request](#var_request), [$response](#var_response), [$context](#var_context), [$engine-tags](#var_engine-tags), [$html-strict](#var_html-strict), [$html-transitional](#var_html-transitional), [$html-frameset](#var_html-frameset), [$xhtml-strict](#var_xhtml-strict), [$xhtml-transitional](#var_xhtml-transitional), [$xhtml-frameset](#var_xhtml-frameset), [$xhtml-1.1](#var_xhtml-1.1)
    +* Functions: [initialize\#2](#func_initialize_2), [transform-include_metas\#1](#func_transform-include_metas_1), [transform-http_metas\#1](#func_transform-http_metas_1), [transform-title\#1](#func_transform-title_1), [transform-controller-script\#1](#func_transform-controller-script_1), [transform-controller-stylesheet\#1](#func_transform-controller-stylesheet_1), [transform-controller-list\#1](#func_transform-controller-list_1), [custom-transform\#1](#func_custom-transform_1), [redirect\#1](#func_redirect_1), [render\#0](#func_render_0)
    +
    +
    +## Variables
    +
    +### <a name="var_request"/> $request
    +```xquery
    +$request as 
    +```
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as 
    +```
    +
    +### <a name="var_context"/> $context
    +```xquery
    +$context as 
    +```
    +
    +### <a name="var_engine-tags"/> $engine-tags
    +```xquery
    +$engine-tags as 
    +```
    +  Custom Tags the HTML Engine renders and handles during transform ~
    +
    +
    +### <a name="var_html-strict"/> $html-strict
    +```xquery
    +$html-strict as 
    +```
    +  Some Common settings for html  ~
    +
    +
    +### <a name="var_html-transitional"/> $html-transitional
    +```xquery
    +$html-transitional as 
    +```
    +
    +### <a name="var_html-frameset"/> $html-frameset
    +```xquery
    +$html-frameset as 
    +```
    +
    +### <a name="var_xhtml-strict"/> $xhtml-strict
    +```xquery
    +$xhtml-strict as 
    +```
    +
    +### <a name="var_xhtml-transitional"/> $xhtml-transitional
    +```xquery
    +$xhtml-transitional as 
    +```
    +
    +### <a name="var_xhtml-frameset"/> $xhtml-frameset
    +```xquery
    +$xhtml-frameset as 
    +```
    +
    +### <a name="var_xhtml-1.1"/> $xhtml-1.1
    +```xquery
    +$xhtml-1.1 as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_initialize_2"/> initialize\#2
    +```xquery
    +initialize($resp,$req
    +)
    +```
    +  Initialize the engine passing the request and response for the given object. ~
    +
    +
    +#### Params
    +
    +* resp as 
    +
    +* req as 
    +
    +
    +### <a name="func_transform-include_metas_1"/> transform-include_metas\#1
    +```xquery
    +transform-include_metas($node as node()
    +)
    +```
    +  Returns a  element for use in http header ~
    +
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_transform-http_metas_1"/> transform-http_metas\#1
    +```xquery
    +transform-http_metas($node as node()
    +)
    +```
    +   Renders out HTTP meta elements to header ~
    +
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_transform-title_1"/> transform-title\#1
    +```xquery
    +transform-title($node as node()
    +)
    +```
    +  Custom Tag for rendering Label or Title of Controller.  This is set using the  response:set-title("MY Title") function during controller invocation ~
    +
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_transform-controller-script_1"/> transform-controller-script\#1
    +```xquery
    +transform-controller-script($node
    +)
    +```
    +  Generates a script element for the given controller.  If a controller   script is defined in the template the system will check to see if the  file exists on the system before rendering any output ~
    +
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_transform-controller-stylesheet_1"/> transform-controller-stylesheet\#1
    +```xquery
    +transform-controller-stylesheet($node
    +)
    +```
    +  Generates a script element for the given controller.  If a controller   script is defined in the template the system will check to see if the  file exists on the system before rendering any output ~
    +
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_transform-controller-list_1"/> transform-controller-list\#1
    +```xquery
    +transform-controller-list($node
    +)
    +```
    +   Returns a list of controllers as a unordered list.   This can be used during app generation to quickly test   New controllers.  
    +
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_custom-transform_1"/> custom-transform\#1
    +```xquery
    +custom-transform($node as node()
    +)
    +```
    +  Custom Transformer handles HTML specific templates and  Tags. ~
    +
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_redirect_1"/> redirect\#1
    +```xquery
    +redirect($path
    +)
    +```
    +  Handles redirection.  The redirector will try to ensure a valid route is defined to handle the request  If the redirect does not map to an existing route then   will throw invalid redirect error. ~
    +
    +
    +#### Params
    +
    +* path as 
    +
    +
    +### <a name="func_render_0"/> render\#0
    +```xquery
    +render(
    +)
    +```
    +  Renders the HTML response. ~
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_engines_engine.json.xqy.md b/xqdoc/xqdoc_src__framework_engines_engine.json.xqy.md
    new file mode 100644
    index 0000000..74aed6e
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_engines_engine.json.xqy.md
    @@ -0,0 +1,10 @@
    +# library module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_engines_engine.xml.xqy.md b/xqdoc/xqdoc_src__framework_engines_engine.xml.xqy.md
    new file mode 100644
    index 0000000..b6125c9
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_engines_engine.xml.xqy.md
    @@ -0,0 +1,109 @@
    +# library module: http://www.xquerrail-framework.com/engine
    +
    +
    +## Table of Contents
    +
    +* Variables: [$request](#var_request), [$response](#var_response), [$context](#var_context), [$custom-engine-tags](#var_custom-engine-tags), [$custom-transform-function](#var_custom-transform-function)
    +* Functions: [initialize\#2](#func_initialize_2), [internal-render-view\#1](#func_internal-render-view_1), [render-xml\#1](#func_render-xml_1), [custom-transform\#1](#func_custom-transform_1), [render\#0](#func_render_0)
    +
    +
    +## Variables
    +
    +### <a name="var_request"/> $request
    +```xquery
    +$request as 
    +```
    +  You initialize your variables ~
    +
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as 
    +```
    +
    +### <a name="var_context"/> $context
    +```xquery
    +$context as 
    +```
    +
    +### <a name="var_custom-engine-tags"/> $custom-engine-tags
    +```xquery
    +$custom-engine-tags as  xs:QName\*
    +```
    + Initialize  Any custom tags your engine handles so the system can call  your custom transform functions ~
    +
    +
    +### <a name="var_custom-transform-function"/> $custom-transform-function
    +```xquery
    +$custom-transform-function as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_initialize_2"/> initialize\#2
    +```xquery
    +initialize($_response,$_request
    +)
    +```
    +  The Main Controller will call your initialize method  and register your engine with the engine.base.xqy ~
    +
    +
    +#### Params
    +
    +* _response as 
    +
    +* _request as 
    +
    +
    +### <a name="func_internal-render-view_1"/> internal-render-view\#1
    +```xquery
    +internal-render-view($response
    +)
    +```
    +  No need to use the views  ~
    +
    +
    +#### Params
    +
    +* response as 
    +
    +
    +### <a name="func_render-xml_1"/> render-xml\#1
    +```xquery
    +render-xml($node
    +)
    +```
    +
    +#### Params
    +
    +* node as 
    +
    +
    +### <a name="func_custom-transform_1"/> custom-transform\#1
    +```xquery
    +custom-transform($node as item()
    +)
    +```
    + Handle your custom tags in this method or the method you have assigned   initialized with the base.engine It is important that you only handle your custom tags and any content that is required to be consumed by your tags ~
    +
    +
    +#### Params
    +
    +* node as  item()
    +
    +
    +### <a name="func_render_0"/> render\#0
    +```xquery
    +render(
    +)
    +```
    +  The Kernel controller will call your render method.  From this point it is up to your engine to handle   to initialize any specific response settings and  and start the rendering process  ~
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_helpers_formbuilder-lists.xqy.md b/xqdoc/xqdoc_src__framework_helpers_formbuilder-lists.xqy.md
    new file mode 100644
    index 0000000..c8fbf0b
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_helpers_formbuilder-lists.xqy.md
    @@ -0,0 +1,35 @@
    +# library module: http://www.xquerrail-framework.com/formbuilder/lists
    +
    +
    +## Table of Contents
    +
    +* Variables: [$countries](#var_countries), [$timezones](#var_timezones), [$locales](#var_locales), [$languages](#var_languages)
    +
    +
    +## Variables
    +
    +### <a name="var_countries"/> $countries
    +```xquery
    +$countries as 
    +```
    +
    +### <a name="var_timezones"/> $timezones
    +```xquery
    +$timezones as 
    +```
    +
    +### <a name="var_locales"/> $locales
    +```xquery
    +$locales as 
    +```
    +
    +### <a name="var_languages"/> $languages
    +```xquery
    +$languages as 
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_helpers_formbuilder.xqy.md b/xqdoc/xqdoc_src__framework_helpers_formbuilder.xqy.md
    new file mode 100644
    index 0000000..446f72b
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_helpers_formbuilder.xqy.md
    @@ -0,0 +1,1247 @@
    +# library module: http://www.xquerrail-framework.com/formbuilder
    +
    +
    +## Table of Contents
    +
    +* Variables: [$_form-controls](#var__form-controls), [$_form-options](#var__form-options), [$_form-bindings](#var__form-bindings), [$_control-options](#var__control-options), [$_request](#var__request), [$FORM-INDEX-COUNT](#var_FORM-INDEX-COUNT), [$FORM-INDEX](#var_FORM-INDEX), [$FORM-VALIDATIONS](#var_FORM-VALIDATIONS), [$CONTROL-OPTIONS](#var_CONTROL-OPTIONS)
    +* Functions: [ get-control-options\#1](#func_ get-control-options_1), [ control-options\#2](#func_ control-options_2), [ control-option\#2](#func_ control-option_2), [ control-option\#3](#func_ control-option_3), [ control-option\#4](#func_ control-option_4), [bind\#1](#func_bind_1), [flush\#0](#func_flush_0), [parse-options\#1](#func_parse-options_1), [render-before\#4](#func_render-before_4), [render-after\#4](#func_render-after_4), [render-attributes\#4](#func_render-attributes_4), [render-values\#4](#func_render-values_4), [render-custom\#4](#func_render-custom_4), [render-text\#4](#func_render-text_4), [render-money\#4](#func_render-money_4), [render-number\#4](#func_render-number_4), [render-password\#4](#func_render-password_4), [render-email\#4](#func_render-email_4), [render-search\#4](#func_render-search_4), [render-url\#4](#func_render-url_4), [render-choice\#4](#func_render-choice_4), [render-entity\#4](#func_render-entity_4), [render-country\#4](#func_render-country_4), [render-locale\#4](#func_render-locale_4), [render-timezone\#4](#func_render-timezone_4), [render-date\#4](#func_render-date_4), [render-dateTime\#4](#func_render-dateTime_4), [render-birthday\#4](#func_render-birthday_4), [render-collection\#4](#func_render-collection_4), [render-repeated\#4](#func_render-repeated_4), [render-hidden\#4](#func_render-hidden_4), [render-button\#4](#func_render-button_4), [render-submit\#4](#func_render-submit_4), [render-clear\#4](#func_render-clear_4), [render-file\#4](#func_render-file_4), [render-csrf\#4](#func_render-csrf_4), [render-complex\#4](#func_render-complex_4), [render-grid\#5](#func_render-grid_5), [render-reference\#4](#func_render-reference_4), [render-query\#5](#func_render-query_5), [render-control\#5](#func_render-control_5), [name\#1](#func_name_1), [name\#0](#func_name_0), [method\#1](#func_method_1), [method\#0](#func_method_0), [action\#1](#func_action_1), [action\#0](#func_action_0), [target\#1](#func_target_1), [target\#0](#func_target_0), [accept-charset\#1](#func_accept-charset_1), [accept-charset\#0](#func_accept-charset_0), [accept\#1](#func_accept_1), [accept\#0](#func_accept_0), [enctype\#1](#func_enctype_1), [enctype\#0](#func_enctype_0), [add-custom\#3](#func_add-custom_3), [text\#2](#func_text_2), [textarea\#2](#func_textarea_2), [email\#2](#func_email_2), [money\#2](#func_money_2), [number\#2](#func_number_2), [password\#2](#func_password_2), [search\#2](#func_search_2), [url\#2](#func_url_2), [choice\#3](#func_choice_3), [entity\#3](#func_entity_3), [country\#2](#func_country_2), [locale\#2](#func_locale_2), [timezone\#2](#func_timezone_2), [language\#2](#func_language_2), [date\#2](#func_date_2), [dateTime\#2](#func_dateTime_2), [time\#2](#func_time_2), [birthday\#2](#func_birthday_2), [checkbox\#2](#func_checkbox_2), [radio\#2](#func_radio_2), [file\#2](#func_file_2), [collection\#2](#func_collection_2), [repeated\#2](#func_repeated_2), [hidden\#2](#func_hidden_2), [button\#2](#func_button_2), [submit\#2](#func_submit_2), [validation\#2](#func_validation_2), [csrf\#2](#func_csrf_2)
    +
    +
    +## Variables
    +
    +### <a name="var__form-controls"/> $_form-controls
    +```xquery
    +$_form-controls as 
    +```
    +
    +### <a name="var__form-options"/> $_form-options
    +```xquery
    +$_form-options as 
    +```
    +
    +### <a name="var__form-bindings"/> $_form-bindings
    +```xquery
    +$_form-bindings as 
    +```
    +
    +### <a name="var__control-options"/> $_control-options
    +```xquery
    +$_control-options as 
    +```
    +
    +### <a name="var__request"/> $_request
    +```xquery
    +$_request as 
    +```
    +
    +### <a name="var_FORM-INDEX-COUNT"/> $FORM-INDEX-COUNT
    +```xquery
    +$FORM-INDEX-COUNT as 
    +```
    +
    +### <a name="var_FORM-INDEX"/> $FORM-INDEX
    +```xquery
    +$FORM-INDEX as 
    +```
    +
    +### <a name="var_FORM-VALIDATIONS"/> $FORM-VALIDATIONS
    +```xquery
    +$FORM-VALIDATIONS as 
    +```
    +
    +### <a name="var_CONTROL-OPTIONS"/> $CONTROL-OPTIONS
    +```xquery
    +$CONTROL-OPTIONS as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_ get-control-options_1"/>  get-control-options\#1
    +```xquery
    + get-control-options($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_ control-options_2"/>  control-options\#2
    +```xquery
    + control-options($name,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as 
    +
    +
    +### <a name="func_ control-option_2"/>  control-option\#2
    +```xquery
    + control-option($name,$type
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +
    +### <a name="func_ control-option_3"/>  control-option\#3
    +```xquery
    + control-option($name,$type,$default
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* default as 
    +
    +
    +### <a name="func_ control-option_4"/>  control-option\#4
    +```xquery
    + control-option($name,$type,$default,$values
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* default as 
    +
    +* values as 
    +
    +
    +### <a name="func_bind_1"/> bind\#1
    +```xquery
    +bind($response
    +)
    +```
    +
    +#### Params
    +
    +* response as 
    +
    +
    +### <a name="func_flush_0"/> flush\#0
    +```xquery
    +flush(
    +)
    +```
    +
    +### <a name="func_parse-options_1"/> parse-options\#1
    +```xquery
    +parse-options($options
    +)
    +```
    +  Form Options can be in the following form:  "option=value"   or chained together in a single value:  "option1=value;option2=value2;option3=value3"  the parsing will figure out what is what  It is not necessary to quote values as they will be quoted  automically unless you want in or around the content ~
    +
    +
    +#### Params
    +
    +* options as 
    +
    +
    +### <a name="func_render-before_4"/> render-before\#4
    +```xquery
    +render-before($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-after_4"/> render-after\#4
    +```xquery
    +render-after($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-attributes_4"/> render-attributes\#4
    +```xquery
    +render-attributes($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-values_4"/> render-values\#4
    +```xquery
    +render-values($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-custom_4"/> render-custom\#4
    +```xquery
    +render-custom(
    +   $name as xs:string,
    +   $type as xs:string, 
    +   $value as xs:string*,
    +   $options
    +)
    +```
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +* type as  xs:string
    +
    +* value as  xs:string\*
    +
    +* options as 
    +
    +
    +### <a name="func_render-text_4"/> render-text\#4
    +```xquery
    +render-text($name,$type,$value,$options
    +)
    +```
    +  Function binds controls to their respective request data   from the request map; ~
    +
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-money_4"/> render-money\#4
    +```xquery
    +render-money($name,$type,$value,$options
    +)
    +```
    +  Renders a money field ~
    +
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-number_4"/> render-number\#4
    +```xquery
    +render-number($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-password_4"/> render-password\#4
    +```xquery
    +render-password($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-email_4"/> render-email\#4
    +```xquery
    +render-email($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-search_4"/> render-search\#4
    +```xquery
    +render-search($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-url_4"/> render-url\#4
    +```xquery
    +render-url($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-choice_4"/> render-choice\#4
    +```xquery
    +render-choice($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-entity_4"/> render-entity\#4
    +```xquery
    +render-entity($name,$type,$value,$options
    +)
    +```
    +  Render Entity  ~
    +
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-country_4"/> render-country\#4
    +```xquery
    +render-country($name,$type,$value,$options
    +)
    +```
    +  Render Countries ~
    +
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-locale_4"/> render-locale\#4
    +```xquery
    +render-locale($name,$type,$value,$options
    +)
    +```
    +  Renders Locales  ~
    +
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-timezone_4"/> render-timezone\#4
    +```xquery
    +render-timezone($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-date_4"/> render-date\#4
    +```xquery
    +render-date($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-dateTime_4"/> render-dateTime\#4
    +```xquery
    +render-dateTime($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-birthday_4"/> render-birthday\#4
    +```xquery
    +render-birthday($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-collection_4"/> render-collection\#4
    +```xquery
    +render-collection($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-repeated_4"/> render-repeated\#4
    +```xquery
    +render-repeated($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-hidden_4"/> render-hidden\#4
    +```xquery
    +render-hidden($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-button_4"/> render-button\#4
    +```xquery
    +render-button($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-submit_4"/> render-submit\#4
    +```xquery
    +render-submit($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-clear_4"/> render-clear\#4
    +```xquery
    +render-clear($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-file_4"/> render-file\#4
    +```xquery
    +render-file($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-csrf_4"/> render-csrf\#4
    +```xquery
    +render-csrf($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-complex_4"/> render-complex\#4
    +```xquery
    +render-complex($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-grid_5"/> render-grid\#5
    +```xquery
    +render-grid($name,$type,$value,$options,$ui
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +* ui as 
    +
    +
    +### <a name="func_render-reference_4"/> render-reference\#4
    +```xquery
    +render-reference($name,$type,$value,$options
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +
    +### <a name="func_render-query_5"/> render-query\#5
    +```xquery
    +render-query($name,$type,$value,$options,$ui
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* options as 
    +
    +* ui as 
    +
    +
    +### <a name="func_render-control_5"/> render-control\#5
    +```xquery
    +render-control($name,$type,$value,$opts,$ui
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* value as 
    +
    +* opts as 
    +
    +* ui as 
    +
    +
    +### <a name="func_name_1"/> name\#1
    +```xquery
    +name($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_name_0"/> name\#0
    +```xquery
    +name(
    +)
    +```
    +
    +### <a name="func_method_1"/> method\#1
    +```xquery
    +method($method
    +)
    +```
    +
    +#### Params
    +
    +* method as 
    +
    +
    +### <a name="func_method_0"/> method\#0
    +```xquery
    +method(
    +)
    +```
    +
    +### <a name="func_action_1"/> action\#1
    +```xquery
    +action($action
    +)
    +```
    +
    +#### Params
    +
    +* action as 
    +
    +
    +### <a name="func_action_0"/> action\#0
    +```xquery
    +action(
    +)
    +```
    +
    +### <a name="func_target_1"/> target\#1
    +```xquery
    +target($target
    +)
    +```
    +
    +#### Params
    +
    +* target as 
    +
    +
    +### <a name="func_target_0"/> target\#0
    +```xquery
    +target(
    +)
    +```
    +
    +### <a name="func_accept-charset_1"/> accept-charset\#1
    +```xquery
    +accept-charset($charset
    +)
    +```
    +
    +#### Params
    +
    +* charset as 
    +
    +
    +### <a name="func_accept-charset_0"/> accept-charset\#0
    +```xquery
    +accept-charset(
    +)
    +```
    +
    +### <a name="func_accept_1"/> accept\#1
    +```xquery
    +accept($charset
    +)
    +```
    +
    +#### Params
    +
    +* charset as 
    +
    +
    +### <a name="func_accept_0"/> accept\#0
    +```xquery
    +accept(
    +)
    +```
    +
    +### <a name="func_enctype_1"/> enctype\#1
    +```xquery
    +enctype($enctype
    +)
    +```
    +
    +#### Params
    +
    +* enctype as 
    +
    +
    +### <a name="func_enctype_0"/> enctype\#0
    +```xquery
    +enctype(
    +)
    +```
    +
    +### <a name="func_add-custom_3"/> add-custom\#3
    +```xquery
    +add-custom($name,$type,$opts as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* type as 
    +
    +* opts as  xs:string\*
    +
    +
    +### <a name="func_text_2"/> text\#2
    +```xquery
    +text($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_textarea_2"/> textarea\#2
    +```xquery
    +textarea($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_email_2"/> email\#2
    +```xquery
    +email($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_money_2"/> money\#2
    +```xquery
    +money($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_number_2"/> number\#2
    +```xquery
    +number($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_password_2"/> password\#2
    +```xquery
    +password($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_search_2"/> search\#2
    +```xquery
    +search($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_url_2"/> url\#2
    +```xquery
    +url($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_choice_3"/> choice\#3
    +```xquery
    +choice($name,$options as xs:string*,$choices as item()*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +* choices as  item()\*
    +
    +
    +### <a name="func_entity_3"/> entity\#3
    +```xquery
    +entity($name,$options as xs:string*,$choices as item()*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +* choices as  item()\*
    +
    +
    +### <a name="func_country_2"/> country\#2
    +```xquery
    +country($name,$options as  xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as   xs:string\*
    +
    +
    +### <a name="func_locale_2"/> locale\#2
    +```xquery
    +locale($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_timezone_2"/> timezone\#2
    +```xquery
    +timezone($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_language_2"/> language\#2
    +```xquery
    +language($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_date_2"/> date\#2
    +```xquery
    +date($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_dateTime_2"/> dateTime\#2
    +```xquery
    +dateTime($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_time_2"/> time\#2
    +```xquery
    +time($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_birthday_2"/> birthday\#2
    +```xquery
    +birthday($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_checkbox_2"/> checkbox\#2
    +```xquery
    +checkbox($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_radio_2"/> radio\#2
    +```xquery
    +radio($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_file_2"/> file\#2
    +```xquery
    +file($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_collection_2"/> collection\#2
    +```xquery
    +collection($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_repeated_2"/> repeated\#2
    +```xquery
    +repeated($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_hidden_2"/> hidden\#2
    +```xquery
    +hidden($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_button_2"/> button\#2
    +```xquery
    +button($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_submit_2"/> submit\#2
    +```xquery
    +submit($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_validation_2"/> validation\#2
    +```xquery
    +validation($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +### <a name="func_csrf_2"/> csrf\#2
    +```xquery
    +csrf($name,$options as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +* options as  xs:string\*
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_interceptors_interceptor.base.xqy.md b/xqdoc/xqdoc_src__framework_interceptors_interceptor.base.xqy.md
    new file mode 100644
    index 0000000..74aed6e
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_interceptors_interceptor.base.xqy.md
    @@ -0,0 +1,10 @@
    +# library module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_interceptors_interceptor.logging.xqy.md b/xqdoc/xqdoc_src__framework_interceptors_interceptor.logging.xqy.md
    new file mode 100644
    index 0000000..31114f3
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_interceptors_interceptor.logging.xqy.md
    @@ -0,0 +1,52 @@
    +# library module: http://www.xquerrail-framework.com/interceptor
    +
    +
    +## Table of Contents
    +
    +* Functions: [name\#0](#func_name_0), [implements\#0](#func_implements_0), [invoke-before\#1](#func_invoke-before_1), [invoke-after\#1](#func_invoke-after_1)
    +
    +
    +## Functions
    +
    +### <a name="func_name_0"/> name\#0
    +```xquery
    +name(
    +)
    +```
    +
    +### <a name="func_implements_0"/> implements\#0
    +```xquery
    +implements(
    +) as  xs:QName*
    +```
    +
    +#### Returns
    +*  xs:QName\*
    +
    +### <a name="func_invoke-before_1"/> invoke-before\#1
    +```xquery
    +invoke-before($request as map:map
    +)
    +```
    +
    +#### Params
    +
    +* request as  map:map
    +
    +
    +### <a name="func_invoke-after_1"/> invoke-after\#1
    +```xquery
    +invoke-after($response as map:map
    +)
    +```
    +
    +#### Params
    +
    +* response as  map:map
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_interceptors_interceptor.profiler.xqy.md b/xqdoc/xqdoc_src__framework_interceptors_interceptor.profiler.xqy.md
    new file mode 100644
    index 0000000..74aed6e
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_interceptors_interceptor.profiler.xqy.md
    @@ -0,0 +1,10 @@
    +# library module: 
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_lib_json.xqy.md b/xqdoc/xqdoc_src__framework_lib_json.xqy.md
    new file mode 100644
    index 0000000..9e4c9cd
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_lib_json.xqy.md
    @@ -0,0 +1,540 @@
    +# library module: JSON
    +  The parser that was generated for the JSON grammar. 
    +
    +
    +
    +## Table of Contents
    +
    +* Variables: [$MAP0](#var_MAP0), [$MAP1](#var_MAP1), [$MAP2](#var_MAP2), [$INITIAL](#var_INITIAL), [$TRANSITION](#var_TRANSITION), [$EXPECTED](#var_EXPECTED), [$TOKEN](#var_TOKEN), [$lk](#var_lk), [$b0](#var_b0), [$e0](#var_e0), [$l1](#var_l1), [$b1](#var_b1), [$e1](#var_e1), [$error](#var_error), [$result](#var_result)
    +* Functions: [match\#3](#func_match_3), [transition\#7](#func_transition_7), [token\#3](#func_token_3), [expected-token-set\#1](#func_expected-token-set_1), [map2\#3](#func_map2_3), [error-message\#2](#func_error-message_2), [shift\#3](#func_shift_3), [matchW\#3](#func_matchW_3), [lookahead1W\#3](#func_lookahead1W_3), [lookahead1\#3](#func_lookahead1_3), [reduce\#3](#func_reduce_3), [parse-array-1\#2](#func_parse-array-1_2), [parse-array\#2](#func_parse-array_2), [parse-pair\#2](#func_parse-pair_2), [parse-object-1\#2](#func_parse-object-1_2), [parse-object\#2](#func_parse-object_2), [parse-value\#2](#func_parse-value_2), [parse-json\#2](#func_parse-json_2), [parse-json\#1](#func_parse-json_1), [_parse\#1](#func__parse_1), [clean\#1](#func_clean_1), [parse\#1](#func_parse_1)
    +
    +
    +## Variables
    +
    +### <a name="var_MAP0"/> $MAP0
    +```xquery
    +$MAP0 as  xs:integer+
    +```
    +  The codepoint to charclass mapping for 7 bit codepoints. 
    +
    +
    +### <a name="var_MAP1"/> $MAP1
    +```xquery
    +$MAP1 as  xs:integer+
    +```
    +  The codepoint to charclass mapping for codepoints below the surrogate block. 
    +
    +
    +### <a name="var_MAP2"/> $MAP2
    +```xquery
    +$MAP2 as  xs:integer+
    +```
    +  The codepoint to charclass mapping for codepoints above the surrogate block. 
    +
    +
    +### <a name="var_INITIAL"/> $INITIAL
    +```xquery
    +$INITIAL as  xs:integer+
    +```
    +  The token-set-id to DFA-initial-state mapping. 
    +
    +
    +### <a name="var_TRANSITION"/> $TRANSITION
    +```xquery
    +$TRANSITION as  xs:integer+
    +```
    +  The DFA transition table. 
    +
    +
    +### <a name="var_EXPECTED"/> $EXPECTED
    +```xquery
    +$EXPECTED as  xs:integer+
    +```
    +  The DFA-state to expected-token-set mapping. 
    +
    +
    +### <a name="var_TOKEN"/> $TOKEN
    +```xquery
    +$TOKEN as  xs:string+
    +```
    +  The token-string table. 
    +
    +
    +### <a name="var_lk"/> $lk
    +```xquery
    +$lk as 
    +```
    +  The index of the parser state for accessing the combined  (i.e. level > 1) lookahead code. 
    +
    +
    +### <a name="var_b0"/> $b0
    +```xquery
    +$b0 as 
    +```
    +  The index of the parser state for accessing the position in the  input string of the begin of the token that has been shifted. 
    +
    +
    +### <a name="var_e0"/> $e0
    +```xquery
    +$e0 as 
    +```
    +  The index of the parser state for accessing the position in the  input string of the end of the token that has been shifted. 
    +
    +
    +### <a name="var_l1"/> $l1
    +```xquery
    +$l1 as 
    +```
    +  The index of the parser state for accessing the code of the  level-1-lookahead token. 
    +
    +
    +### <a name="var_b1"/> $b1
    +```xquery
    +$b1 as 
    +```
    +  The index of the parser state for accessing the position in the  input string of the begin of the level-1-lookahead token. 
    +
    +
    +### <a name="var_e1"/> $e1
    +```xquery
    +$e1 as 
    +```
    +  The index of the parser state for accessing the position in the  input string of the end of the level-1-lookahead token. 
    +
    +
    +### <a name="var_error"/> $error
    +```xquery
    +$error as 
    +```
    +  The index of the parser state for accessing the token code that  was expected when an error was found. 
    +
    +
    +### <a name="var_result"/> $result
    +```xquery
    +$result as 
    +```
    +  The index of the parser state that points to the first entry  used for collecting action results. 
    +
    +
    +
    +
    +## Functions
    +
    +### <a name="func_match_3"/> match\#3
    +```xquery
    +match($input as xs:string,
    +                         $begin as xs:integer,
    +                         $token-set as xs:integer
    +) as  xs:integer+
    +```
    +  Match next token in input string, starting at given index, using  the DFA entry state for the set of tokens that are expected in  the current context.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* begin as  xs:integer the index where to start in input string.
    +
    +* token-set as  xs:integer the expected token set id.
    +
    +
    +#### Returns
    +*  xs:integer+: a sequence of three: the token code of the result token, with input string begin and end positions. If there is no valid token, return the negative id of the DFA state that failed, along with begin and end positions of the longest viable prefix.
    +
    +### <a name="func_transition_7"/> transition\#7
    +```xquery
    +transition($input as xs:string,
    +                              $begin as xs:integer,
    +                              $current as xs:integer,
    +                              $end as xs:integer,
    +                              $result as xs:integer,
    +                              $current-state as xs:integer,
    +                              $previous-state as xs:integer
    +) as  xs:integer+
    +```
    +  The DFA state transition function. If we are in a valid DFA state, save  it's result annotation, consume one input codepoint, calculate the next  state, and use tail recursion to do the same again. Otherwise, return  any valid result or a negative DFA state id in case of an error.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* begin as  xs:integer the begin index of the current token in the input string.
    +
    +* current as  xs:integer the index of the current position in the input string.-state the current DFA state.
    +
    +* end as  xs:integer the end index of the result in the input string.
    +
    +* result as  xs:integer the result code.
    +
    +* current-state as  xs:integer the current DFA state.
    +
    +* previous-state as  xs:integer the previous DFA state.
    +
    +
    +#### Returns
    +*  xs:integer+: a sequence of three: the token code of the result token, with input string begin and end positions. If there is no valid token, return the negative id of the DFA state that failed, along with begin and end positions of the longest viable prefix.
    +
    +### <a name="func_token_3"/> token\#3
    +```xquery
    +token($result as xs:string*,
    +                         $chunk as xs:integer,
    +                         $base-token-code as xs:integer
    +) as  xs:string*
    +```
    +  Recursively translate one 32-bit chunk of an expected token bitset  to the corresponding sequence of token strings.   
    +
    +
    +#### Params
    +
    +* result as  xs:string\* the result of previous recursion levels.
    +
    +* chunk as  xs:integer the 32-bit chunk of the expected token bitset.
    +
    +* base-token-code as  xs:integer the token code of bit 0 in the current chunk.
    +
    +
    +#### Returns
    +*  xs:string\*: the set of token strings.
    +
    +### <a name="func_expected-token-set_1"/> expected-token-set\#1
    +```xquery
    +expected-token-set($state as xs:integer
    +) as  xs:string*
    +```
    +  Calculate expected token set for a given DFA state as a sequence  of strings.   
    +
    +
    +#### Params
    +
    +* state as  xs:integer the DFA state.
    +
    +
    +#### Returns
    +*  xs:string\*: the set of token strings
    +
    +### <a name="func_map2_3"/> map2\#3
    +```xquery
    +map2($c as xs:integer, $lo as xs:integer, $hi as xs:integer
    +) as  xs:integer
    +```
    +  Classify codepoint by doing a tail recursive binary search for a  matching codepoint range entry in MAP2, the codepoint to charclass  map for codepoints above the surrogate block.   
    +
    +
    +#### Params
    +
    +* c as  xs:integer the codepoint.
    +
    +* lo as  xs:integer the binary search lower bound map index.
    +
    +* hi as  xs:integer the binary search upper bound map index.
    +
    +
    +#### Returns
    +*  xs:integer: the character class.
    +
    +### <a name="func_error-message_2"/> error-message\#2
    +```xquery
    +error-message($input as xs:string, $error as element(error)
    +) as  xs:string
    +```
    +  Create a textual error message from a parsing error.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* error as  element(error) the parsing error descriptor.
    +
    +
    +#### Returns
    +*  xs:string: the error message.
    +
    +### <a name="func_shift_3"/> shift\#3
    +```xquery
    +shift($code as xs:integer, $input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Shift one token, i.e. compare lookahead token 1 with expected  token and in case of a match, shift lookahead tokens down such that  l1 becomes the current token, and higher lookahead tokens move down.  When lookahead token 1 does not match the expected token, raise an  error by saving the expected token code in the error field of the  parser state.   
    +
    +
    +#### Params
    +
    +* code as  xs:integer the expected token.
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_matchW_3"/> matchW\#3
    +```xquery
    +matchW($input as xs:string,
    +                          $begin as xs:integer,
    +                          $token-set as xs:integer
    +) as  xs:integer+
    +```
    +  Use p:match to fetch the next token, but skip any leading  whitespace.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* begin as  xs:integer the index where to start.
    +
    +* token-set as  xs:integer the valid token set id.
    +
    +
    +#### Returns
    +*  xs:integer+: a sequence of three values: the token code of the result token, with input string positions of token begin and end.
    +
    +### <a name="func_lookahead1W_3"/> lookahead1W\#3
    +```xquery
    +lookahead1W($set as xs:integer, $input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Lookahead one token on level 1 with whitespace skipping.   
    +
    +
    +#### Params
    +
    +* set as  xs:integer the code of the DFA entry state for the set of valid tokens.
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_lookahead1_3"/> lookahead1\#3
    +```xquery
    +lookahead1($set as xs:integer, $input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Lookahead one token on level 1.   
    +
    +
    +#### Params
    +
    +* set as  xs:integer the code of the DFA entry state for the set of valid tokens.
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_reduce_3"/> reduce\#3
    +```xquery
    +reduce($state as item()+, $name as xs:string, $count as xs:integer
    +) as  item()+
    +```
    +  Reduce the result stack. Pop $count element, wrap them in a  new element named $name, and push the new element.   
    +
    +
    +#### Params
    +
    +* state as  item()+ the parser state.
    +
    +* name as  xs:string the name of the result node.
    +
    +* count as  xs:integer the number of child nodes.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-array-1_2"/> parse-array-1\#2
    +```xquery
    +parse-array-1($input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Parse the 1st loop of production array (zero or more). Use  tail recursion for iteratively updating the parser state.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-array_2"/> parse-array\#2
    +```xquery
    +parse-array($input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Parse array.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-pair_2"/> parse-pair\#2
    +```xquery
    +parse-pair($input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Parse pair.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-object-1_2"/> parse-object-1\#2
    +```xquery
    +parse-object-1($input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Parse the 1st loop of production object (zero or more). Use  tail recursion for iteratively updating the parser state.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-object_2"/> parse-object\#2
    +```xquery
    +parse-object($input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Parse object.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-value_2"/> parse-value\#2
    +```xquery
    +parse-value($input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Parse value.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-json_2"/> parse-json\#2
    +```xquery
    +parse-json($input as xs:string, $state as item()+
    +) as  item()+
    +```
    +  Parse json.   
    +
    +
    +#### Params
    +
    +* input as  xs:string the input string.
    +
    +* state as  item()+ the parser state.
    +
    +
    +#### Returns
    +*  item()+: the updated parser state.
    +
    +### <a name="func_parse-json_1"/> parse-json\#1
    +```xquery
    +parse-json($s as xs:string
    +) as  item()*
    +```
    +  Parse start symbol json from given string.   
    +
    +
    +#### Params
    +
    +* s as  xs:string the string to be parsed.
    +
    +
    +#### Returns
    +*  item()\*: the result as generated by parser actions.
    +
    +### <a name="func__parse_1"/> _parse\#1
    +```xquery
    +_parse($node as node()
    +)
    +```
    +  Recursively converts Parse Tree into XML representation of json object  ~
    +
    +
    +#### Params
    +
    +* node as  node()
    +
    +
    +### <a name="func_clean_1"/> clean\#1
    +```xquery
    +clean($string
    +)
    +```
    +
    +#### Params
    +
    +* string as 
    +
    +
    +### <a name="func_parse_1"/> parse\#1
    +```xquery
    +parse($input as xs:string
    +)
    +```
    +  Converts JSON to XML ~
    +
    +
    +#### Params
    +
    +* input as  xs:string
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_lib_mljson.xqy.md b/xqdoc/xqdoc_src__framework_lib_mljson.xqy.md
    new file mode 100644
    index 0000000..091359b
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_lib_mljson.xqy.md
    @@ -0,0 +1,335 @@
    +# library module: http://marklogic.com/json
    +
    +
    +## Table of Contents
    +
    +* Variables: [$newLineRegex](#var_newLineRegex), [$analyzeString](#var_analyzeString), [$isSupported](#var_isSupported)
    +* Functions: [parse\#2](#func_parse_2), [parse\#1](#func_parse_1), [serialize\#1](#func_serialize_1), [serialize\#2](#func_serialize_2), [document\#1](#func_document_1), [object\#1](#func_object_1), [o\#1](#func_o_1), [object\#0](#func_object_0), [o\#0](#func_o_0), [array\#1](#func_array_1), [a\#1](#func_a_1), [array\#0](#func_array_0), [a\#0](#func_a_0), [date\#1](#func_date_1), [xml\#1](#func_xml_1), [null\#0](#func_null_0), [escapeNCName\#1](#func_escapeNCName_1), [unescapeNCName\#1](#func_unescapeNCName_1), [castAs\#2](#func_castAs_2), [isSupported\#0](#func_isSupported_0), [rangeIndexValues\#5](#func_rangeIndexValues_5)
    +
    +
    +## Variables
    +
    +### <a name="var_newLineRegex"/> $newLineRegex
    +```xquery
    +$newLineRegex as 
    +```
    +
    +### <a name="var_analyzeString"/> $analyzeString
    +```xquery
    +$analyzeString as 
    +```
    +
    +### <a name="var_isSupported"/> $isSupported
    +```xquery
    +$isSupported as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_parse_2"/> parse\#2
    +```xquery
    +parse(
    +    $json as xs:string,
    +    $enableExtensions as xs:boolean
    +) as  element(json:json)
    +```
    +
    +#### Params
    +
    +* json as  xs:string
    +
    +* enableExtensions as  xs:boolean
    +
    +
    +#### Returns
    +*  element(json:json)
    +
    +### <a name="func_parse_1"/> parse\#1
    +```xquery
    +parse(
    +    $json as xs:string
    +) as  element(json:json)
    +```
    +
    +#### Params
    +
    +* json as  xs:string
    +
    +
    +#### Returns
    +*  element(json:json)
    +
    +### <a name="func_serialize_1"/> serialize\#1
    +```xquery
    +serialize(
    +    $element as node()
    +) as  xs:string
    +```
    +
    +#### Params
    +
    +* element as  node()
    +
    +
    +#### Returns
    +*  xs:string
    +
    +### <a name="func_serialize_2"/> serialize\#2
    +```xquery
    +serialize(
    +    $element as node(),
    +    $jsonPCallback as xs:string?
    +) as  xs:string
    +```
    +
    +#### Params
    +
    +* element as  node()
    +
    +* jsonPCallback as  xs:string?
    +
    +
    +#### Returns
    +*  xs:string
    +
    +### <a name="func_document_1"/> document\#1
    +```xquery
    +document(
    +    $value as item()
    +) as  element(json:json)
    +```
    +
    +#### Params
    +
    +* value as  item()
    +
    +
    +#### Returns
    +*  element(json:json)
    +
    +### <a name="func_object_1"/> object\#1
    +```xquery
    +object(
    +    $keyValues as item()*
    +) as  element(json:item)
    +```
    +
    +#### Params
    +
    +* keyValues as  item()\*
    +
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_o_1"/> o\#1
    +```xquery
    +o(
    +    $keyValues as item()*
    +) as  element(json:item)
    +```
    +
    +#### Params
    +
    +* keyValues as  item()\*
    +
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_object_0"/> object\#0
    +```xquery
    +object(
    +) as  element(json:item)
    +```
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_o_0"/> o\#0
    +```xquery
    +o(
    +) as  element(json:item)
    +```
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_array_1"/> array\#1
    +```xquery
    +array(
    +    $items as item()*
    +) as  element(json:item)
    +```
    +
    +#### Params
    +
    +* items as  item()\*
    +
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_a_1"/> a\#1
    +```xquery
    +a(
    +    $items as item()*
    +) as  element(json:item)
    +```
    +
    +#### Params
    +
    +* items as  item()\*
    +
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_array_0"/> array\#0
    +```xquery
    +array(
    +) as  element(json:item)
    +```
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_a_0"/> a\#0
    +```xquery
    +a(
    +) as  element(json:item)
    +```
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_date_1"/> date\#1
    +```xquery
    +date(
    +    $value as xs:anySimpleType
    +) as  element(json:item)
    +```
    +
    +#### Params
    +
    +* value as  xs:anySimpleType
    +
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_xml_1"/> xml\#1
    +```xquery
    +xml(
    +    $value as element()
    +) as  element(json:item)
    +```
    +
    +#### Params
    +
    +* value as  element()
    +
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_null_0"/> null\#0
    +```xquery
    +null(
    +) as  element(json:item)
    +```
    +
    +#### Returns
    +*  element(json:item)
    +
    +### <a name="func_escapeNCName_1"/> escapeNCName\#1
    +```xquery
    +escapeNCName(
    +    $val as xs:string
    +) as  xs:string
    +```
    +
    +#### Params
    +
    +* val as  xs:string
    +
    +
    +#### Returns
    +*  xs:string
    +
    +### <a name="func_unescapeNCName_1"/> unescapeNCName\#1
    +```xquery
    +unescapeNCName(
    +    $val as xs:string
    +) as  xs:string
    +```
    +
    +#### Params
    +
    +* val as  xs:string
    +
    +
    +#### Returns
    +*  xs:string
    +
    +### <a name="func_castAs_2"/> castAs\#2
    +```xquery
    +castAs(
    +    $key as xs:string,
    +    $enableExtensions as xs:boolean
    +) as  xs:string?
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +* enableExtensions as  xs:boolean
    +
    +
    +#### Returns
    +*  xs:string?
    +
    +### <a name="func_isSupported_0"/> isSupported\#0
    +```xquery
    +isSupported(
    +) as  xs:boolean
    +```
    +
    +#### Returns
    +*  xs:boolean
    +
    +### <a name="func_rangeIndexValues_5"/> rangeIndexValues\#5
    +```xquery
    +rangeIndexValues(
    +    $key as xs:string,
    +    $type as xs:string,
    +    $query as cts:query?,
    +    $options as xs:string*,
    +    $limit as xs:integer?
    +) as  xs:anyAtomicType*
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +* type as  xs:string
    +
    +* query as  cts:query?
    +
    +* options as  xs:string\*
    +
    +* limit as  xs:integer?
    +
    +
    +#### Returns
    +*  xs:anyAtomicType\*
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_request.xqy.md b/xqdoc/xqdoc_src__framework_request.xqy.md
    new file mode 100644
    index 0000000..cf2e31f
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_request.xqy.md
    @@ -0,0 +1,549 @@
    +# library module: http://www.xquerrail-framework.com/request
    +  This request controls all serialization of request map   - All HTTP request elements in a single map:map type. ~
    +
    +
    +
    +## Table of Contents
    +
    +* Variables: [$BODY](#var_BODY), [$BODY-XML](#var_BODY-XML), [$BODY-TEXT](#var_BODY-TEXT), [$BODY-BINARY](#var_BODY-BINARY), [$METHOD](#var_METHOD), [$CONTENT-TYPE](#var_CONTENT-TYPE), [$BODY-TYPE](#var_BODY-TYPE), [$PROTOCOL](#var_PROTOCOL), [$USERNAME](#var_USERNAME), [$USERID](#var_USERID), [$PATH](#var_PATH), [$URL](#var_URL), [$CONTEXT](#var_CONTEXT), [$APPLICATION](#var_APPLICATION), [$CONTROLLER](#var_CONTROLLER), [$ACTION](#var_ACTION), [$FORMAT](#var_FORMAT), [$ROUTE](#var_ROUTE), [$VIEW](#var_VIEW), [$PARTIAL](#var_PARTIAL), [$HEADER-PREFIX](#var_HEADER-PREFIX), [$PARAM-PREFIX](#var_PARAM-PREFIX), [$PARAM-CONTENT-TYPE-PREFIX](#var_PARAM-CONTENT-TYPE-PREFIX), [$PARAM-FILENAME-PREFIX](#var_PARAM-FILENAME-PREFIX)
    +* Functions: [hex-decode\#1](#func_hex-decode_1), [hex-decode\#2](#func_hex-decode_2), [request\#0](#func_request_0), [initialize\#1](#func_initialize_1), [parse\#1](#func_parse_1), [application\#0](#func_application_0), [controller\#0](#func_controller_0), [action\#0](#func_action_0), [format\#0](#func_format_0), [route\#0](#func_route_0), [view\#0](#func_view_0), [method\#0](#func_method_0), [path\#0](#func_path_0), [protocol\#0](#func_protocol_0), [body\#0](#func_body_0), [body-type\#0](#func_body-type_0), [partial\#0](#func_partial_0), [params\#0](#func_params_0), [param-names\#0](#func_param-names_0), [param\#1](#func_param_1), [param\#2](#func_param_2), [param-as\#3](#func_param-as_3), [params-as-map\#0](#func_params-as-map_0), [param-filename\#1](#func_param-filename_1), [param-content-type\#2](#func_param-content-type_2), [get-headers\#0](#func_get-headers_0), [get-header\#1](#func_get-header_1), [get-header\#2](#func_get-header_2), [locale\#0](#func_locale_0), [content-length\#0](#func_content-length_0), [user-agent\#0](#func_user-agent_0), [referer\#0](#func_referer_0), [encoding\#0](#func_encoding_0), [connection\#0](#func_connection_0), [authorization\#0](#func_authorization_0), [cookies\#0](#func_cookies_0), [cookie\#1](#func_cookie_1), [build-query\#1](#func_build-query_1), [parse-query\#0](#func_parse-query_0)
    +
    +
    +## Variables
    +
    +### <a name="var_BODY"/> $BODY
    +```xquery
    +$BODY as 
    +```
    +
    +### <a name="var_BODY-XML"/> $BODY-XML
    +```xquery
    +$BODY-XML as 
    +```
    +
    +### <a name="var_BODY-TEXT"/> $BODY-TEXT
    +```xquery
    +$BODY-TEXT as 
    +```
    +
    +### <a name="var_BODY-BINARY"/> $BODY-BINARY
    +```xquery
    +$BODY-BINARY as 
    +```
    +
    +### <a name="var_METHOD"/> $METHOD
    +```xquery
    +$METHOD as 
    +```
    +
    +### <a name="var_CONTENT-TYPE"/> $CONTENT-TYPE
    +```xquery
    +$CONTENT-TYPE as 
    +```
    +
    +### <a name="var_BODY-TYPE"/> $BODY-TYPE
    +```xquery
    +$BODY-TYPE as 
    +```
    +
    +### <a name="var_PROTOCOL"/> $PROTOCOL
    +```xquery
    +$PROTOCOL as 
    +```
    +
    +### <a name="var_USERNAME"/> $USERNAME
    +```xquery
    +$USERNAME as 
    +```
    +
    +### <a name="var_USERID"/> $USERID
    +```xquery
    +$USERID as 
    +```
    +
    +### <a name="var_PATH"/> $PATH
    +```xquery
    +$PATH as 
    +```
    +
    +### <a name="var_URL"/> $URL
    +```xquery
    +$URL as 
    +```
    +
    +### <a name="var_CONTEXT"/> $CONTEXT
    +```xquery
    +$CONTEXT as 
    +```
    +
    +### <a name="var_APPLICATION"/> $APPLICATION
    +```xquery
    +$APPLICATION as 
    +```
    +
    +### <a name="var_CONTROLLER"/> $CONTROLLER
    +```xquery
    +$CONTROLLER as 
    +```
    +
    +### <a name="var_ACTION"/> $ACTION
    +```xquery
    +$ACTION as 
    +```
    +
    +### <a name="var_FORMAT"/> $FORMAT
    +```xquery
    +$FORMAT as 
    +```
    +
    +### <a name="var_ROUTE"/> $ROUTE
    +```xquery
    +$ROUTE as 
    +```
    +
    +### <a name="var_VIEW"/> $VIEW
    +```xquery
    +$VIEW as 
    +```
    +
    +### <a name="var_PARTIAL"/> $PARTIAL
    +```xquery
    +$PARTIAL as 
    +```
    +
    +### <a name="var_HEADER-PREFIX"/> $HEADER-PREFIX
    +```xquery
    +$HEADER-PREFIX as 
    +```
    +
    +### <a name="var_PARAM-PREFIX"/> $PARAM-PREFIX
    +```xquery
    +$PARAM-PREFIX as 
    +```
    +
    +### <a name="var_PARAM-CONTENT-TYPE-PREFIX"/> $PARAM-CONTENT-TYPE-PREFIX
    +```xquery
    +$PARAM-CONTENT-TYPE-PREFIX as 
    +```
    +
    +### <a name="var_PARAM-FILENAME-PREFIX"/> $PARAM-FILENAME-PREFIX
    +```xquery
    +$PARAM-FILENAME-PREFIX as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_hex-decode_1"/> hex-decode\#1
    +```xquery
    +hex-decode($hexBin as xs:hexBinary
    +) as  xs:string
    +```
    +  Decodes a binary request into s string ~
    +
    +
    +#### Params
    +
    +* hexBin as  xs:hexBinary
    +
    +
    +#### Returns
    +*  xs:string
    +
    +### <a name="func_hex-decode_2"/> hex-decode\#2
    +```xquery
    +hex-decode($hexBin as xs:hexBinary, $length as xs:integer
    +) as  xs:string
    +```
    +
    +#### Params
    +
    +* hexBin as  xs:hexBinary
    +
    +* length as  xs:integer
    +
    +
    +#### Returns
    +*  xs:string
    +
    +### <a name="func_request_0"/> request\#0
    +```xquery
    +request(
    +)
    +```
    +  Returns the map:map of the request ~
    +
    +
    +### <a name="func_initialize_1"/> initialize\#1
    +```xquery
    +initialize($_request
    +)
    +```
    +   Wraps the http response into a map:map   Accessing the map can be used the following keys   map:get($response, "field:xxx")   Accessors:       request:header::xxxx       request:field::xxxx       request:body ~
    +
    +
    +#### Params
    +
    +* _request as 
    +
    +
    +### <a name="func_parse_1"/> parse\#1
    +```xquery
    +parse($parameters
    +) as  map:map
    +```
    +   Parses the map pulling all the required information from http request  ~
    +
    +
    +#### Params
    +
    +* parameters as 
    +
    +
    +#### Returns
    +*  map:map
    +
    +### <a name="func_application_0"/> application\#0
    +```xquery
    +application(
    +)
    +```
    +  Get the application from the request ~
    +
    +
    +### <a name="func_controller_0"/> controller\#0
    +```xquery
    +controller(
    +)
    +```
    +   Gets the controller from the request ~
    +
    +
    +### <a name="func_action_0"/> action\#0
    +```xquery
    +action(
    +)
    +```
    +   Gets that action Parameters of the request ~
    +
    +
    +### <a name="func_format_0"/> format\#0
    +```xquery
    +format(
    +)
    +```
    +  Selects the file format of the requestt ~
    +
    +
    +### <a name="func_route_0"/> route\#0
    +```xquery
    +route(
    +)
    +```
    +  Gets the route selected for the request ~
    +
    +
    +### <a name="func_view_0"/> view\#0
    +```xquery
    +view(
    +)
    +```
    +  Gets the view selected for the request ~
    +
    +
    +### <a name="func_method_0"/> method\#0
    +```xquery
    +method(
    +)
    +```
    +  Returns the method for a given request  the method returns the http verb such as POST,GET,DELETE  etc. ~
    +
    +
    +### <a name="func_path_0"/> path\#0
    +```xquery
    +path(
    +)
    +```
    +   Get the original Path of the request ~
    +
    +
    +### <a name="func_protocol_0"/> protocol\#0
    +```xquery
    +protocol(
    +)
    +```
    +   Get the protocal of the request ~
    +
    +
    +### <a name="func_body_0"/> body\#0
    +```xquery
    +body(
    +)
    +```
    +  Returns the body element of an http:request. Use the request:body-type()   function to determine the underlying datatype ~
    +
    +
    +### <a name="func_body-type_0"/> body-type\#0
    +```xquery
    +body-type(
    +)
    +```
    +   Returns the body type of the given request such as (xml, binary, text)  ~
    +
    +
    +### <a name="func_partial_0"/> partial\#0
    +```xquery
    +partial(
    +)
    +```
    +  Returns if a request is a partial request common in ajax calls ~
    +
    +
    +### <a name="func_params_0"/> params\#0
    +```xquery
    +params(
    +) as  map:map
    +```
    +   Returns the list of parameters of just parameters in a map ~
    +
    +
    +#### Returns
    +*  map:map
    +
    +### <a name="func_param-names_0"/> param-names\#0
    +```xquery
    +param-names(
    +)
    +```
    +  Returns a list parameter names from request as sequence of string values ~
    +
    +
    +### <a name="func_param_1"/> param\#1
    +```xquery
    +param($name as xs:string
    +)
    +```
    +   Gets a parameter value by name ~
    +
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +
    +### <a name="func_param_2"/> param\#2
    +```xquery
    +param($name as xs:string,$default as item()*
    +)
    +```
    +  Retrieves a field if it is available and returns.  If field does not exist returns default. ~
    +
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +* default as  item()\*
    +
    +
    +### <a name="func_param-as_3"/> param-as\#3
    +```xquery
    +param-as(
    +    $name as xs:string,
    +    $type as xs:string,
    +    $default as item()
    +) as  item()*
    +```
    +  Returns a parameter casted as the type you specify.  Use the generic type of the asset to resolve as the underlying type ~
    +
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +* type as  xs:string
    +
    +* default as  item()
    +
    +
    +#### Returns
    +*  item()\*
    +
    +### <a name="func_params-as-map_0"/> params-as-map\#0
    +```xquery
    +params-as-map(
    +)
    +```
    +   Returns the parameters of the request as a map ~
    +
    +
    +### <a name="func_param-filename_1"/> param-filename\#1
    +```xquery
    +param-filename($name as xs:string
    +)
    +```
    +   Returns the filename for the param ~
    +
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +
    +### <a name="func_param-content-type_2"/> param-content-type\#2
    +```xquery
    +param-content-type(
    +$request as map:map,
    +$field as xs:string
    +)
    +```
    +   Returns the associated content-type for the given param   In cases where the request has multipart/mime data on the form   you can extract the type based request from client ~
    +
    +
    +#### Params
    +
    +* request as  map:map
    +
    +* field as  xs:string
    +
    +
    +### <a name="func_get-headers_0"/> get-headers\#0
    +```xquery
    +get-headers(
    +)
    +```
    +  Gets a all response header object ~
    +
    +
    +### <a name="func_get-header_1"/> get-header\#1
    +```xquery
    +get-header($name as xs:string
    +)
    +```
    +  Gets a specific header parameter by name    
    +
    +
    +#### Params
    +
    +* name as  xs:string - Name of the header parameter (ie. Content-Length) ~
    +
    +
    +### <a name="func_get-header_2"/> get-header\#2
    +```xquery
    +get-header($name as xs:string,$default as xs:anyAtomicType
    +)
    +```
    +   Gets a specific header parameter by name and its default value if not present   
    +
    +
    +#### Params
    +
    +* name as  xs:string - Name of the header parameter (ie. Content-Length)
    +
    +* default as  xs:anyAtomicType
    +
    +
    +### <a name="func_locale_0"/> locale\#0
    +```xquery
    +locale(
    +)
    +```
    +  Returns the given Accept-Language from the HTTP request ~
    +
    +
    +### <a name="func_content-length_0"/> content-length\#0
    +```xquery
    +content-length(
    +)
    +```
    +  Returns the Content-Length header param ~
    +
    +
    +### <a name="func_user-agent_0"/> user-agent\#0
    +```xquery
    +user-agent(
    +)
    +```
    +  Returns the User-Agent header from a given request ~
    +
    +
    +### <a name="func_referer_0"/> referer\#0
    +```xquery
    +referer(
    +)
    +```
    +  Returns the Referer header from a given request ~
    +
    +
    +### <a name="func_encoding_0"/> encoding\#0
    +```xquery
    +encoding(
    +)
    +```
    +  Returns the Accept-Encoding header from a given request ~
    +
    +
    +### <a name="func_connection_0"/> connection\#0
    +```xquery
    +connection(
    +)
    +```
    +  Returns the Connection header from a given request ~
    +
    +
    +### <a name="func_authorization_0"/> authorization\#0
    +```xquery
    +authorization(
    +)
    +```
    +  Returns the Authorization Header from the request ~
    +
    +
    +### <a name="func_cookies_0"/> cookies\#0
    +```xquery
    +cookies(
    +)
    +```
    +  Returns the Cookies from the request ~
    +
    +
    +### <a name="func_cookie_1"/> cookie\#1
    +```xquery
    +cookie($name
    +)
    +```
    +  Returns the Cookies by name from the request  
    +
    +
    +#### Params
    +
    +* name as  - name of cookie ~
    +
    +
    +### <a name="func_build-query_1"/> build-query\#1
    +```xquery
    +build-query($params
    +)
    +```
    +   Using JQGrid you can parse a query from field using simple language, parses from JSON into CTS Query ~
    +
    +
    +#### Params
    +
    +* params as 
    +
    +
    +### <a name="func_parse-query_0"/> parse-query\#0
    +```xquery
    +parse-query(
    +)
    +```
    +  Returns the parse Query from JQGrid  ~
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_response.xqy.md b/xqdoc/xqdoc_src__framework_response.xqy.md
    new file mode 100644
    index 0000000..a674f89
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_response.xqy.md
    @@ -0,0 +1,967 @@
    +# library module: http://www.xquerrail-framework.com/response
    +  Response Helper function wrapper. ~
    +
    +
    +
    +## Table of Contents
    +
    +* Variables: [$CONTENT-TYPE](#var_CONTENT-TYPE), [$CONTEXT](#var_CONTEXT), [$DOCTYPE](#var_DOCTYPE), [$CODE](#var_CODE), [$ENCODING](#var_ENCODING), [$VIEW](#var_VIEW), [$REDIRECT](#var_REDIRECT), [$TEMPLATE](#var_TEMPLATE), [$BODY](#var_BODY), [$APPLICATION](#var_APPLICATION), [$FORMAT](#var_FORMAT), [$CONTROLLER](#var_CONTROLLER), [$ACTION](#var_ACTION), [$ERROR](#var_ERROR), [$PARTIAL](#var_PARTIAL), [$FLASH](#var_FLASH), [$BASE](#var_BASE), [$MODEL](#var_MODEL), [$HEADER](#var_HEADER), [$PARAMETER](#var_PARAMETER), [$SLOT-PREFIX](#var_SLOT-PREFIX), [$META](#var_META), [$HTTPMETA](#var_HTTPMETA), [$STYLESHEET](#var_STYLESHEET), [$JAVASCRIPT](#var_JAVASCRIPT), [$COOKIE](#var_COOKIE), [$response](#var_response)
    +* Functions: [initialize\#1](#func_initialize_1), [initialize\#2](#func_initialize_2), [set-response\#1](#func_set-response_1), [set-base\#1](#func_set-base_1), [base\#0](#func_base_0), [set-response\#2](#func_set-response_2), [set-flash\#2](#func_set-flash_2), [flash\#0](#func_flash_0), [flush\#0](#func_flush_0), [response\#0](#func_response_0), [error\#0](#func_error_0), [set-error\#2](#func_set-error_2), [has-error\#0](#func_has-error_0), [set-format\#1](#func_set-format_1), [format\#0](#func_format_0), [set-body\#1](#func_set-body_1), [body\#0](#func_body_0), [set-response-code\#2](#func_set-response-code_2), [response-code\#0](#func_response-code_0), [set-content-type\#1](#func_set-content-type_1), [content-type\#0](#func_content-type_0), [set-application\#1](#func_set-application_1), [application\#0](#func_application_0), [set-controller\#1](#func_set-controller_1), [controller\#0](#func_controller_0), [set-action\#1](#func_set-action_1), [action\#0](#func_action_0), [partial\#0](#func_partial_0), [set-partial\#1](#func_set-partial_1), [set-view\#1](#func_set-view_1), [view\#0](#func_view_0), [set-template\#1](#func_set-template_1), [template\#0](#func_template_0), [redirect\#2](#func_redirect_2), [redirect\#1](#func_redirect_1), [redirect\#0](#func_redirect_0), [add-response-header\#2](#func_add-response-header_2), [response-header\#1](#func_response-header_1), [response-headers\#0](#func_response-headers_0), [add-para\#2](#func_add-para_2), [set-param\#2](#func_set-param_2), [delete-param\#1](#func_delete-param_1), [delete-param\#2](#func_delete-param_2), [param\#1](#func_param_1), [get-data\#1](#func_get-data_1), [set-data\#2](#func_set-data_2), [data\#1](#func_data_1), [add-data\#2](#func_add-data_2), [slots\#0](#func_slots_0), [set-slot\#2](#func_set-slot_2), [has-slot\#1](#func_has-slot_1), [slot\#1](#func_slot_1), [set-title\#1](#func_set-title_1), [title\#0](#func_title_0), [add-meta\#2](#func_add-meta_2), [add-meta\#3](#func_add-meta_3), [meta\#1](#func_meta_1), [meta-keys\#0](#func_meta-keys_0), [metas\#0](#func_metas_0), [add-httpmeta\#2](#func_add-httpmeta_2), [add-httpmeta\#3](#func_add-httpmeta_3), [httpmeta\#1](#func_httpmeta_1), [httpmeta-keys\#0](#func_httpmeta-keys_0), [httpmetas\#0](#func_httpmetas_0), [add-cookie\#1](#func_add-cookie_1), [cookies\#0](#func_cookies_0), [cookie\#1](#func_cookie_1), [remove-cookie\#1](#func_remove-cookie_1), [javascripts\#0](#func_javascripts_0), [add-javascript\#3](#func_add-javascript_3), [add-javascript\#1](#func_add-javascript_1), [remove-javascript\#1](#func_remove-javascript_1), [clear-javascripts\#0](#func_clear-javascripts_0), [stylesheets\#0](#func_stylesheets_0), [add-stylesheet\#1](#func_add-stylesheet_1), [add-stylesheet\#2](#func_add-stylesheet_2), [remove-stylesheet\#1](#func_remove-stylesheet_1), [clear-stylesheets\#0](#func_clear-stylesheets_0), [set-model\#1](#func_set-model_1), [model\#0](#func_model_0)
    +
    +
    +## Variables
    +
    +### <a name="var_CONTENT-TYPE"/> $CONTENT-TYPE
    +```xquery
    +$CONTENT-TYPE as 
    +```
    +
    +### <a name="var_CONTEXT"/> $CONTEXT
    +```xquery
    +$CONTEXT as 
    +```
    +
    +### <a name="var_DOCTYPE"/> $DOCTYPE
    +```xquery
    +$DOCTYPE as 
    +```
    +
    +### <a name="var_CODE"/> $CODE
    +```xquery
    +$CODE as 
    +```
    +
    +### <a name="var_ENCODING"/> $ENCODING
    +```xquery
    +$ENCODING as 
    +```
    +
    +### <a name="var_VIEW"/> $VIEW
    +```xquery
    +$VIEW as 
    +```
    +
    +### <a name="var_REDIRECT"/> $REDIRECT
    +```xquery
    +$REDIRECT as 
    +```
    +
    +### <a name="var_TEMPLATE"/> $TEMPLATE
    +```xquery
    +$TEMPLATE as 
    +```
    +
    +### <a name="var_BODY"/> $BODY
    +```xquery
    +$BODY as 
    +```
    +
    +### <a name="var_APPLICATION"/> $APPLICATION
    +```xquery
    +$APPLICATION as 
    +```
    +
    +### <a name="var_FORMAT"/> $FORMAT
    +```xquery
    +$FORMAT as 
    +```
    +
    +### <a name="var_CONTROLLER"/> $CONTROLLER
    +```xquery
    +$CONTROLLER as 
    +```
    +
    +### <a name="var_ACTION"/> $ACTION
    +```xquery
    +$ACTION as 
    +```
    +
    +### <a name="var_ERROR"/> $ERROR
    +```xquery
    +$ERROR as 
    +```
    +
    +### <a name="var_PARTIAL"/> $PARTIAL
    +```xquery
    +$PARTIAL as 
    +```
    +
    +### <a name="var_FLASH"/> $FLASH
    +```xquery
    +$FLASH as 
    +```
    +
    +### <a name="var_BASE"/> $BASE
    +```xquery
    +$BASE as 
    +```
    +
    +### <a name="var_MODEL"/> $MODEL
    +```xquery
    +$MODEL as 
    +```
    +
    +### <a name="var_HEADER"/> $HEADER
    +```xquery
    +$HEADER as 
    +```
    +
    +### <a name="var_PARAMETER"/> $PARAMETER
    +```xquery
    +$PARAMETER as 
    +```
    +
    +### <a name="var_SLOT-PREFIX"/> $SLOT-PREFIX
    +```xquery
    +$SLOT-PREFIX as 
    +```
    +
    +### <a name="var_META"/> $META
    +```xquery
    +$META as 
    +```
    +
    +### <a name="var_HTTPMETA"/> $HTTPMETA
    +```xquery
    +$HTTPMETA as 
    +```
    +
    +### <a name="var_STYLESHEET"/> $STYLESHEET
    +```xquery
    +$STYLESHEET as 
    +```
    +
    +### <a name="var_JAVASCRIPT"/> $JAVASCRIPT
    +```xquery
    +$JAVASCRIPT as 
    +```
    +
    +### <a name="var_COOKIE"/> $COOKIE
    +```xquery
    +$COOKIE as 
    +```
    +
    +### <a name="var_response"/> $response
    +```xquery
    +$response as 
    +```
    +  Response Map used to store all response information ~
    +
    +
    +
    +
    +## Functions
    +
    +### <a name="func_initialize_1"/> initialize\#1
    +```xquery
    +initialize($response
    +)
    +```
    +
    +#### Params
    +
    +* response as 
    +
    +
    +### <a name="func_initialize_2"/> initialize\#2
    +```xquery
    +initialize(
    +    $response as map:map,
    +    $request as map:map?
    +)
    +```
    +  Initializes a response and returns a new response object 
    +
    +
    +#### Params
    +
    +* response as  map:map
    +
    +* request as  map:map?
    +
    +
    +### <a name="func_set-response_1"/> set-response\#1
    +```xquery
    +set-response($_response
    +)
    +```
    +
    +#### Params
    +
    +* _response as 
    +
    +
    +### <a name="func_set-base_1"/> set-base\#1
    +```xquery
    +set-base($isbase as xs:boolean
    +)
    +```
    +
    +#### Params
    +
    +* isbase as  xs:boolean
    +
    +
    +### <a name="func_base_0"/> base\#0
    +```xquery
    +base(
    +)
    +```
    +
    +### <a name="func_set-response_2"/> set-response\#2
    +```xquery
    +set-response($_response as map:map,$_request as map:map?
    +)
    +```
    +  Sets the response object for convenience features 
    +
    +
    +#### Params
    +
    +* _response as  map:map
    +
    +* _request as  map:map?
    +
    +
    +### <a name="func_set-flash_2"/> set-flash\#2
    +```xquery
    +set-flash($name as xs:string,$message as xs:string
    +)
    +```
    +  The Flash message is a convenient may to store information   between requests redirects for validation and other things.  THe flash object is cleared between request/response calls.  
    +
    +
    +#### Params
    +
    +* name as  xs:string as xs:string ~
    +
    +* message as  xs:string
    +
    +
    +### <a name="func_flash_0"/> flash\#0
    +```xquery
    +flash(
    +)
    +```
    +
    +### <a name="func_flush_0"/> flush\#0
    +```xquery
    +flush(
    +)
    +```
    +  In order to Route the request you must flush the map at the end   of a controller response.  The map is used by the dispatcher   finalize the rendering process. ~
    +
    +
    +### <a name="func_response_0"/> response\#0
    +```xquery
    +response(
    +)
    +```
    +  
    +
    +
    +### <a name="func_error_0"/> error\#0
    +```xquery
    +error(
    +)
    +```
    +
    +### <a name="func_set-error_2"/> set-error\#2
    +```xquery
    +set-error($code as xs:string,$ex as element()
    +)
    +```
    +
    +#### Params
    +
    +* code as  xs:string
    +
    +* ex as  element()
    +
    +
    +### <a name="func_has-error_0"/> has-error\#0
    +```xquery
    +has-error(
    +)
    +```
    +
    +### <a name="func_set-format_1"/> set-format\#1
    +```xquery
    +set-format($format
    +)
    +```
    +
    +#### Params
    +
    +* format as 
    +
    +
    +### <a name="func_format_0"/> format\#0
    +```xquery
    +format(
    +)
    +```
    +
    +### <a name="func_set-body_1"/> set-body\#1
    +```xquery
    +set-body($body
    +)
    +```
    +
    +#### Params
    +
    +* body as 
    +
    +
    +### <a name="func_body_0"/> body\#0
    +```xquery
    +body(
    +)
    +```
    +
    +### <a name="func_set-response-code_2"/> set-response-code\#2
    +```xquery
    +set-response-code(
    +    $code as xs:integer,
    +    $message as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* code as  xs:integer
    +
    +* message as  xs:string
    +
    +
    +### <a name="func_response-code_0"/> response-code\#0
    +```xquery
    +response-code(
    +)
    +```
    +
    +### <a name="func_set-content-type_1"/> set-content-type\#1
    +```xquery
    +set-content-type(
    +    $name as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +
    +### <a name="func_content-type_0"/> content-type\#0
    +```xquery
    +content-type(
    +)
    +```
    +
    +### <a name="func_set-application_1"/> set-application\#1
    +```xquery
    +set-application($application as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* application as  xs:string
    +
    +
    +### <a name="func_application_0"/> application\#0
    +```xquery
    +application(
    +)
    +```
    +
    +### <a name="func_set-controller_1"/> set-controller\#1
    +```xquery
    +set-controller($controller as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* controller as  xs:string
    +
    +
    +### <a name="func_controller_0"/> controller\#0
    +```xquery
    +controller(
    +)
    +```
    +
    +### <a name="func_set-action_1"/> set-action\#1
    +```xquery
    +set-action($action as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* action as  xs:string
    +
    +
    +### <a name="func_action_0"/> action\#0
    +```xquery
    +action(
    +)
    +```
    +
    +### <a name="func_partial_0"/> partial\#0
    +```xquery
    +partial(
    +)
    +```
    +
    +### <a name="func_set-partial_1"/> set-partial\#1
    +```xquery
    +set-partial($view as xs:boolean
    +)
    +```
    +
    +#### Params
    +
    +* view as  xs:boolean
    +
    +
    +### <a name="func_set-view_1"/> set-view\#1
    +```xquery
    +set-view($view as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* view as  xs:string
    +
    +
    +### <a name="func_view_0"/> view\#0
    +```xquery
    +view(
    +)
    +```
    +
    +### <a name="func_set-template_1"/> set-template\#1
    +```xquery
    +set-template($template as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* template as  xs:string
    +
    +
    +### <a name="func_template_0"/> template\#0
    +```xquery
    +template(
    +)
    +```
    +
    +### <a name="func_redirect_2"/> redirect\#2
    +```xquery
    +redirect($controller as xs:string,$action as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* controller as  xs:string
    +
    +* action as  xs:string
    +
    +
    +### <a name="func_redirect_1"/> redirect\#1
    +```xquery
    +redirect($uri as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* uri as  xs:string
    +
    +
    +### <a name="func_redirect_0"/> redirect\#0
    +```xquery
    +redirect(
    +)
    +```
    +
    +### <a name="func_add-response-header_2"/> add-response-header\#2
    +```xquery
    +add-response-header($key,$value
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +* value as 
    +
    +
    +### <a name="func_response-header_1"/> response-header\#1
    +```xquery
    +response-header($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_response-headers_0"/> response-headers\#0
    +```xquery
    +response-headers(
    +) as  map:map
    +```
    +
    +#### Returns
    +*  map:map
    +
    +### <a name="func_add-para_2"/> add-para\#2
    +```xquery
    +add-para(
    +  $key as xs:string,
    +  $value as xs:string
    +) as  empty-sequence()
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +* value as  xs:string
    +
    +
    +#### Returns
    +*  empty-sequence()
    +
    +### <a name="func_set-param_2"/> set-param\#2
    +```xquery
    +set-param($key as xs:string,$value as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +* value as  xs:string
    +
    +
    +### <a name="func_delete-param_1"/> delete-param\#1
    +```xquery
    +delete-param($key as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +
    +### <a name="func_delete-param_2"/> delete-param\#2
    +```xquery
    +delete-param($key as xs:string,$value as xs:string
    +)
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +* value as  xs:string
    +
    +
    +### <a name="func_param_1"/> param\#1
    +```xquery
    +param($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_get-data_1"/> get-data\#1
    +```xquery
    +get-data($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_set-data_2"/> set-data\#2
    +```xquery
    +set-data($key,$value
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +* value as 
    +
    +
    +### <a name="func_data_1"/> data\#1
    +```xquery
    +data($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_add-data_2"/> add-data\#2
    +```xquery
    +add-data($key,$value
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +* value as 
    +
    +
    +### <a name="func_slots_0"/> slots\#0
    +```xquery
    +slots(
    +)
    +```
    +
    +### <a name="func_set-slot_2"/> set-slot\#2
    +```xquery
    +set-slot($key,$value
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +* value as 
    +
    +
    +### <a name="func_has-slot_1"/> has-slot\#1
    +```xquery
    +has-slot($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_slot_1"/> slot\#1
    +```xquery
    +slot($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_set-title_1"/> set-title\#1
    +```xquery
    +set-title($value
    +)
    +```
    +  ~
    +
    +
    +#### Params
    +
    +* value as 
    +
    +
    +### <a name="func_title_0"/> title\#0
    +```xquery
    +title(
    +)
    +```
    +  Set the title for the given response page ~
    +
    +
    +### <a name="func_add-meta_2"/> add-meta\#2
    +```xquery
    +add-meta($key,$value
    +)
    +```
    + META~  ~
    +
    +
    +#### Params
    +
    +* key as 
    +
    +* value as 
    +
    +
    +### <a name="func_add-meta_3"/> add-meta\#3
    +```xquery
    +add-meta($key as xs:string,$value as xs:string,$append as xs:boolean
    +)
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +* value as  xs:string
    +
    +* append as  xs:boolean
    +
    +
    +### <a name="func_meta_1"/> meta\#1
    +```xquery
    +meta($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_meta-keys_0"/> meta-keys\#0
    +```xquery
    +meta-keys(
    +)
    +```
    +
    +### <a name="func_metas_0"/> metas\#0
    +```xquery
    +metas(
    +)
    +```
    +
    +### <a name="func_add-httpmeta_2"/> add-httpmeta\#2
    +```xquery
    +add-httpmeta($key,$value
    +)
    +```
    +HTTP META~
    +
    +
    +#### Params
    +
    +* key as 
    +
    +* value as 
    +
    +
    +### <a name="func_add-httpmeta_3"/> add-httpmeta\#3
    +```xquery
    +add-httpmeta($key as xs:string,$value as xs:string,$append as xs:boolean
    +)
    +```
    +
    +#### Params
    +
    +* key as  xs:string
    +
    +* value as  xs:string
    +
    +* append as  xs:boolean
    +
    +
    +### <a name="func_httpmeta_1"/> httpmeta\#1
    +```xquery
    +httpmeta($key
    +)
    +```
    +
    +#### Params
    +
    +* key as 
    +
    +
    +### <a name="func_httpmeta-keys_0"/> httpmeta-keys\#0
    +```xquery
    +httpmeta-keys(
    +)
    +```
    +
    +### <a name="func_httpmetas_0"/> httpmetas\#0
    +```xquery
    +httpmetas(
    +)
    +```
    +
    +### <a name="func_add-cookie_1"/> add-cookie\#1
    +```xquery
    +add-cookie($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_cookies_0"/> cookies\#0
    +```xquery
    +cookies(
    +)
    +```
    +
    +### <a name="func_cookie_1"/> cookie\#1
    +```xquery
    +cookie($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_remove-cookie_1"/> remove-cookie\#1
    +```xquery
    +remove-cookie($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_javascripts_0"/> javascripts\#0
    +```xquery
    +javascripts(
    +)
    +```
    +
    +### <a name="func_add-javascript_3"/> add-javascript\#3
    +```xquery
    +add-javascript(
    +$name as xs:string,
    +$position as xs:string,
    +$options as element(response:options)
    +)
    +```
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +* position as  xs:string
    +
    +* options as  element(response:options)
    +
    +
    +### <a name="func_add-javascript_1"/> add-javascript\#1
    +```xquery
    +add-javascript($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_remove-javascript_1"/> remove-javascript\#1
    +```xquery
    +remove-javascript($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_clear-javascripts_0"/> clear-javascripts\#0
    +```xquery
    +clear-javascripts(
    +)
    +```
    +
    +### <a name="func_stylesheets_0"/> stylesheets\#0
    +```xquery
    +stylesheets(
    +)
    +```
    +
    +### <a name="func_add-stylesheet_1"/> add-stylesheet\#1
    +```xquery
    +add-stylesheet($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_add-stylesheet_2"/> add-stylesheet\#2
    +```xquery
    +add-stylesheet($name as xs:string,$params as xs:string*
    +)
    +```
    +
    +#### Params
    +
    +* name as  xs:string
    +
    +* params as  xs:string\*
    +
    +
    +### <a name="func_remove-stylesheet_1"/> remove-stylesheet\#1
    +```xquery
    +remove-stylesheet($name
    +)
    +```
    +
    +#### Params
    +
    +* name as 
    +
    +
    +### <a name="func_clear-stylesheets_0"/> clear-stylesheets\#0
    +```xquery
    +clear-stylesheets(
    +)
    +```
    +
    +### <a name="func_set-model_1"/> set-model\#1
    +```xquery
    +set-model($model as element(domain:model)?
    +)
    +```
    +
    +#### Params
    +
    +* model as  element(domain:model)?
    +
    +
    +### <a name="func_model_0"/> model\#0
    +```xquery
    +model(
    +)
    +```
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src__framework_routing.xqy.md b/xqdoc/xqdoc_src__framework_routing.xqy.md
    new file mode 100644
    index 0000000..feabea5
    --- /dev/null
    +++ b/xqdoc/xqdoc_src__framework_routing.xqy.md
    @@ -0,0 +1,66 @@
    +# library module: http://www.xquerrail-framework.com/routing
    +  Provides Regex Routing support using Regex Routing Module  Routing can be modified to support any router as long as it   conforms to the routing.xsd. ~
    +
    +
    +
    +## Table of Contents
    +
    +* Variables: [$routes](#var_routes)
    +* Functions: [ route-valid\#1](#func_ route-valid_1), [ map-to-params\#1](#func_ map-to-params_1), [ get-route\#1](#func_ get-route_1)
    +
    +
    +## Variables
    +
    +### <a name="var_routes"/> $routes
    +```xquery
    +$routes as 
    +```
    +
    +
    +
    +## Functions
    +
    +### <a name="func_ route-valid_1"/>  route-valid\#1
    +```xquery
    + route-valid($route as element(routing:route)
    +)
    +```
    +  Function returns if a given route is valid according to schema definition ~
    +
    +
    +#### Params
    +
    +* route as  element(routing:route)
    +
    +
    +### <a name="func_ map-to-params_1"/>  map-to-params\#1
    +```xquery
    + map-to-params($map as map:map
    +)
    +```
    +  Converts a list of map values to a parameter string ~
    +
    +
    +#### Params
    +
    +* map as  map:map
    +
    +
    +### <a name="func_ get-route_1"/>  get-route\#1
    +```xquery
    + get-route($url as xs:string
    +)
    +```
    +  Returns the default route for a given url  
    +
    +
    +#### Params
    +
    +* url as  xs:string - Url to find the matching route. ~
    +
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*
    diff --git a/xqdoc/xqdoc_src_rewriter.xqy.md b/xqdoc/xqdoc_src_rewriter.xqy.md
    new file mode 100644
    index 0000000..07cf6b9
    --- /dev/null
    +++ b/xqdoc/xqdoc_src_rewriter.xqy.md
    @@ -0,0 +1,12 @@
    +# main module: 
    +  Responsible for URL rewriting  The rewriter intercepts URLs and rewrites the URL.  The rewriter is used to invoke the controller, run tests, and simulate the REST web service.  In most cases it delegates to the controller (/controller.xqy).  For example, given the original URL in the browser:  http://host:port/search?term=science&amp;from=1&amp;to=12  The URL rewriter would rewrite and pass the url to the server as:  http://host:port/app/controller.xqy?action=search&amp;term=science&amp;from=1&amp;to=12  return $request-url A url ready for server resolution.   
    +
    +
    +
    +## Table of Contents
    +
    +
    +
    +
    +
    +*Generated by [xquerydoc](https://github.com/xquery/xquerydoc)*