Re: Calabash: Java API

2009/7/23 David A. Lee wrote:

  Hi David,

> [...]

> Then inside that test is a reference to "testpipe.xml" (the
> xproc source).

> [...]

> Different threads in xmlsh have their own "current directory"
> but java doesnt support per-thread pwd's, so if calabash had
> resolved all relative URI's to the process-global PWD it would
> break given any relative paths.

> So I think this is the correct way to go both from an XML
> perspective and from a Java perspective.

  Well, in your example with the test suite, I think this is a
feature *of the test suite format* itself: how should embedded
URIs be resolved.

  About the PWD, my point is not about using the PWD, whatever is
is defined to be, but instead to use the same resolving mechanism
for different Source objects using a system ID, independently of
what they are use for (as pipeline document source or input
document source.)

  To take a concrete example, the following tries to apply an
XProc document to itself, but won't work:

    String        path  = "some/path/to/pipeline.xproc";
    Source        src   = new Source(path);
    Pipeline      pipe  = engine.newPipeline(src);
    PipelineInput input = new PipelineInput();
    input.addInput("source", new Source(path));

  Something like "some/path/to/some/path/to/pipeline.xproc cannot
be found" will be the error message.  But the following will
succeed (a little bit surprisingly IMHO):

    Source        src   = new Source("some/path/to/pipeline.xproc");
    Pipeline      pipe  = engine.newPipeline(src);
    PipelineInput input = new PipelineInput();
    input.addInput("source", new Source("pipeline.xproc"));

  But maybe I missed your point?

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/

Received on Thursday, 23 July 2009 12:51:04 UTC