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

Closed
xquery opened this Issue Dec 31, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@xquery
Contributor

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/UserArgs.java

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 ?

@xquery

This comment has been minimized.

Show comment
Hide comment
@xquery

xquery Dec 31, 2013

Contributor

affects addOutput as wel

Contributor

xquery commented Dec 31, 2013

affects addOutput as wel

@xquery

This comment has been minimized.

Show comment
Hide comment
@xquery

xquery Jan 1, 2014

Contributor

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.

Contributor

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