Re: Calumet and relative URIs

I agree your argument is better.
Especially in the light of a command line interface like

calumet -i source=../data/doc.xml http://foo/pipelines/pipeline.xpl

and the coresponding Java.

new Source("../data/doc.xml")

both "seem like they should" come from the filesystem.

Now there's always room for a "third way", that is from the command line 
allow a -baseuri used for resolution.
I do that in many xmlsh commands to allow "both ways" to be used so I'm 
always right :) (or always wrong ... :)

say

calumet -baseuri http://foo/pipelines -i source=../data/doc.xml pipeline.xpl


In the java code this would do the appropriate URI resolution against an 
explicit base.



David A. Lee
dlee@calldei.com  
http://www.calldei.com
http://www.xmlsh.org
812-482-5224



Toman_Vojtech@emc.com wrote:
> (I am changing the subject because to avoid confusion.)
>
>   
>>   I would say the above description is not correct neither, for
>> the same reason (well, for a proper definition of "wrong.")  If I
>> see Source("../data/doc.xml") in my Java code, I would expect the
>> input to be read from my filesystem, not from an HTTP server...
>>     
>
> I think you may be right. It actually becomes even more confusing if you
> use the command-line interface:
>
> calumet -i source=../data/doc.xml http://foo/pipelines/pipeline.xpl
>
> In the command-line Calumet *does* resolve against the current working
> directory. That means that in this case, ../data/doc.xml will be
> resolved to something like /path/to/cwd/..data/doc.xml
>
> So now I tend to think the Java API should probably be consistent with
> this, if only just to reduce the confusion.
>
>   
>>   Of course, if the pipeline definition itself contains such a
>> URI, that's another story...
>>     
>
> Then it automatically resolves against the base URI of the contianing
> element, which is the base URI of the pipeline in most cases. I think
> that in this case, the behavior is clear (and also what we want).
>
> Regards,
> Vojtech
>   

Received on Thursday, 23 July 2009 14:11:08 UTC