Le 06/01/2012 11:49, Jostein Austvik Jacobsen a écrit :
(…)
There's one request I have though (more of a 'revolutionary' than a 'fix whats broke' thing): I'd like to be able to reuse my XSLT2 stylesheet functions in from the XPath expressions in my XProc pipelines.

To do this today, I pass the function parameters as parameters to a p:xslt step, which has an inlined XSLT2 stylesheet that imports the stylesheet containing the xsl:function, passes the parameters to the xsl:function and then outputs the result in a c:result element. Then I retrieve the result in my XProc pipeline by reading the result document from the p:xslt steps result port.

(…)
+1 too!

+1 also more steps to work with files: it's annoying to use a "XML pipeline language" if you have to call it inside a script that has to
work with XML files to zip/unzip, copy, rename, delete, select which ones to process (based on their metadata (date, …), a shell pattern, ...).
For each of these steps, we need good error reporting (nonblocking and understandable).


I also think it should be easier to use for someone that is already familiar with XSLT.

For examples:
1)
XProc: p:for-each uses p:iteration-source
<p:for-each name="chapters">
  <p:iteration-source select="//chapter"/>
  (do something)
</p:for-each>

XSLT: xsl:for-each uses select=""
<xsl:for-each select="//chapter">
   (do something)
</xsl:for-each>

It would be nice to write instead:
<p:for-each select="//chapter" name="chapters">
  (do something)
</p:for-each>
Less typing, more use of existing knowledge.

2)
With xsl:result-document, @href can be "{upper-case($output-file)}", but this is invalid in XProc (!).
If you want to use a variable with p:store, you can't use href="{$a}", you have to use
<p:with-option name="href" select="$output-file"/>
But "{upper-case($output-file)}" is still invalid (!?).


To sum up: could XProc be a bit more developer and XSLT friendly? ;)