W3C home > Mailing lists > Public > xproc-dev@w3.org > April 2010

RE: XML Calabash V0.9.20 released

From: <Toman_Vojtech@emc.com>
Date: Wed, 7 Apr 2010 05:54:05 -0400
Message-ID: <997C307BEB90984EBE935699389EC41C839168@CORPUSMX70C.corp.emc.com>
To: <xproc-dev@w3.org>
> > On 6 April 2010 21:07, Norman Walsh wrote:
> >
> >>  <p:with-option name="href" select="concat(cxf:cwd(), "/foo.txt")"/>
> >
> >   Sounds like resolve-uri(cxf:cwd(), 'foo.txt') to me ;-)
> 
> Yeah, that would amount to the same thing. So the real world use cases
> were a little more complex. Things like this:
> 
>   select="concat(cxf:cwd(), '/examples/', $name)"
> 
> which amount to
> 
>   select="resolve-uri(cxf:cwd(), concat('/examples/', $name))"
> 
> which is a little more tedious. Of course, they also amount to
> this:
> 
>   select="concat(cxf:cwd(), 'examples/', $name)"
> 
> if you just remember that cxf:cwd() always ends with a slash.
> 
> My problem, and what motivated my change, is that I kept thinking that
> cxf:cwd() was going to behave like cwd() in Perl or Python and so I'd
> get extra slashes and such.
> 
> Now, maybe the right answer is, I should stop thinking in terms of
> scripting languages and directories and think in terms of XML and
> URIs.
> 

For my part, I agree with Florent on this one. Having the trailing slash is more consistent with what the URI spec says about directories, plus it does not introduce any weird behavior to the resolve-uri functionality. (But really, I think you really should avoid using concat for paths/URIs in XProc :)

Regards,
Vojtech
Received on Wednesday, 7 April 2010 09:55:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 April 2010 09:55:02 GMT