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

Re: XML Calabash V0.9.20 released

From: Norman Walsh <ndw@nwalsh.com>
Date: Tue, 06 Apr 2010 16:35:15 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2k4skcoak.fsf@nwalsh.com>
Florent Georges <fgeorges@fgeorges.org> writes:

> 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.

At which point, I'm sorely tempted to revert the change :-)

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | There has never been a perfect
http://nwalsh.com/            | government, because men have passions;
                              | and if they did not have passions,
                              | there would be no need for
                              | government.-- Voltaire

Received on Tuesday, 6 April 2010 20:35:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 6 April 2010 20:35:50 GMT