W3C home > Mailing lists > Public > xproc-dev@w3.org > August 2014

Re: setting uri on primary output of xslt

From: Paul Tyson <phtyson@sbcglobal.net>
Date: Thu, 31 Jul 2014 19:30:52 -0500
To: xproc Dev <xproc-dev@w3.org>
Message-ID: <1406853052.3715.10.camel@aquinas.attlocal.net>
On Wed, 2014-07-30 at 08:51 +0200, Romain Deltour wrote:
> On 30 juil. 2014, at 02:58, Paul Tyson <phtyson@sbcglobal.net> wrote:
> 
> > Question #1: Is this the expected behavior per spec, or
> > implementation-specific? In either case, it would be good if the spec
> > either clarified the expectation or stated that this was an
> > implementation choice. Looking back with what I know now, it seems
> > calabash is doing the sensible thing, but I still can't piece together
> > the right paragraphs in the xproc and xslt2 specifications to justify
> > this.
> 
> Yes, I’m pretty sure it’s the intended behavior defined by the *spec* (not implementation-specific). The relevant lines in the XProc spec are:
> 
>   "The primary result document of the transformation appears on the result port. All other result documents appear on the secondary port.”
> 
> But I agree that this can be confusing since the XSLT spec doesn’t define the term “primary result document” of a transformation. XSLT instead uses the term “final result tree”, and doesn’t explicitly name the primary result document other than with something like “final result tree implicitly created by the initial template”.
> 
> By the way, I would believe that if the XSLT initial template doesn’t implicitly create a final result tree *but* there is an <xsl:result-document> instruction with an empty href, then that would be passed to the primary result port in XProc ?
> 
> I definitely agree the XProc spec would need clarification here.
> 

You're right, the xslt output with no document-uri is the "primary" one
for xproc, whether it is produced as the implicit result of a
stylesheet, or a <xsl:result-document> with no href.

A useful option on p:xslt would be "primary-output-uri" so that
subsequent steps could always see a document-uri on xslt output
documents.

> > 
> > Having settled that issue, I then tried to set the uri of the default,
> > or primary, result document. With <xsl:result-document>, you just set
> > the href attribute. In my case it worked to use a relative uri in the
> > stylesheet, and set the output-base-uri on the p:xslt step. Then
> > subsequent steps could use the document-uri() associated with each
> > result document. But due to the apparent asymmetry in setting document
> > uris on the "primary" and "secondary" output of xslt, I need some other
> > way to conditionally process the primary results from p:xslt. I could
> > find no way to add the document uri during or after the xslt step. As
> > far as I can tell it comes out with an empty document-uri, which seems
> > to be as specified by xslt2 for the default result document. I tried
> > setting xml:base on various elements, but nothing worked.
> 
> About that issue, see that other thread:
>   http://lists.w3.org/Archives/Public/xproc-dev/2013Mar/0013.html
> 
> And related bugs:
>   https://github.com/ndw/xmlcalabash1/issues/94
>   https://saxonica.plan.io/issues/1724
> 
> About the "apparent asymmetry” thing, have you tried using an <xsl:result-document> with empty href instead of an implicitly created final result tree ?
> 

I see this is a tricky business. Thanks for the pointers.

> > 
> > Question #2: Is there a way to set document-uri on an intermediate
> > document in an xproc pipeline?
> 
> Calabash provides a <pxp:set-base-uri> step since 1.0.17, and this will hopefully be standardized in XProc 2.0 (or wherever the VNext standard step library will be specified).
> 

In calabash 1.0.18-95 this sets the uri but elides document content. I
created an issue: https://github.com/ndw/xmlcalabash1/issues/162

Regards,
--Paul
Received on Friday, 1 August 2014 00:32:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:12 UTC