Skip to content

Can the EXPath File module peacefully co-exist with the eXist native file module? #6

@joewiz

Description

@joewiz

What's the best way to make this awesome package available to the eXist community?

Normally I'd propose including this in the default distribution via the installer's autodeployed .xar files, or distributing it via the eXist public-repo, but I see one impediment to this:

After installing the .xar, you have to edit conf.xml to uncomment eXist's native file module (https://github.com/eXist-db/exist/blob/develop/conf.xml.tmpl#L874). Otherwise, the following code (used in eXide's routines that supply function documentation) return an error:

inspect:inspect-module-uri(xs:anyURI("http://expath.org/ns/file"))

The error:

err:XQST0033 Cannot bind prefix 'file' to 'http://expath.org/ns/file' it is already bound to 'http://exist-db.org/xquery/file' [source: xquery version "3.1"; inspect:inspect-module-uri(xs:anyURI("http://expath.org/ns/file"))]

I don't mind commenting it out, but this is a hurdle beyond the "click to install" instructions that we'd like to be able to give users.

Is there something we can do to allow these two "file" modules to coexist more peacefully in eXist?

That said, once the native file module is uncommented, it can be imported into queries that use the old functions.

import module namespace file="http://exist-db.org/xquery/file" at "java:org.exist.xquery.modules.file.FileModule";

The corresponding code for the EXPath File Module, once installed, is:

import module namespace file="http://expath.org/ns/file" at "java:org.exist.xquery.modules.expath.file.ExpathFileModule";

Also, not a dealbreaker, just an observation: the .xar file is 17.2 MB - kind of large.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions