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

> > 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?
>   I would not say so, I would say that there are solutions that are
> compatible with XPath.  Evaluating several times the expression is
> another solution, but you would have to define how to combine the
> result into one (do you define an order across several documents, do
> you reorder, do you de-duplicate, etc.?)

[Geert Josten]

I was just responding to you stating that // has a specific behavior in
XPath, while we are talking about XProc here. Nothing stopping us from
specifying that using // within for instance an option or variable
expression will be applied to sequences in a certain way.

Your collection() suggestion is not bad by the way, but in that case I'd
rather opt for a new XProc-only function called context() or something
like that. A bit like the current() function in XSLT, but not just
returning the current context item, but the entire list.

I would prefer though not having to write anything in front of the // at
all. Just knowing that when you provide a sequence of docs as input, it
will be applied to all of them, accumulating results in the order the docs
appeared. For some reason multiple inputs were provided, the expression
can easily be applied to each item in the list, so why not just do that?

Anyone else care to comment?


Received on Wednesday, 29 May 2013 06:05:18 UTC