Changes

Jump to navigation Jump to search
1,167 bytes removed ,  17:35, 20 October 2017
no edit summary
==XQuery==
If an XQuery file is specified as input for the install command, it will be parsed as XQuery library module. If the file can successfully be parsed, the module URI will be [[Java Bindings#URI Rewriting|rewritten]] to a file path and attached with the {{Code|.xqm}} file suffix, and the original file will possibly be renamed and copied to that path into the repository.
'''Example:'''
</pre>
After having installed the module, all of the following URIs can be used in XQuery to import this module or call its functions (see [[Java Bindings#URI Rewriting|URI Rewriting]] for more information):
<nowiki>http://basex.org/modules/Hello</nowiki>
On our [http://files.basex.org/modules/ file server], you can find some example libraries packaged as XML archives (xar files). You can use them to try our packaging API or just as a reference for creating your own packages.
 
=URI Rewriting=
 
If a module is looked up in the repository, the namespace URI is rewritten to a local file path:
 
# If the URI is a URL:
## colons will be replaced with slashes,
## in the URI authority, the order of all substrings separated by dots is reversed, and
## dots in the authority and the path are replaced by slashes. If no path exists, a single slash is appended.
# Otherwise, if the URI is a URN, colons will be replaced with slashes.
# Characters other than letters, dots and slashes will be replaced with dashes.
# If the resulting string ends with a slash, the {{Code|index}} string is appended.
 
If the resulting path has no file suffix, it may point to either an XQuery module or a Java archive.
The following examples show some rewritings:
 
* {{Code|<nowiki>http://basex.org/modules/hello/World</nowiki>}} → {{Code|org/basex/modules/hello/World}}
* {{Code|<nowiki>http://www.example.com</nowiki>}} → {{Code|com/example/www/index}}
* {{Code|a/little/example}} → {{Code|a/little/example}}
* {{Code|a:b:c}} → {{Code|a/b/c}}
=Changelog=
* Added: [[#Combined|Combined]] XQuery and Java packages
 
;Version 8.2
 
* Added: [[#URI Rewriting|URI Rewriting]]: support for URNs
;Version 7.2.1
* Updated: [[#Installation|Installation]]: existing packages will be replaced without raising an error
* Updated: [[#Removal|Removal]]: remove specific version of a package
* Added: [[#Packaging|Packaging]], [[#URI Rewriting|URI Rewriting]]
;Version 7.1
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu