W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2011

RE: The file name for the output of an xsl:result-document

From: Geert Josten <geert.josten@dayon.nl>
Date: Thu, 3 Nov 2011 16:34:31 +0100
Message-ID: <0ae051f227f9eea7cf58ececb3666147@mail.gmail.com>
To: David Cramer <david@thingbag.net>, XProc Dev <xproc-dev@w3.org>
Hi David,

AVTs are indeed not supported, unfortunately. You will have to use
p:with-output for passing in a variable as well.

    <p:with-option name="href" select="$output-wadl"/>

The second store doesn't work, because resolve-uri only prepends a base if
the first argument represents a relative path. By supplying base-uri(/*)
you are passing in an absolute path, so resolve-uri won't work. You can
grab the last part of the path using a replace:

replace(base-uri(/*), '^(.*/)?([^/]+)$', '$2')

Kind regards,

-----Oorspronkelijk bericht-----
Van: David Cramer [mailto:david@thingbag.net]
Verzonden: donderdag 3 november 2011 15:43
Aan: XProc Dev
Onderwerp: Re: The file name for the output of an xsl:result-document

Hash: SHA1

Thanks Geert and Vojtech,

At the top of the file I've tried various versions of:

<p:variable name="input-base" select="p:base-uri(/*)"/>
<p:variable name="output-wadl"

Then to store the main result document, I want to use the value of
variable, but clearly AVTs aren't the way to do it:

<p:store href="{$output-wadl}"/>

Likewise, for the documents on the secondary port, using resolve-uri
(or p:resolve-uri) doesn't have any effect:

<p:with-option name="href"

I've put the whole listing here:


What am I doing wrong?

I feel like I'm struggling with very basic things. Aside from the
spec, is there a good xproc reference or tutorial that would help with
these questions? I've googled up a few things, but nothing that that
seems comprehensive. The best thing I've found so far is:


On 11/03/2011 06:09 AM, Geert Josten wrote:
> Hi David,
> Sounds like you want to put a p:variable at the top of your
> pipeline/declare-step, do the base-uri(/) or base-uri(/*) there.
> That takes the base-uri of the input, instead of the generated
> output. Then use resolve-uri('foo.xml', $input-base-uri) to get a
> path for foo.xml in the input folder..
> Kind regards, Geert
> -----Oorspronkelijk bericht----- Van: David Cramer
> [mailto:david@thingbag.net] Verzonden: donderdag 3 november 2011
> 3:06 Aan: Geert Josten CC: XProc Dev Onderwerp: Re: The file name
> for the output of an xsl:result-document
> Thanks Geert. That helped. Using p:log, I learned that
> base-uri(/*) causes the files land in my home directory with their
> appropriate file names.
> Now I just need to figure out how to say in xproc "In the same
> directory as the source document" (or in some dir passed in from
> Oxygen anyway). E.g. here:
> <p:store href="concat(???, '/', 'foo.xml')"/>
> and here:
> <p:with-option name="href" select="concat( ???, '/',
> p:base-uri(/*))"/>
> Though I could be going about it all wrong.
> Thanks, David
> On 11/01/2011 04:10 PM, Geert Josten wrote:
>> Hi David,
>> Bit of a guess here, but have you tried base-uri(/*) ?
>> Kind regards, Geert
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

Received on Thursday, 3 November 2011 17:53:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:01 UTC