RE: err:XD0008 (more than one document in context) when not referring to the context

I think you are missing what I am trying to say. Why has the expression
have to be evaluated as XPath as-is? Nothing stopping the XProc spec
stating that if the context provides multiple docs, there will be some
kind of iteration over it. Why stop making XProc better, just because
XPath isn't fitting the bill?

;-)

> -----Oorspronkelijk bericht-----
> Van: fgeorges@gmail.com [mailto:fgeorges@gmail.com] Namens Florent
> Georges
> Verzonden: maandag 27 mei 2013 22:41
> Aan: Geert Josten
> CC: Jostein Austvik Jacobsen; XProc Dev
> Onderwerp: Re: err:XD0008 (more than one document in context) when not
> referring to the context
>
> On 27 May 2013 20:14, Geert Josten wrote:
>
> > Why can't you just use a //mypath-to-param on multiple input docs in
> > one blow?
>
>   The most obvious answer that comes in mind is that it is not what
> XPath defines.  An initial "//" is defined to be a shorthand to
> "(fn:root(self::node()) treat as document-node())/descendant-or-
> self::node()/" (see "§3.2 Path Expressions" in XPath 2.0).
>
>   So it is anchored at the root of the context node.  And the context
> node is not defined when there is more than one document on the
> connection for a p:with-option.
>
>   But in addition to not raise an error when more than one document
> appears to the connection of a p:with-option, we could even provide
> those documents to the XPath expression as well.  Using "//" is not
> possible with XPath, but a variable or a collection (maybe the default
> collection) are possible choices:
>
>     collection()//mypath-to-param
>     collection('http://www.w3.org/ns/xproc-input')//mypath-to-param
>     $p:input//mypath-to-param
>
>   I am not entirely convinced though, even if I have to admit that
> dealing with sequences of documents in XProc is sometimes quite
> tedious...
>
>   Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/

Received on Tuesday, 28 May 2013 05:34:34 UTC