Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addInput() on UserArgs class invoked via Main driver class makes incorrect assumptions about file:// scheme for port uri's #135

xquery opened this issue Dec 31, 2013 · 2 comments


Copy link

xquery commented Dec 31, 2013

integrating xmlcalabash into eXist with something a bit more sophisticated ... ran into something when using the Main driver class.

If I set the args to the following;

String[] calabash_args = {,"-oresult=-","xmldb:exist:///db/test.xpl"};

calabash resolves xmldb:exist schema for pipeline URI with no problems but if I try to add some explicit uri to -oresult or as the following example illustrates, I try to supply -isource

String[] calabash_args = {"-isource=xmldb:exist:///db/test/test.xml","-oresult=-","xmldb:exist:///db/test.xpl"};

I get an error

net.sf.saxon.s9api.SaxonApiException: I/O error reported by XML parser processing file:///Users/jfuller/Source/FLOSS/exist/xmldb:exist:/db/test/test.xml: /Users/jfuller/Source/FLOSS/exist/xmldb:exist:/db/test/test.xml (No such file or directory)

as the exist:xmldb:// scheme gets munged with file:///

this is due to UserArgs at src/com/xmlcalabash/util/

the 'else' branches to fixing up the URI with file://

public void addInput(String port, String uri, Type type, String contentType) {
    if ("-".equals(uri) || uri.startsWith("http:") || uri.startsWith("https:") || uri.startsWith("file:")
            || "p:empty".equals(uri)) {
        curStep.addInput(port, uri, type, contentType);
    } else {
        curStep.addInput(port, "file://" + fixUpURI(uri), type, contentType);

even if I do provide a uri-resolver to xmlcalabash, I think this would still be a problem ... I think

thoughts ?

Copy link
Contributor Author

xquery commented Dec 31, 2013

affects addOutput as wel

Copy link
Contributor Author

xquery commented Jan 1, 2014

btw to make things work with eXist I just removed the special fixup code .... and had applied for input and output the default ... we could add a specific check for xmldb:exist (to allow) or something a bit more generic; trying to understand the special use case here eg. when special fixup and file:// needs tacking on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants