<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<info>
    
    
    
    
    
    
    
    
    
<title>XProc Working Draft (6 July 2007)</title><biblioid class="uri">http://norman.walsh.name/2007/07/06/xproc</biblioid>
<volumenum>10</volumenum>
<issuenum>64</issuenum>
<pubdate>2007-07-06T13:58:48-04:00</pubdate>
<date>$Date: 2007-07-06 14:28:24 -0400 (Fri, 06 Jul 2007) $</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2007</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>The XML Processing Model Working Group has published a new Working
Draft of XProc: An XML Pipeline Language.</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#XML"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#XProc"/>
</info>

<para xml:id="p1">The
<link xlink:href="http://www.w3.org/XML/Processing/">Processing Model
Working Group</link> is driving as quickly as possible to Last Call on
<wikipedia page="XML_pipeline">XProc</wikipedia>. I think our
<link xlink:href="http://www.w3.org/TR/xproc/">latest draft</link>, published
<link xlink:href="http://www.w3.org/TR/2007/WD-xproc-20070706/">today</link>,
is getting pretty close.</para>

<para xml:id="p2">This draft resolves (finally, I hope) the question of how to
<link xlink:href="/2007/06/13/xprocParameters">deal with parameters</link>.
I don't think we've quite
<link xlink:href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2007Jul/0069.html">dotted the i's and crossed the t's</link> on how the new parameter
story interfaces with the outside world, but I'm confident that we'll
get there.</para>

<para xml:id="p3">We've also introduced a new defaulting story. I expect this will
generate feedback, both positive and negative. Designing an XML
language like XProc is necessarily a compromise. On the one hand, it
would be possible (and is desireable) to design a completely explicit
and regular language. On the other hand, it has to be something that
users can reasonably be expected to write in a text editor, and that
means some syntactic shortcuts are desirable.</para>

<para xml:id="p4">(You may think that tools will completely obviate the need for
users to look at angle brackets. If XProc is successful, you might be
right. But the early adopters write XML in an editor and if the early
adopters don't use your language, it'll never be successful. So it
has to be something users can write in a text editor. QED.)</para>

<para xml:id="p5">In a nutshell, the defaulting story goes like this:</para>

<orderedlist>
<listitem>
<para xml:id="p6">Steps can have a distinguished “primary input port” and a
distinguished “primary output port” (independently).
</para>
</listitem>
<listitem>
<para xml:id="p7">If the user doesn't specify a binding for a primary input port,
it is automatically bound to the preceding step's primary output port.
</para>
</listitem>
<listitem>
<para xml:id="p8">If a pipeline does not declare any input ports, and the first step in the
pipeline has a primary input port, then the pipeline gets an anonymous input that's
automatically bound to the primary input port of the first step.
</para>
</listitem>
<listitem>
<para xml:id="p9">If a pipeline does not declare any output ports, and the
<emphasis>last</emphasis> step in the pipeline has a primary <emphasis>output</emphasis>
port, then the pipeline gets an anonymous output that's automatically
bound to the primary output port of the last step.
</para>
</listitem>
</orderedlist>

<para xml:id="p10">What all this means is, the following pipeline does the right
thing:</para>

<programlisting>&lt;p:pipeline xmlns:p="http://www.w3.org/2007/03/xproc"&gt;
  &lt;p:xinclude/&gt;
  &lt;p:xslt&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="someURI.xsl"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;
&lt;/p:pipeline&gt;</programlisting>

<para xml:id="p11">It accepts one document, runs XInclude on it, transforms it with
the specified stylesheet, and produces as its output, the result of
that transformation.</para>

<para xml:id="p12">We've also done some work on the step library, generalizing
<tag>p:head</tag>, <tag>p:tail</tag>, and <tag>p:matching-documents</tag> into
a single <tag>p:split-sequence</tag> step; added <tag>p:count</tag>;
added <tag>p:string-replace</tag>; etc.</para>

<para xml:id="p13">I hope the next draft is our Last Call draft and I hope it comes out in July.
What stands in our way? A solid serialization story, a solid
<tag>p:http-request</tag> story, a review of our error story, some general
cleanup and clarification. What else?</para>

</essay>

