

                * EXPath Package Repository Manager *

                                README



     The EXPath Packaging System is a system to package, deliver,
   install and use XSLT, XQuery and XProc libraries.  It is defined by
   its own specification[1], which defines also a standard repository
   layout for such packages.  For more infos and latest doc, see [3].

     This is an implementation of such a repository, providing a tool
   to manage it, as well as runtime support for Saxon.  Those are
   provided by the scripts "xrepo" and "saxon".  In order to use a
   repository, you first have to initialize it.  Then you can install
   package within the repository, and use it to resolve libraries from
   your own stylesheets, queries and pipelines.

     To install it, just unzip the distribution file, and go to that
   directory in the command line (with a Unix shell or the Windows
   command line).  Then set the environment variable SAXON_HOME to
   point to the directory where you installed Saxon (either in your
   environement, or by modifying directly the scripts).  Then execute
   the following commands on Unix to create a new repository, install
   the sample package, and run the sample stylesheet and query which
   use this package (you will need to create the dir /usr/share/expath
   first, or adapt the path):

       $ xrepo create /usr/share/expath/repo
       $ xrepo --repo /usr/share/expath/repo install sample/hello-1.0.xar
       Install module Test package? [true]:
       Install it to dir [hello]:
       $ saxon --repo /usr/share/expath/repo -xsl:sample/test-hello.xsl -it:main
       <greetings>Hello, world!</greetings>
       $ saxon --repo /usr/share/expath/repo --xq sample/test-hello.xq
       <greetings>Hello, world!</greetings>

   or the following on Windows (you will need to create the directory
   c:/expath first, or adapt the path):

       > xrepo.bat create c:/expath/repo
       > xrepo.bat --repo c:/expath/repo install sample/hello-1.0.xar
       Install module Test package? [true]:
       Install it to dir [hello]:
       > saxon.bat --repo c:/expath/repo -xsl:sample/test-hello.xsl -it:main
       <greetings>Hello, world!</greetings>
       > saxon.bat --repo c:/expath/repo --xq sample/test-hello.xq
       <greetings>Hello, world!</greetings>

     If you want to use the same repository everytime you execute
   Saxon from the command line, set the environment variable
   EXPATH_REPO to the repository directory, and both "xrepo" and
   "saxon" will use this value as a default if you don't explicitely
   call them with the option "--repo".  For example the following is
   the equivalent of the above Unix commands, providing that the
   variable EXPATH_REPO has been set to /usr/share/expath/repo:

       $ xrepo create /usr/share/expath/repo
       $ xrepo install sample/hello-1.0.xar
       Install module Test package? [true]:
       Install it to dir [hello]:
       $ saxon -xsl:sample/test-hello.xsl -it:main
       <greetings>Hello, world!</greetings>
       $ saxon --xq sample/test-hello.xq
       <greetings>Hello, world!</greetings>

     If you cannot use those Unix and Windows scripts, the equivalent
   Java commands are the following (the scripts do a bit more job, but
   this is the equivalent of the above simple commands):

       $ java -jar pkg-java.jar create /tmp/repo
       $ java -jar pkg-java.jar --repo /tmp/repo install sample/hello-1.0.xar
       Install module Test package? [true]:
       Install it to dir [hello]:
       $ java -Dorg.expath.pkg.saxon.repo=/tmp/repo \
           -cp .../saxon9.jar:resolver.jar:pkg-java.jar:pkg-saxon.jar \
           net.sf.saxon.Transform \
           -init:org.expath.pkg.saxon.PkgInitializer \
           -xsl:sample/test-hello.xsl \
           -it:main
       <greetings>Hello, world!</greetings>
       $ java -Dorg.expath.pkg.saxon.repo=/tmp/repo \
           -cp .../saxon9.jar:resolver.jar:pkg-java.jar:pkg-saxon.jar \
           net.sf.saxon.Query \
           -init:org.expath.pkg.saxon.PkgInitializer \
           sample/test-hello.xq
       <greetings>Hello, world!</greetings>

     There are also Java classes to configure Saxon when it is used
   directly from within a Java application.  Ask the EXPath mailing
   list if you want more info on that subject[2].

     You can call "xrepo" and "saxon" with the option "help" to get
   help about more options.  If you have more questions or remarks, or
   if you find any bug, please use the EXPath mailing list[2].  This
   implementation of the EXPath repository is hosted by Google
   Code[3], where you can find sources, distribution files and doc.

[1] http://expath.org/modules/pkg.html
[2] http://expath.org/lists.html
[3] http://expath-pkg.googlecode.com
