Running EXpath modules without the installer

23 views
Skip to first unread message

Carlos Araya

unread,
Mar 3, 2015, 3:14:12 AM3/3/15
to exp...@googlegroups.com
Good afternoon:

I'm working on a project that requires the File module in order to work. I've downloaded the xar and extracted the saxon-file.jar and placed in a directory (jlib) along with saxon.jar. 

If I understand Java correctly the following command should run the XSLT file with Saxon and give me the results I want. 

java -cp "jlib/*" net.sf.saxon.Transform -xsl:xslt/epub-ebook.xsl docs.xml -o:docs-epub.html

but I'm getting the following error:

Warning: Command failed: Error at xsl:for-each on line 159 column 82 of epub-ebook.xsl:
  XPST0017 XPath syntax error at char 0 on line 159 near {...tent/OEBPS', recursive='tru...}:
    Cannot find a matching 2-argument function named {http://expath.org/ns/file}list()
Stylesheet compilation failed: 1 error reported

Am I missing something? Is this the correct way to do it? I couldn't find instructions on using the module without installing the package manager. 

I'd rather not install the package manager because I'm pushing this project to Github for other people to use and want to reduce the number of dependencies as much as possible.

Thanks

Carlos 

Florent Georges

unread,
Mar 3, 2015, 3:23:56 AM3/3/15
to EXPath
On 3 March 2015 at 02:18, Carlos Araya wrote:

Hi Carlos,

> If I understand Java correctly the following command should run the XSLT
> file with Saxon and give me the results I want.

> java -cp "jlib/*" net.sf.saxon.Transform -xsl:xslt/epub-ebook.xsl docs.xml
> -o:docs-epub.html

This adds the JAR file to the classpath (and still, this is not
true, the classpath is not correct, due to the use of a glob, but this
is not the point). This is not enough, Saxon has to be configured so
it knows that the function file:list() is implemented by a specific
class.

> I'd rather not install the package manager because I'm pushing this project
> to Github for other people to use and want to reduce the number of
> dependencies as much as possible.

The repo manager helps one to organise his/her applications and
libraries in one repository. It provides also scripts to run Saxon
from the command line with support for such repositories. And it
provides Java classes to simplify configuring Saxon from a Java
application if necessary.

Your users do not have to use the manager, but then they have to
configure Saxon properly. Like with the XAR file above, you can
either use it, or open it and use the JAR file inside (but then you
have to see with Saxon for details for configuring a Java extension).

Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
Reply all
Reply to author
Forward
0 new messages