SourceForge.net Logo

XQilla : ExtensionFunctions

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

XQilla XQuery Extension Functions


XQilla supports a number of additional functions as well as the standard XQuery functions. Some of these functions are from the XSLT 2.0 specification, and some of them are specific to XQilla. The namespace used for all XQilla specific extension functions is "http://xqilla.sourceforge.net/Functions", and it is bound to the prefix "xqilla" in the XQilla static context.


fn:unparsed-text

fn:unparsed-text($href as xs:string?) as xs:string?
fn:unparsed-text($href as xs:string?, $encoding as xs:string) as xs:string?

Summary: The unparsed-text function reads an external resource (for example, a file) and returns its contents as a string. The XSLT 2.0 specification fully describes the semantics of this function.

 



xqilla:parse-xml

xqilla:parse-xml($xml as xs:string?) as document-node()?

Summary: Parses the string argument as an XML document and returns it. If the argument is an empty sequence, the function returns the empty sequence. If the argument is invalid XML, the function raises an error.

 



xqilla:parse-json

xqilla:parse-json($xml as xs:string?) as element()?

Summary: Parses the string argument as a JSON document, returning XML representing the document. If the argument is an empty sequence, the function returns the empty sequence. If the argument is invalid JSON, the function raises an error.

 



xqilla:serialize-json

xqilla:serialize-json($json-xml as element()?) as xs:string?

Summary: Serializes the XML representation of JSON as a JSON document. If the argument is an empty sequence, the functions returns an empty sequence. If the argument is an invalid XML representation of JSON, the function raises an error.

 



xqilla:parse-html

xqilla:parse-html($html as xs:string?) as document-node()?

Summary: Parses the string argument as an HTML document using TidyLib. TidyLib accepts badly mangled HTML and will clean it up to be valid HTML. If the argument is an empty sequence, the function returns the empty sequence. If the argument is invalid HTML that TidyLib cannot clean up, the function will raise an error.

 


xqilla:time

xqilla:time($value as item()*, $label as xs:string) as item()*

Summary: Returns the first argument, outputting the time taken to evaluate it to the trace stream using the second argument as a label. This function can be useful to measure the performance of sub-expressions of a query.

 


CategoryXQuery

There are no comments on this page. [Add comment]

Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.2614 seconds