<?xml version="1.0" encoding="UTF-8"?>
<!--
<?publication-root http://www.w3.org/XML/XProc/docs/?>
<?latest-version http://www.w3.org/XML/XProc/docs/langspec.html?>
-->
<!DOCTYPE specification [
<!ENTITY % entities SYSTEM "langspec.ent">
<!ENTITY atom "step">
<!ENTITY Atom "Step">
<!ENTITY atoms "steps">
<!ENTITY Atoms "Steps">
<!ENTITY kind "type">
<!ENTITY container "container">
<!ENTITY containers "containers">
<!ENTITY Containers "Containers">
<!ENTITY construct "construct">
<!ENTITY constructs "constructs">
<!ENTITY Constructs "Constructs">
<!ENTITY stage "component">
<!ENTITY stages "components">
<!ENTITY Stage "Component">
<!ENTITY Stages "Components">
]>
<specification xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" class="wd" version="5.0-extension w3c-xproc">
<info>
<title>XProc: An XML Pipeline Language</title>
<w3c-shortname>xproc</w3c-shortname>
<pubdate>2006-11-17</pubdate>

<bibliorelation type="isformatof" xlink:href="langspec.xml">XML</bibliorelation>
<bibliorelation type="isformatof" xlink:href="diff.html">Revision markup</bibliorelation>

<bibliorelation type="replaces" xlink:href="http://www.w3.org/TR/2006/WD-xproc-20060928/"/>

<authorgroup>
  <author>
    <personname>Norman Walsh</personname>
    <affiliation>
      <orgname>Sun Microsystems, Inc.</orgname>
    </affiliation>
    <email>Norman.Walsh@Sun.COM</email>
  </author>
  <author>
    <personname>Alex Milowski</personname>
    <affiliation>
      <orgname>Invited expert</orgname>
    </affiliation>
    <email>alex@milowski.org</email>
  </author>
</authorgroup>
  
<abstract>
<para>This specification describes the syntax and semantics of
<citetitle>XProc: An XML Pipeline Language</citetitle>, a language
for describing operations to be performed on XML documents.
</para>

<para>An XML Pipeline specifies a sequence of operations to be
performed on one or more XML documents, producing one or more XML
documents as output. &Atoms; in the pipeline may read or write
non-XML resources as well.</para>
</abstract>

<legalnotice role="status">

<para><emphasis>This section describes the status of this document at
the time of its publication. Other documents may supersede this
document. A list of current W3C publications and the latest revision
of this technical report can be found in the <link xlink:href="http://www.w3.org/TR/">W3C technical reports index</link>
at http://www.w3.org/TR/.</emphasis></para>

<para>This document was produced by the
<link xlink:href="http://www.w3.org/XML/Processing/">XML Processing Model Working Group</link>
which is part of the
<link xlink:href="http://www.w3.org/XML/Activity">XML Activity</link>.
Publication as a Working Draft does not imply endorsement
by the W3C Membership. This is a draft document and may be updated,
replaced or obsoleted by other documents at any time. It is
inappropriate to cite this document as other than work in progress.
</para>

<para>This is a public Working Draft. While some details of the design
remain incomplete, the Working Group has chosen to publish a new draft
in order to show the direction we are heading and to encourage
feedback from potential users.</para>

<para>Please send comments about this document to
<link xlink:href="mailto:public-xml-processing-model-comments@w3.org">public-xml-processing-model-comments@w3.org</link> (public
<link xlink:href="http://lists.w3.org/Archives/Public/public-xml-processing-model-comments/">archives</link> are available).</para>

<para>This document was produced by a group operating under the
<link xlink:href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</link>.
W3C maintains a
<link xlink:href="http://www.w3.org/2004/01/pp-impl/38398/status">public list of any patent disclosures</link>
made in connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who has
actual knowledge of a patent which the individual believes contains
<link xlink:href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</link>
must disclose the information in accordance with
<link xlink:href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</link>.
</para>

</legalnotice>
</info>

<section xml:id="introduction">
<title>Introduction</title>

<para>An XML Pipeline specifies a sequence of operations to be
performed on a collection of input documents. Pipelines take zero or more
XML documents as their input and produce zero or more XML documents as
their output. &Atoms; in the pipeline <rfc2119>may</rfc2119>
read or write non-XML resources as well.</para>

<para>A pipeline consists of &stages;. Like
pipelines, &stages; take zero or more XML documents as their input
and produce zero or more XML documents as their output. The inputs to
a &stage; come from the web, from the pipeline document, from the inputs to the
pipeline itself, or from the outputs of other &stages; in the pipeline. The outputs
from a &stage; are consumed by other &stages;, are outputs of the pipeline as
a whole, or are discarded.</para>

<para>There are two kinds of &stages;: &atoms; and (language)
&constructs;. &Atoms; carry out single operations and have no
substructure as far as the pipeline is concerned, whereas &constructs;
can include &stages; within themselves.</para>

<para>This specification defines a standard library,
<xref linkend="std-components"/>, of &atoms;.
Pipeline implementations <rfc2119>may</rfc2119> support additional &atoms; as
well.</para>

<para><xref linkend="fig-xival"/> is a graphical representation of a
simple pipeline that performs XInclude processing and validation on a
document.</para>

<figure xml:id="fig-xival">
<title>A simple, linear XInclude/Validate pipeline</title>
<mediaobject>
<alt>A simple, linear XInclude/Validate pipeline</alt>
<imageobject>
<imagedata fileref="graphics/sch-xinclude-validate-pipeline.png"/>
</imageobject>
</mediaobject>
</figure>

<para>This is a pipeline that consists of two &atoms;, XInclude and
Validate. The pipeline itself has two inputs, “Document” and “Schema”.
How these inputs are connected to XML documents outside the pipeline
is implementation-defined.
The XInclude
&atom; reads the pipeline input “Document” and produces a result
document. The Validate &atom; reads the pipeline input “Schema” and
the output from the XInclude &atom; and produces a
result document. The result of the validation, “Result Document”,
is the result of the pipeline.
How pipeline outputs are connected to XML documents outside the pipeline is
implementation-defined.</para>

<para><xref linkend="fig-style-proc"/> is a more complex example: it
performs schema validation with an appropriate schema and then styles
the validated document.</para>

<figure xml:id="fig-style-proc">
<title>A validate and transform pipeline</title>
<mediaobject>
<alt>A validate and transform pipeline</alt>
<imageobject>
<imagedata fileref="graphics/sch-transform.png"/>
</imageobject>
</mediaobject>
</figure>

<para>The heart of this example is the conditional. The  “choose”
&construct; evaluates an XPath expression over a test document. Based on the
result of that expression, one or another branch is evaluated. In this example,
each branch consists of a single validate &stage;.</para>

<para>Pipelines for these two examples can be found in
<xref linkend="examples"/>.</para>

</section>

<section xml:id="pipeline-concepts">
<title>Pipeline Concepts</title>

<para><termdef xml:id="dt-pipeline">A <glossterm>pipeline</glossterm>
is a set of &stages; connected
together, with outputs flowing into inputs, without any loops (no &stage; can
read its own output, directly or indirectly).</termdef>
A pipeline is itself a
<glossterm>&construct;</glossterm> and must satisfy the constraints on
&constructs;.</para>

<para>The result of evaluating a pipeline is the result of evaluating
the &stages; that it contains, in the order determined by the connections
between them. A pipeline must behave as if it
evaluated each &stage; each time it occurs. Unless otherwise
indicated, implementations <rfc2119>must not</rfc2119> assume that
&stages; are functional (that is, that their outputs depend only on
their explicit inputs and parameters) or side-effect free.</para>

<section xml:id="stages">
<title>&Atoms;, &Constructs;, and Subpipelines</title>

<para>&Atoms; are the basic computational units of a pipeline.
<termdef xml:id="dt-component">A <glossterm>&atom;</glossterm> is an atomic
&stage; that performs a
unit of XML processing, such as XInclude or transformation.</termdef> &Atom;s can
perform arbitrary amounts of computation but they are indivisible from
the point of view of the &construct; that contains them.
&Atoms; carry out fundamental XML operations. An XSLT &atom;,
for example, performs XSLT processing; a validation &atom; validates
one input with respect to some schema, etc.</para>

<para>Language &constructs;, on the other hand, control and organize the flow of
documents through a pipeline, reconstructing familiar programming
language functionality such as conditionals, iterators and exception
handling.  As such, they typically contain &stages;, whose evaluation
they control.</para>

<para><termdef xml:id="dt-construct">A
<glossterm>&construct;</glossterm> is a &stage; that
contains additional components. That is, a &construct; differs from a
&atom; in that its semantics are at least partially determined by the
components that it contains.</termdef></para>

<para>Every &construct; contains zero or more &stages;.
<termdef xml:id="dt-contained-components">The &stages; that occur
directly inside a &construct;
are called <glossterm>contained &stages;</glossterm>.</termdef>
<termdef xml:id="dt-container">A &construct; which immediately
contains a &stage; is called its <glossterm>&container;</glossterm>.</termdef>
</para>

<para><termdef xml:id="dt-subpipeline">The &stages; (and the connections between them)
within a container form
a <glossterm>subpipeline</glossterm>.</termdef> Each &construct; determines how
and which, if any, of its subpiplines is evaluated.</para>

<para>&Atoms; and &constructs; have “ports” into which inputs and outputs are
connected. Each &stage; has a number of input ports and a number of
output ports, all with unique names. A &stage; can have zero input
ports and/or zero output ports.
(All &stages; have an implicit standard output port for
reporting errors that <rfc2119>must not</rfc2119> be declared.)
</para>

<para>&Stages; have any number of parameters, all with unique names.
A &stage; can have zero parameters.</para>
</section>

<section xml:id="input-output">
<title>Inputs and Outputs</title>

<para>Although some kinds of &stages; can read and write non-XML resources,
what flows <emphasis>between</emphasis> &stages; as
inputs and outputs are exclusively XML documents or sequences of XML
documents. Each XML document (or document in a sequence) must be
an <biblioref linkend="xml-infoset-rec"/> with a <emphasis>Document
Information Item</emphasis> at its root. The inputs and outputs can be
implemented as sequences of characters, events, or object models, or any other
representation the implementation chooses.</para>

<para>It is a <glossterm>dynamic error</glossterm> if a non-XML
resource is produced on a &stage; output or arrives on a &stage;
input.</para>

<note role="editorial" xml:id="non-xml-not-detected">
<para>What about the cases where it's impractical to test for this error?</para>
</note>

<para>An implementation <rfc2119>may</rfc2119> make it possible for a
&stage; to produce non-XML output—for example, writing a PDF
document—but that output cannot flow through the pipeline. Similarly,
one can imagine a &stage; that takes no pipeline inputs, reads a non-XML file
from a URI, and produces an XML output. But the non-XML file cannot be
an input to a &stage; or pipeline.</para>

<para>Each &stage; declares its input and output ports. 
<termdef xml:id="dt-declared-inputs">The input ports declared on a
&stage; are its <glossterm>declared inputs</glossterm>.</termdef>
<termdef xml:id="dt-declared-outputs">The output ports declared on a
&stage; are its <glossterm>declared outputs</glossterm>.</termdef></para>

<para>All of the <glossterm>declared inputs</glossterm>
of a &stage; must be connected to outputs in the pipeline.
It is a <glossterm>static error</glossterm> if a &stage; has
an input port which is not connected. Unconnected output ports are allowed;
any documents produced on those ports are simply discarded.</para>

<para><termdef xml:id="dt-signature">The
<glossterm>signature</glossterm> of a &stage; is the set of inputs,
outputs, and parameters that it is declared to accept.</termdef> Each
&kind; of &atom; (e.g. XSLT or XInclude) has a fixed signature, declared
globally or built-in, which all its instances share, whereas each
instance of a &construct; has its own signature declared
locally.</para>

<para><termdef xml:id="dt-matches">A &stage;
<glossterm>matches</glossterm> its signature if and only if it specifies
an input for each declared input and it specifies no inputs that are not
declared; it specifies
a parameter for each parameter that is declared to be required; and it
specifies no parameters that are not declared.</termdef>
In other words, every input and required parameter <rfc2119>must</rfc2119> be specified
and only inputs, outputs, and parameters that are declared <rfc2119>may</rfc2119> be
specified. Outputs and optional parameters do not have to be
specified.</para>

<para>Each input and output is declared to accept or produce either a single
document or a sequence of documents. It is not a static error to connect a port
that is declared to produce a sequence of documents to a port that is declared to
accept only a single
document. It is, however, a dynamic error if the former &stage; actually
produces more than a single document at run time.</para>

<para>&Atoms; <rfc2119>may</rfc2119> also produce error, warning, and informative
messages. These messages appear on a special “error output” that is available
in the catch clause of a <link linkend="c.try">try/catch</link>.</para>
</section>

<section xml:id="parameters">
<title>Parameters</title>

<para><termdef xml:id="dt-parameter">A <glossterm>parameter</glossterm> is
a QName/value pair.</termdef> The value of a parameter must be a string.
If a document, node, or other value is given, its (XPath 1.0) string value
is computed and that string is used.
</para>
</section>

<section xml:id="connections">
<title>Connections</title>

<para>&Stages; are connected together by their inputs and outputs.
<termdef xml:id="dt-connected">&Stages; A and B are
<glossterm>connected</glossterm> if they are either
directly or indirectly connected.  &Stage; A is directly
connected to B if an output of A is associated with an input
port of B.  &Stage; A is indirectly connected to B if there
is a chain of directly connected &stages; that allows
traversal from A to B.</termdef></para>

<para>With respect to <glossterm>connected</glossterm> &stages;, we
can speak of one &stage; being either before or after another.
<termdef xml:id="dt-before">&Stage; A is <glossterm>before</glossterm>
&stage; B if &stage; B is a <glossterm baseform="contained components">contained &stage;</glossterm> of &stage; A, either
directly or indirectly, or if any output from &stage; A is connected
to any input of &stage; B, either directly or indirectly.</termdef>
<termdef xml:id="dt-after">&Stage; A is <glossterm>after</glossterm>
&stage; B if &stage; B is the <glossterm>container</glossterm>
for &stage; A (or an ancestor of such a container) or if any output from &stage; B
is connected to any input of &stage; A, either directly or indirectly.</termdef></para>

<para>It is a <glossterm>static error</glossterm> if a &stage; is either before
or after itself.</para>
</section>
</section>

<section xml:id="langconstructs">
<title>Language Constructs</title>

<para>This section describes the core language constructs of XProc.
</para>

<para>Every &stage; in a pipeline has five parts: a set of inputs, a
set of outputs, a set of parameters, a set of <glossterm>contained
&stages;</glossterm>, and a context inherited from its container.
<termdef xml:id="dt-context">The <glossterm>context</glossterm> is the
the set of input ports, output ports, and parameter
names that are visible.</termdef></para>

<section xml:id="c.pipeline">
<title>Pipeline</title>

<para>A [[pipeline]] encapsulates the behavior of a
<glossterm>subpipeline</glossterm>.</para>

<variablelist>
<varlistentry>
<term>Inputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Outputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Parameters</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Contained &stages;</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
</variablelist>

<para>The context of a [[pipeline]] is its inherited context modified
as follows:</para>

<itemizedlist>
<listitem>
<para>All of the <glossterm>declared inputs</glossterm> of the [[pipeline]] are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<listitem>
<para>The union of all the declared outputs of the
<glossterm>contained &stages;</glossterm> are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<!--
<listitem>
<para>All of the declared outputs of the [[pipeline]] are added to the
<emphasis>inputs</emphasis> in the context.</para>
</listitem>
-->
<listitem>
<para>All of the declared parameters of the [[pipeline]] are added to the
<emphasis>parameters</emphasis> in the context.</para>
</listitem>
</itemizedlist>

<para>This is the context used by the [[pipeline]] and inherted by its
<glossterm>contained &stages;</glossterm>.
</para>

<para>Viewed from the outside, a [[pipeline]] is a
black box which performs some calculation on its inputs and produces
its outputs. From the pipeline author's perspective, the computation
performed by the pipeline is described in terms of <glossterm>contained
&stages;</glossterm> which read the pipeline's inputs and produce
the pipeline's outputs.</para>

<para>For example, a pipeline might accept a document and a stylesheet
as input; perform XInclude, validation, and transformation;
and produce a sequence of formatted documents as its
output.</para>

<para>There is one additional constraint imposed on pipelines:
a pipeline <rfc2119>must not</rfc2119> itself be
a <glossterm baseform="contained &stages;">contained &stage;</glossterm>.
</para>
</section>

<section xml:id="c.for-each">
<title>For-Each</title>

<para>A [[for-each]] &construct; processes a sequence of documents,
applying its <glossterm>subpipeline</glossterm> to each document in
turn.</para>

<variablelist>
<varlistentry>
<term>Inputs</term>
<listitem><para>Exactly one, <emphasis>as declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Outputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Parameters</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Contained &stages;</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
</variablelist>

<para>The context of a [[for-each]] is its inherited context modified
as follows:</para>

<itemizedlist>
<listitem>
<para>All of the <glossterm>declared inputs</glossterm> of the [[for-each]] are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<listitem>
<para>The union of all the declared outputs of the
<glossterm>contained &stages;</glossterm> are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<!--
<listitem>
<para>All of the declared outputs of the [[pipeline]] are added to the
<emphasis>inputs</emphasis> in the context.</para>
</listitem>
-->
<listitem>
<para>All of the declared parameters of the [[for-each]] are added to the
<emphasis>parameters</emphasis> in the context.</para>
</listitem>
</itemizedlist>

<para>This is the context used by the [[for-each]] and inherted by its
<glossterm>contained &stages;</glossterm>.
</para>

<para>The [[for-each]] construct can be used in cases where a &stage;
requires a single document input but a pipeline needs to process a
sequence of documents with that &stage;.</para>

<para>The result of the [[for-each]] is a sequence of documents
produced by processing each individual document in the input sequence.
If the subpipeline is connected to one or more output ports on
the [[for-each]], what appears on each of those ports is the sequence
of documents produced by each iteration of the loop.</para>

<para>For example, a [[for-each]] might accept a sequence of DocBook
chapters as its input, process each chapter in turn with XSLT, and
produce a sequence of formatted chapters as its output.</para>
</section>

<section xml:id="c.viewport">
<title>Viewport</title>

<para>A [[viewport]] &construct; processes a single document, applying
its <glossterm>subpipeline</glossterm> to one or more subsections of the document.
</para>

<variablelist>
<varlistentry>
<term>Inputs</term>
<listitem><para>Exactly one, <emphasis>as declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Outputs</term>
<listitem><para>Exactly one, <emphasis>as declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Parameters</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Contained &stages;</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
</variablelist>

<para>The context of a [[viewport]] is its inherited context modified
as follows:</para>

<itemizedlist>
<listitem>
<para>All of the <glossterm>declared inputs</glossterm> of the [[viewport]] are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<listitem>
<para>The union of all the declared outputs of the
<glossterm>contained &stages;</glossterm> are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<!--
<listitem>
<para>All of the declared outputs of the [[pipeline]] are added to the
<emphasis>inputs</emphasis> in the context.</para>
</listitem>
-->
<listitem>
<para>All of the declared parameters of the [[viewport]] are added to the
<emphasis>parameters</emphasis> in the context.</para>
</listitem>
</itemizedlist>

<para>This is the context used by the [[viewport]] and inherted by its
<glossterm>contained &stages;</glossterm>.
</para>

<para>The
result of the [[viewport]] is a copy of the original document with the
selected subsections replaced by the results of applying the
subpipeline
to them.</para>

<para>For example, a [[viewport]] might accept an XHTML document as its
input, apply encryption to selected <tag>div</tag> elements within
that document, and return an XHTML document that is the same as the
original except that each selected <tag>div</tag> has been replaced by
its encrypted result.</para>
</section>

<section xml:id="c.choose">
<title>Choose</title>

<para>A [[choose]] &construct; selects exactly one of a list of
alternative <glossterm baseform="subpipeline">subpipelines</glossterm>
based on the evaluation of XPath expressions.</para>

<variablelist>
<varlistentry>
<term>Inputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Outputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Parameters</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Contained &stages;</term>
<listitem><para><emphasis>As declared.</emphasis> A [[choose]]
&construct; contains several alternate subpipelines, exactly one
of which will be evaluated.</para></listitem>
</varlistentry>
</variablelist>

<para>The context of a [[choose]] is its inherited context modified as
follows:</para>

<itemizedlist>
<listitem>
<para>All of the <glossterm>declared inputs</glossterm> of the [[choose]] are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<listitem>
<para>The declared outputs of (any one of) the subpipelines
are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<!--
<listitem>
<para>All of the declared outputs of the [[pipeline]] are added to the
<emphasis>inputs</emphasis> in the context.</para>
</listitem>
-->
<listitem>
<para>All of the declared parameters of the [[choose]] are added to the
<emphasis>parameters</emphasis> in the context.</para>
</listitem>
</itemizedlist>

<para>This is the context used by the [[choose]] and inherted by its
subpipelines.</para>

<para>The list of alternative subpipelines consists of zero or more
subpipelines, each guarded by an XPath expression (with an associated context
document), followed optionally by a
single default subpipeline.</para>

<para>The [[choose]] considers each subpipeline in turn and selects
the first (and only the first) subpipeline for which the guard
expression evaluates to true in the context of its context document.
If there are no subpipelines for which the expression evaluates to
true, the default subpipeline, if it was specified, is
selected.</para>

<para>After a <glossterm>subpipeline</glossterm> is selected, it is
evaluated as if only it had been present.</para>

<para>The context of the <glossterm>contained &stages;</glossterm> in
the selected subpipeline is the context of the [[choose]] with the union of
all the declared outputs of the <glossterm>contained &stages;</glossterm>
of the selected subpipeline added to the <emphasis>outputs</emphasis>
in the context.</para>

<para>The result of the [[choose]]
is the result of the selected <glossterm>subpipeline</glossterm>.</para>

<para>For example, a [[choose]] might test a schema and apply XML
Schema validation to an input document if the schema is an XML Schema
document, apply RELAX NG validation if the schema is a RELAX NG
grammar, or perform no validation otherwise.</para>

<para>In order to ensure that the result of the [[choose]] is
consistent irrespective of the <glossterm>subpipeline</glossterm> chosen, each <glossterm>subpipeline</glossterm> must
declare the same number of outputs with the same names. It is a 
<glossterm>static error</glossterm> if two <glossterm>subpipeline</glossterm> in a [[choose]]
declare different outputs.</para>

<para>It is a <glossterm>dynamic error</glossterm> if no <glossterm>subpipeline</glossterm>
is selected by the [[choose]] and no default is provided.</para>
</section>

<section xml:id="c.group">
<title>Group</title>

<para>A [[group]] &construct; encapsulates the behavior of
its <glossterm>subpipeline</glossterm>.</para>

<variablelist>
<varlistentry>
<term>Inputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Outputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Parameters</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Contained &stages;</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
</variablelist>

<para>The context of a [[group]] is its inherited context modified
as follows:</para>

<itemizedlist>
<listitem>
<para>All of the <glossterm>declared inputs</glossterm> of the [[group]] are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<listitem>
<para>The union of all the declared outputs of the
<glossterm>contained &stages;</glossterm> are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<!--
<listitem>
<para>All of the declared outputs of the [[pipeline]] are added to the
<emphasis>inputs</emphasis> in the context.</para>
</listitem>
-->
<listitem>
<para>All of the declared parameters of the [[group]] are added to the
<emphasis>parameters</emphasis> in the context.</para>
</listitem>
</itemizedlist>

<para>This is the context used by the [[group]] and inherted by its
<glossterm>contained &stages;</glossterm>.
</para>

<para>A [[group]] is a convenience wrapper for a collection of &stages;
and can be used to perform parameter renaming to aid in reuse of sets
of &stages;.</para>
</section>

<section xml:id="c.try">
<title>Try/Catch</title>

<para>A [[try]] &construct; isolates a
<glossterm>subpipeline</glossterm>, preventing any errors that arise
within it from being exposed to the rest of the pipeline.</para>

<variablelist>
<varlistentry>
<term>Inputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Outputs</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Parameters</term>
<listitem><para><emphasis>As declared.</emphasis></para></listitem>
</varlistentry>
<varlistentry>
<term>Contained &stages;</term>
<listitem><para><emphasis>As declared.</emphasis> A [[try]] contains
two subpipelines, one or both of which will be evaulated.</para></listitem>
</varlistentry>
</variablelist>

<para>A [[try]] &construct; contains two subpipelines: an initial
subpipeline and a recovery (or “catch”) subpipeline.</para>

<para>The initial context of a [[try]] is its inherited context modified
as follows:</para>

<itemizedlist>
<listitem>
<para>All of the <glossterm>declared inputs</glossterm> of the [[try]] are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<listitem>
<para>The union of all the declared outputs of the
<glossterm>contained &stages;</glossterm> in the initial pipeline are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<!--
<listitem>
<para>All of the declared outputs of the [[pipeline]] are added to the
<emphasis>inputs</emphasis> in the context.</para>
</listitem>
-->
<listitem>
<para>All of the declared parameters of the [[try]] are added to the
<emphasis>parameters</emphasis> in the context.</para>
</listitem>
</itemizedlist>

<para>This is the context used by the [[try]] and inherted by the
<glossterm>contained &stages;</glossterm> in its initial pipeline.
</para>

<note role="editorial" xml:id="specify-errors">
<para>In the context of try/catch, “errors” refers to component failure which
is not the same as a static or dynamic error in the pipeline itself. (Though perhaps
it will be possible to recover from some dynamic errors.) The notion of component
failure as a distinct class of error needs to be described.</para>
</note>

<para>The [[try]] &construct;
evaluates the initial subpipeline and, if no errors occur, the results of that
pipeline are the results of the &construct;. However, if any errors
occur, it abandons the first subpipeline, discarding any output that
it might have generated, and evaluates the recovery subpipeline.</para>

<para>In this case, it must recompute the context inherited by the
<glossterm>contained &stages;</glossterm> in the recovery pipeline.
The context of the recovery subpipeline is the inherited context of the [[try]]
modified as follows:</para>

<itemizedlist>
<listitem>
<para>All of the <glossterm>declared inputs</glossterm> of the [[try]] are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<listitem>
<para>The union of all the declared outputs of the
<glossterm>contained &stages;</glossterm> in the recovery pipeline are added to the
<emphasis>outputs</emphasis> in the context.</para>
</listitem>
<!--
<listitem>
<para>All of the declared outputs of the [[pipeline]] are added to the
<emphasis>inputs</emphasis> in the context.</para>
</listitem>
-->
<listitem>
<para>All of the declared parameters of the [[try]] are added to the
<emphasis>parameters</emphasis> in the context.</para>
</listitem>
</itemizedlist>

<para>This is the context inherted by the
<glossterm>contained &stages;</glossterm> in the recovery pipeline.
</para>

<para>The results of the recovery subpipeline are the results of the
[[try]] &construct;. If the recovery subpipeline is evaluated and a component within
that subpipeline fails, the [[try]] fails.</para>

<para>For example, a pipeline might attempt to process a document by
dispatching it to some web service. If the web service succeeds, then
those results are passed to the rest of the pipeline. However, if the
web service cannot be contacted or reports an error, the [[catch]]
&construct; can provide some sort of default for the rest of the
pipeline.</para>

<para>In order to ensure that the result of the [[try]] is consistent
irrespective of whether the initial subpipeline provides its output or
the recovery subpipeline does, both subpipelines must declare the same
number of outputs with the same names. It is a <glossterm>static
error</glossterm> if the two subpipelines declare different
outputs.</para>

<para>In order to support corrective action in the recovery
subpipeline, &stages; inside it have access to all the
error output of the &stages; that were in the initial
subpipeline on a special port named “<literal>#error</literal>”.</para>

<note>
<para>In evaluating the initial subpipeline, failure of one &stage;
can cause other &stages; to fail. In addition, some &stages; that
fail might not produce output on their error ports and some &stages;
that succeeded might produce such output. This pipeline language places
no constraints on the order of error messages provided to the
recovery subpipeline, nor does it attempt to guarantee that such
output will be available in all cases.</para>
</note>

<para>The error documents that appear <rfc2119>should</rfc2119> conform to 
<xref linkend="err-vocab"/>.
</para>
</section>

<section xml:id="c.declarecomponent">
<title>Other &Atoms;</title>

<para>A pipeline document <rfc2119>may</rfc2119> declare additional &atoms;. These can
be implementation-defined &atoms; or can be defined through some
implementation-dependent extension mechanism. Each declared &atom;
must have a name and a <glossterm>signature</glossterm>. It is a <glossterm>static
error</glossterm> if a pipeline contains an &atom; that is not
recognized by the processor.</para>
</section>
</section>

<section xml:id="syntax">
<title>Syntax</title>

<para>This section describes a set of XML syntactic elements sufficient to
represent all the aspects of a pipeline, as set out in the preceding sections.
</para>

<section xml:id="syntax-overview">
<title>Overview</title>

<para>Elements in a pipeline document represent the pipeline,
the &stages; it contains, the connections between those &stages;, the &stages;
and connections contained within them, and so on. Each &stage; is represented
by an element; a combination of elements and attributes specify
how the inputs and outputs of each &stage; are connected and how parameters
are passed.</para>

<para>Conceptually, we can speak of &stages; as objects that have
inputs and outputs that are connected together and which may have
contain additional &stages;. Syntactically, we need a mechanism
for specifying these relationships.</para>

<para><glossterm baseform="container">Containment</glossterm> is
represented naturally using nesting of XML elements. The connections
between components are expressed using names and references to those
names.</para>

<para>Five kinds of things are named in XProc:</para>

<orderedlist>
<listitem>
<para>The types of &stages;,</para>
</listitem>
<listitem>
<para>The &stages; themselves,</para>
</listitem>
<listitem>
<para>Input ports,</para>
</listitem>
<listitem>
<para>Output ports, and</para>
</listitem>
<listitem>
<para>Parameters</para>
</listitem>
</orderedlist>

<section xml:id="scoping">
<title>Scoping of Names</title>

<para>The scope of the names of &stage; types is the pipeline. Each pipeline
processor has some number of built in &stage; type and each pipelines may declare
(directly, or by reference to an external library) additional &stage; types.
</para>

<para>The scope of the names of the &stages; themselves is determined
by the <glossterm>context</glossterm> of each &stage;. In general,
the name of a &stage;, the names of its sibling &stages;, the
names of any &stages; that it contains directly, the names of its
ancestors; and the names of its ancestor's siblings are all in the same scope.
It is a <glossterm>static error</glossterm> if two &stages; with the same
name appear in the same scope. All in-scope &stages; <rfc2119>must</rfc2119>
have unique names.</para>

<para>The scope of an input or output port name is the &stage; on
which it is defined. The names of all the ports on any &stage;
<rfc2119>must</rfc2119> be unique.</para>

<para>Taken together, these uniqueness constraints guarantee that the
combination of a &stage; name and a port name uniquely identifies
exactly one in-scope port.</para>

<para>The scope of parameter names is essentially the same as the
scope of &stage; names, with the following caveat. Whereas &stage;
names must be unique, parameter names may be repeated. The declaration
of a parameter on a &stage; shadows any declaration that may already
be in-scope.</para>

</section>

<section xml:id="syntax-docs-ports">
<title>Associating Documents with Ports</title>

<para>A document or a sequence of documents can be bound to a port
in three ways: by source, by URI, or by providing it “here”, as the content of
the element establishing the binding. A document must be specified in
exactly one of these ways, otherwise a <glossterm>static error</glossterm> is
raised.</para>

<variablelist>
<varlistentry>
<term>Specified by URI</term>
<listitem>
<para><termdef xml:id="dt-input-uri">A document is specified
<glossterm>by URI</glossterm>
if it refers to it with a URI.</termdef> The
<tag class="attribute">href</tag> attribute is used for this purpose.</para>

<para>In this example, the input to the Identity &atom; named
“<literal>otherstep</literal>” comes from “<uri>http://example.com/input.xml</uri>”.
</para>

<programlisting><![CDATA[<p:step name="otherstep" ]]>&kind;<![CDATA[="p:identity">
  <p:input port="document" href="http://example.com/input.xml"/>
</p:step>]]></programlisting>

<para>It is a <glossterm>dynamic error</glossterm> if the processor
attempts to retrieve the specified URI and fails. (For example, if the
resource does not exist or is not accessible with the user's
authentication credentials.)</para>
</listitem>
</varlistentry>

<varlistentry>
<term>Specified by source</term>
<listitem>
<para><termdef xml:id="dt-input-source">A document is specified
<glossterm>by source</glossterm>
if it refers to a specific port on another &stage;.</termdef> The
<tag class="attribute">step</tag> and
<tag class="attribute">source</tag> attributes are used for this purpose.
(The <tag class="attribute">step</tag> attribute may refer
to any kind of &stage;, either &atom; <emphasis>or</emphasis>
&construct;, its name notwithstanding.)</para>

<para>There are constraints on what ports can be specified:
the specified port must be in the output ports of the component's context.
</para>

<para>In this example, the “<literal>document</literal>” input to the XInclude &atom; named
“<literal>expand</literal>” comes from the “<literal>result</literal>”
port of the step named “<literal>otherstep</literal>”.</para>

<programlisting><![CDATA[<p:step name="expand" ]]>&kind;<![CDATA[="p:xinclude">
  <p:input port="document" step="otherstep" source="result"/>
</p:step>]]></programlisting>

<para>It is a <glossterm>static error</glossterm> if the specified port
does not exist.</para>

</listitem>
</varlistentry>

<varlistentry>
<term>Specified by here document</term>
<listitem>
<para><termdef xml:id="dt-input-here">An document is specified by
<glossterm>here document</glossterm>
if it is contained in the body of the element that binds it.</termdef></para>

<para>In this example, the “<literal>stylesheet</literal>” input to the XSLT &atom; named
“<literal>xform</literal>” comes from the content of the
<tag>p:input</tag> element itself.</para>

<programlisting><![CDATA[<p:step name="xform" ]]>&kind;<![CDATA[="p:xslt">
  <p:input port="document" step="expand" source="result"/>
  <p:input port="stylesheet">
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    version="1.0">
      ...
    </xsl:stylesheet>
  </p:input>
</p:step>]]></programlisting>

<para>Here documents are considered “quoted”, they are not
interpolated or available to the pipeline processor in any way except
as documents flowing through the pipeline.</para>
</listitem>
</varlistentry>
</variablelist>
</section>

<section xml:id="extension-attributes">
<title>Extension attributes</title>

<para><termdef xml:id="dt-extension-attribute">An element from the
XProc namespace <rfc2119>may</rfc2119> have any attribute not from the
XProc namespace, provided that the expanded-QName of the attribute has
a non-null namespace URI. These attributes are called
<glossterm>extension attributes</glossterm>.</termdef> The presence of
an extension attribute must not cause the connections between &stages;
to differ from the connections that any other
conformant XProc processor would produce. They must not cause the
processor to fail to signal an error that a conformant processor is
required to signal. This means that an extension attribute must not
change the effect of any XProc element except to the extent that the
effect is implementation-defined or implementation-dependent.</para>

<para>A processor which encounters an extension attribute that it does not
recognize <rfc2119>must</rfc2119> behave as if the attribute was not present.</para>

</section>

<section xml:id="extension-elements">
<title>Extension elements</title>

<para><termdef xml:id="dt-extension-element">Outside the context of a
<quote>here document</quote>, any element not in the XProc namespace
is an <glossterm>extension element</glossterm>.</termdef>
The presence of an extension element must not cause the connections
between &stages; to differ from the connections that any other
conformant XProc processor would produce.
They must not cause the processor to fail to signal an error that a
conformant processor is required to signal. This means that an
extension element must not change the effect of any XProc element
except to the extent that the effect is implementation-defined or
implementation-dependent.</para>

<para>Inside the context of a 
<glossterm linkend="dt-input-here">here document</glossterm>, all content is
considered quoted so neither extension elements nor XProc elements are said to
occur.</para>

<para>A processor which encounters an extension element that it does not
recognize <rfc2119>must</rfc2119> behave as if neither the element nor its
attributes, nor any of its content was present.</para>
</section>
</section>

<section xml:id="vocabulary">
<title>Detailed Vocabulary</title>

<para>This section describes in detail the XML vocabulary that represents a pipeline.</para>

<!-- ============================================================ -->

<section xml:id="p.pipeline">
<title>p:pipeline Element</title>

<para>A <tag>p:pipeline</tag> represents a [[pipeline]]. Its children declare
the inputs, outputs, and parameters that the pipeline exposes and
represent its <glossterm>subpipeline</glossterm>.</para>

<e:element-syntax name="pipeline">
  <e:in-category name="language-construct"/>
  <e:attribute name="name">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="input" repeat="zero-or-more"/>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:element name="import" repeat="zero-or-more"/>
    <e:element name="declare-&atom;-type" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>If specified, the <tag class="attribute">name</tag> must be
unique across all available pipelines. If a <tag>p:pipeline</tag>
occurs as the child of a <tag>p:pipeline-library</tag> element, it must
be named.</para>

<para>A pipeline can declare additional &atoms; (e.g., ones that are provided
by a particular implementation or in some implementation-defined way) and import
&atoms; from libraries.</para>

<example xml:id="ex.p.pipeline">
<title>A Sample Pipeline Document</title>
<programlisting><![CDATA[<p:pipeline name="buildspec">
  <p:input port="document"/>
  <p:input port="stylesheet"/>
  <p:output port="result"/>
  <p:parameter name="validate"/>
  …
</p:pipeline>]]></programlisting>
</example>

</section>

<!-- ============================================================ -->

<section xml:id="p.input">
<title>p:input Element</title>

<para>A <tag>p:input</tag> identifies input for a &stage;, optionally
declaring it, if necessary.</para>

<e:element-syntax name="input">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>The <tag class="attribute">port</tag> attribute defines the name
of the port. It is a <glossterm>static error</glossterm> to identify
two ports with the same name on the same &stage;.
On atomic &stages;, it is a <glossterm>static error</glossterm>
if the <tag class="attribute">port</tag> given does not match the name
of an input port specified in the component's declaration.</para>

<para>On language &constructs; and declare-&atom;-type, an input
declaration can indicate if a sequence of documents is allowed to
appear on the port. If <tag class="attribute">sequence</tag>
is specified with the value “yes”, then a sequence is allowed. If the
<tag class="attribute">sequence</tag> is not specified, or has the
value “no”, then it is a <glossterm>dynamic error</glossterm> for a
sequence of more than one document to appear on the declared
port.</para>

<para>The declaration <rfc2119>may</rfc2119> be accompanied by a
binding (or default binding) for the input. This binding can be
accomplished
<glossterm linkend="dt-input-source">by source</glossterm>:</para>

<e:element-syntax name="input">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="step" required="yes">
    <e:data-type name="step name"/>
  </e:attribute>
  <e:attribute name="source" required="yes">
    <e:data-type name="port name"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="xpath expression"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para><glossterm linkend="dt-input-uri">by URI</glossterm>:</para>

<e:element-syntax name="input">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="href" required="yes">
    <e:data-type name="URI"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="xpath expression"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>or by
<glossterm linkend="dt-input-here">here document</glossterm>:</para>

<e:element-syntax name="input">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="xpath expression"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:model name="here document"/>
</e:element-syntax>

<!--<para>If a 
<glossterm linkend="dt-input-source">by source</glossterm> binding is
used, the port selected must be an output port on a step which is not a
descendant of
the step on which the <tag>p:input</tag> appears or it must be
a port declared with <tag>p:input</tag> on some ancestor (e.g.,
an enclosing <tag>p:choose</tag> or <tag>p:for-each</tag>) of the
step.</para>-->

<para>If a binding is provided, a <tag class="attribute">select</tag> expression
<rfc2119>may</rfc2119> also be provided.
If provided, the
specified XPath select expression is used to filter the document(s) that are read.
Each matching node or set of nodes is wrapped in a document and
provided to the input port.</para>

<para>It is a <glossterm>static error</glossterm> if more than one of
<tag class="attribute">source</tag>,
<tag class="attribute">uri</tag> or here document is
specified.</para>

<para>The <tag class="attribute">select</tag> expression, if specified,
applies the specified XPath select expression to the document(s) that are
read. Each matching node or set of nodes is wrapped in a document and provided
to the input port. In other words,</para>

<programlisting><![CDATA[<p:input port="document" href="http://example.org/input.html"/>]]></programlisting>

<para>provides a single document, but</para>

<programlisting><![CDATA[<p:input port="document" href="http://example.org/input.html" select="//html:div"/>]]></programlisting>

<para>provides a sequence of zero or more documents, one for each matching
<code>html:div</code> in <uri>http://example.org/input.html</uri>.</para>

<programlisting><![CDATA[<p:input port="document" step="origin" source="portname" select="//html:div"/>]]></programlisting>

<para>provides a sequence of zero or more documents, one for each matching
<code>html:div</code> in the document (or each of the documents)
that is read from the <literal>portname</literal>
port of the &stage; named <literal>origin</literal>.</para>

</section>

<!-- ============================================================ -->

<section xml:id="p.output">
<title>p:output Element</title>

<para>A <tag>p:output</tag> identifies an output port, optionally
declaring it, if necessary.</para>

<e:element-syntax name="output">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>The <tag class="attribute">port</tag> attribute defines the name
of the port. It is a <glossterm>static error</glossterm> to identify
two ports with the same name on the same &stage;.</para>

<para>An output declaration can indicate if a sequence of documents is
allowed to appear on the declared port. If
<tag class="attribute">sequence</tag> is specified with the value “yes”,
then a sequence is allowed. If the
<tag class="attribute">sequence</tag> is not specified, or has the value
“no”, then it is a <glossterm>dynamic error</glossterm> if the component
produces a sequence of more than one document on the declared port.</para>

<para>On a &construct;, the declaration <rfc2119>must</rfc2119> be accompanied by a
binding for the output. This binding can be accomplished
<glossterm linkend="dt-input-source">by source</glossterm>:</para>

<e:element-syntax name="output">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="step" required="yes">
    <e:data-type name="step name"/>
  </e:attribute>
  <e:attribute name="source" required="yes">
    <e:data-type name="port name"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para><glossterm linkend="dt-input-uri">by URI</glossterm>:</para>

<e:element-syntax name="output">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="href" required="yes">
    <e:data-type name="URI"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>or by
<glossterm linkend="dt-input-here">here document</glossterm>:</para>

<e:element-syntax name="output">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="sequence">
    <e:data-type name="yes|no"/>
  </e:attribute>
  <e:model name="here document"/>
</e:element-syntax>

<para>
<!--If a 
<glossterm linkend="dt-input-source">by source</glossterm> binding is
used, the port selected must be an output port on an step which is a descendant
of the step on which the <tag>p:output</tag> appears.-->
It is a <glossterm>static error</glossterm> if more than one binding
is specified.
</para>
</section>

<!-- ============================================================ -->

<section xml:id="p.parameter">
<title>p:parameter Element</title>

<para>The <tag>p:parameter</tag> element is used both to declare
parameters and to establish values for them. When used on a
<tag>p:declare-&atom;-type</tag> or language &construct;,
<tag>p:parameter</tag> declares the parameter and may associate a
default value with it. Used elsewhere, <tag>p:parameter</tag>
associates a value with the parameter.</para>

<section xml:id="parameter-declaration">
<title>Declaring Parameters</title>

<para>Parameters are declared on <tag>p:declare-&atom;-type</tag> and
language &constructs; with <tag>p:parameter</tag>:</para>

<e:element-syntax name="parameter">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="token"/>
  </e:attribute>
  <e:attribute name="required">
    <e:data-type name="yes | no"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>The <tag class="attribute">name</tag> attribute must be a
QName, a single asterisk (<literal>*</literal>), or a string of the form
<literal>*:<replaceable>NCName</replaceable></literal> or
<literal><replaceable>NCName</replaceable>:*</literal>.</para>

<para>If the <tag class="attribute">name</tag> is a QName, the parameter
may be declared as <tag class="attribute">required</tag> or it may
be
<link linkend="parameter-values">given a default value</link>.
It is a <glossterm>static error</glossterm> to specify
that the parameter is <tag class="attribute">required</tag> or that it has
a default value if the <tag class="attribute">name</tag> given is not
a QName. It is also a <glossterm>static error</glossterm> to specify
that the parameter is both <tag class="attribute">required</tag>
<emphasis>and</emphasis> has a default value.</para>

<para>If a parameter is required, it is a <glossterm>static
error</glossterm> to invoke the &stage; without specifying a value for
that parameter.</para>
</section>

<section xml:id="parameter-use">
<title>Using Parameters</title>

<para>Parameters are used on <tag>p:step</tag> elements with
<tag>p:parameter</tag>:</para>

<e:element-syntax name="parameter">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>The parameter <rfc2119>must</rfc2119> be
<link linkend="parameter-values">given a value</link> when it is used.
</para>
</section>

<section xml:id="parameter-values">
<title>Assigning Values to Parameters</title>

<para>When a parameter is declared, it can be given a default value.
When it is used, it <rfc2119>must</rfc2119> be given a value. That
value can be specified in several ways,
<glossterm linkend="dt-input-source">by source</glossterm>:</para>

<e:element-syntax name="parameter">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="step" required="yes">
    <e:data-type name="step name"/>
  </e:attribute>
  <e:attribute name="source" required="yes">
    <e:data-type name="port name"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="XPath expression"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para><glossterm linkend="dt-input-uri">by URI</glossterm>:</para>

<e:element-syntax name="parameter">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="href" required="yes">
    <e:data-type name="URI"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="XPath expression"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>or by
<glossterm linkend="dt-input-here">here document</glossterm>:</para>

<e:element-syntax name="parameter">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="XPath expression"/>
  </e:attribute>
  <e:model name="here document"/>
</e:element-syntax>

<note role="editorial" xml:id="parameter-here-documents">
<para>Is there really any value in allowing here documents on parameters?
Doing so means that an empty parameter is always associated with an empty
here document, which in turn makes it impossible to detect some kinds of
errors statically. Might it not be better to disallow here documents and add
a rule that any reference to the context is an error if a document is not
explicitly provided?</para>
</note>

<para>If a <tag class="attribute">select</tag> expression is given, it is evaluated
against the document specified and the (XPath 1.0) <emphasis>string value</emphasis>
of the expression becomes the default value of the parameter. If no
<tag class="attribute">select</tag> expression is given, the
 (XPath 1.0) <emphasis>string value</emphasis> of the document becomes the
default value of the parameter. It is a <glossterm>dynamic error</glossterm> if
a document sequence is specified.</para>

<para>The select expression may refer to the values of other in-scope parameters
by variable reference. It is a <glossterm>static error</glossterm> if the variable
reference uses a QName that is not the name of an in-scope parameter or if the
reference is circular, either directly or indirectly.</para>

<para>The default value may also be specified with the
<tag class="attribute">value</tag> attribute:</para>

<e:element-syntax name="parameter">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="value" required="yes">
    <e:data-type name="string"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>In this case, the default value of the parameter is the string
specified in the <tag class="attribute">value</tag> attribute.</para>
</section>
</section>

<!-- ============================================================ -->

<section xml:id="p.step">
<title>p:step Element</title>

<para>A <tag>p:step</tag> represents an &atom; in a pipeline.</para>

<e:element-syntax name="step">
  <e:in-category name="language-construct"/>
  <e:attribute name="&kind;" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:attribute name="name" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="input" repeat="zero-or-more"/>
    <e:element name="import-parameter" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
  </e:sequence>
</e:element-syntax>

<para>The <tag class="attribute">&kind;</tag> attribute identifies the
component to be instantiated. It is a <glossterm>static error</glossterm> if
the <tag class="attribute">name</tag> is not unique in the current scope, if the
specified <tag class="attribute">&kind;</tag>
is not known to the processor, or if the specified
inputs, outputs, and parameters do not
<glossterm baseform="matches">match</glossterm> the
<glossterm>signature</glossterm> for &atoms; of that &kind;.</para> 
</section>

<!-- ============================================================ -->

<section xml:id="p.import-parameter">
<title>p:import-parameter Element</title>

<para>An <tag>p:import-parameter</tag> provides a set of in-scope parameters
to a &stage;.</para>

<e:element-syntax name="import-parameter">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="token"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>All in-scope parameters which match the <tag class="attribute">name</tag>
are made available to the &stage; as if they had been specified with
individual <tag>p:parameter</tag> elements.</para>

<para>The <tag class="attribute">name</tag> attribute must be a single
asterisk (<literal>*</literal>), a QName, or a string of the form
<literal>*:<replaceable>NCName</replaceable></literal> or
<literal><replaceable>NCName</replaceable>:*</literal>.</para>
</section>

<!-- ============================================================ -->

<section xml:id="p.for-each">
<title>p:for-each Element</title>

<para>A <tag>p:for-each</tag> represents a [[for-each]].</para>

<e:element-syntax name="for-each">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="input"/>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>Exactly one input must be declared and it must include a binding
for the port it declares. If outputs are declared, they must also
include a binding.</para>

<para>The processor will provide each document read
through the input binding to the <glossterm>subpipeline</glossterm>
represented by the children of the <tag>p:for-each</tag>, one at a
time. For each declared output, the processor will collect all the
documents that are produced for that output from all the iterations,
in order, into a sequence. The result of the <tag>p:for-each</tag> is
that set of document sequences.</para>

<para><xref linkend="ex.p.for-each"/> shows an example of a <tag>p:for-each</tag>
in action.</para>

<example xml:id="ex.p.for-each">
<title>A Sample For-Each</title>
<programlisting><![CDATA[<p:for-each name="chapters">
  <p:input port="chap" href="http://example.org/docbook.xml" select="//chapter"/>
  <p:output port="html" step="xform-to-html source="result"/>
  <p:output port="fo" step="xform-to-fo" source="result"/>
  <p:step name="xform-to-fo" ]]>&kind;<![CDATA[="p:xslt">
    <p:input name="document" step="chapters" source="chap"/>
    <p:input name="stylesheet" href="fo/docbook.xsl"/>
  </p:step>
  <p:step name="xform-to-html" ]]>&kind;<![CDATA[="p:xslt">
    <p:input name="document" step="chapters" source="chap"/>
    <p:input name="stylesheet" href="html/docbook.xsl"/>
  </p:step>
</p:for-each>]]></programlisting>
</example>

<para>The <code>//chapter</code>s of the DocBook document are
selected. Each chapter is transformed into HTML and XSL FO using an
XSLT &atom;. The resulting HTML and FO documents are aggregated together
and appear on the <literal>html</literal> and <literal>fo</literal>
ports, respectively, of the <literal>chapters</literal> &construct; itself.</para>

<para>It is a <glossterm>static error</glossterm> if there is not exactly one
<tag>p:input</tag> child of <tag>p:for-each</tag> or if the declared
input does not specify a binding<!--, or if it specifies a binding to a step inside
the <tag>p:for-each</tag>-->.</para>

<para>It is a <glossterm>static error</glossterm> if any declared output
does not specify a binding.</para>
</section>

<section xml:id="p.viewport">
<title>p:viewport Element</title>

<para>A <tag>p:viewport</tag> represents a [[viewport]].</para>

<e:element-syntax name="viewport">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="input"/>
    <e:element name="output"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>Exactly one input must be declared and it must include both a
binding and a <tag class="attribute">select</tag> expression. Exactly
one output must be declared and it must include a binding. The
processor will provide a document that contains each set of nodes that
matches the specified select expression through the input binding to
the <glossterm>subpipeline</glossterm> represented by the children of the <tag>p:viewport</tag>, one at a
time. What appears on the output from the <tag>p:viewport</tag> will
be a copy of the input document except that where each matching node
or set of nodes appears, the result of applying the subpipeline to
those nodes will be output.</para>

<para>It is a <glossterm>dynamic error</glossterm> if the input source is
a sequence of more than one document or if the output from any iteration
is a sequence of more than one document.</para>

<para><xref linkend="ex.p.viewport"/> shows an example of a <tag>p:viewport</tag>
in action.</para>

<example xml:id="ex.p.viewport">
<title>A Sample Viewport</title>
<programlisting><![CDATA[<p:viewport name="encdivs">
  <p:input port="div" step="step" source="port" select="//h:div[@class='enc']"/>
  <p:output port="html" step="encrypt" source="result"/>
  <p:step name="encrypt" ]]>&kind;<![CDATA[="p:encrypt-document">
    <p:input name="document" step="encdivs" source="div"/>
  </:step>
</p:viewport>]]></programlisting>
</example>

<para>The <code>//h:div[@class='enc']</code>s of the document are
selected. Each selected <code>div</code> is encrypted and the resulting
encrypted version replaces the original div. The result of the whole &construct; is
a copy of the input document with each selected <code>div</code> encrypted.</para>

<note role="editorial" xml:id="viewport-uses-match">
<para>The WG has decided that the semantics of the XPath expression on viewport
should be “match” semantics (a la XSLT), not select semantics. That decision
is not been reflected in this draft.</para>
</note>

<para>It is a <glossterm>static error</glossterm> if there is not exactly one
<tag>p:input</tag> child and exactly one
<tag>p:output</tag> child of <tag>p:viewport</tag> or if the declared
ports do not specify a binding<!--, or if the input port specifies a binding to a step inside
the <tag>p:viewport</tag>-->.</para>
</section>

<section xml:id="p.choose">
<title>p:choose/p:when/p:otherwise Elements</title>

<para>A <tag>p:choose</tag> represents a [[choose]].</para>

<e:element-syntax name="choose">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="when" repeat="zero-or-more"/>
    <e:element name="otherwise" repeat="zero-or-one"/>
  </e:sequence>
</e:element-syntax>

<para>The <tag>p:choose</tag> can specify a context in which the XPath
expressions that occur on each branch are evaluated. If a context is specified,
it must be specified in exactly one of two ways,
<glossterm linkend="dt-input-source">by source</glossterm>:
</para>

<e:element-syntax name="choose">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:attribute name="step" required="yes">
    <e:data-type name="step name"/>
  </e:attribute>
  <e:attribute name="source" required="yes">
    <e:data-type name="port name"/>
  </e:attribute>
  <e:sequence>
    <e:element name="when" repeat="zero-or-more"/>
    <e:element name="otherwise" repeat="zero-or-one"/>
  </e:sequence>
</e:element-syntax>

<para>or <glossterm baseform="by URI">by URI:</glossterm>
</para>

<e:element-syntax name="choose">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:attribute name="href" required="yes">
    <e:data-type name="URI"/>
  </e:attribute>
  <e:sequence>
    <e:element name="when" repeat="zero-or-more"/>
    <e:element name="otherwise" repeat="zero-or-one"/>
  </e:sequence>
</e:element-syntax>

<para>Each conditional <glossterm>subpipeline</glossterm> is represented by a 
<tag xml:id="p.when">p:when</tag> element.</para>

<e:element-syntax name="when">
  <e:in-category name="language-construct"/>
  <e:attribute name="test" required="yes">
    <e:data-type name="expression"/>
  </e:attribute>
  <e:sequence>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>The <tag>p:when</tag> can specify a context in which its XPath
expression is to be evaluated. If a context is specified,
it must be specified in exactly one of two ways,
<glossterm linkend="dt-input-source">by source</glossterm>:
</para>

<e:element-syntax name="when">
  <e:in-category name="language-construct"/>
  <e:attribute name="test" required="yes">
    <e:data-type name="expression"/>
  </e:attribute>
  <e:attribute name="step" required="yes">
    <e:data-type name="step name"/>
  </e:attribute>
  <e:attribute name="source" required="yes">
    <e:data-type name="port name"/>
  </e:attribute>
  <e:sequence>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>or <glossterm baseform="by URI">by URI:</glossterm>
</para>

<e:element-syntax name="when">
  <e:in-category name="language-construct"/>
  <e:attribute name="test" required="yes">
    <e:data-type name="expression"/>
  </e:attribute>
  <e:attribute name="href" required="yes">
    <e:data-type name="URI"/>
  </e:attribute>
  <e:sequence>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>If no context is specified on the <tag>p:when</tag>, the context specified
on the <tag>p:choose</tag> is used.
It is a <glossterm>static error</glossterm> if no context is specified in either
place.</para>

<note role="editorial" xml:id="choose-inconsistent">
<para>The <tag>p:choose</tag>/<tag>p:when</tag> elements are
inconsistent with <tag>p:for-each</tag> and <tag>p:viewport</tag>. It
would be consistent to allow exactly one <tag>p:input</tag>
to specify the context, instead of specifying the
context directly on the <tag>p:choose</tag> and <tag>p:when</tag>
elements. (Or conversely, to remove the <tag>p:input</tag>
elements from <tag>p:for-each</tag> and <tag>p:viewport</tag>.)</para>
<para>Note, in particular, that without the <tag>p:input</tag>,
there's no direct way to specify a here document for the context.
The WG has not yet decided how to resolve this issue.</para>
</note>

<para>The <tag class="attribute">test</tag> attribute provides the guard expression
for the <glossterm>subpipeline</glossterm>.</para>

<para>The default branch is represented by a
<tag xml:id="p.otherwise">p:otherwise</tag> element.</para>

<e:element-syntax name="otherwise">
  <e:in-category name="language-construct"/>
  <e:sequence>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>All of the <tag>p:when</tag> branches and the <tag>p:otherwise</tag>
must declare the same number of output ports with the same names. It is a 
<glossterm>static error</glossterm> if they do not.</para>

<para>The result of the <tag>p:choose</tag> is the result of the
selected subpipeline. It is a <glossterm>dynamic error</glossterm> if no
<tag>p:when</tag> is selected and no <tag>p:otherwise</tag> is
specified.</para>
</section>

<section xml:id="p.group">
<title>p:group Element</title>

<para>A <tag>p:group</tag> is a wrapper for a <glossterm>subpipeline</glossterm>.</para>

<e:element-syntax name="group">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>The result of a <tag>p:group</tag> is its declared outputs.</para>
</section>

<section xml:id="p.try">
<title>p:try/p:catch Elements</title>

<para>A <tag>p:try</tag> represents a [[try/catch]].</para>

<e:element-syntax name="try">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="group"/>
    <e:element name="catch"/>
  </e:sequence>
</e:element-syntax>

<para>Where <tag>p:group</tag> represents the initial subpipeline. The recovery
(or “catch”) pipeline is identified with a
<tag xml:id="p.catch">p:catch</tag> element:</para>

<e:element-syntax name="catch">
  <e:in-category name="language-construct"/>
  <e:sequence>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
    <e:model name="subpipeline"/>
  </e:sequence>
</e:element-syntax>

<para>Within the <tag>p:catch</tag> block, the special input port
<literal>#error</literal> is defined. The document(s) on that port constitute
the error messages received from the &stage; which failed. Note that the
order of the messages on that port is undefined. Note also that the failure
of one &stage; can cause others to fail and the &stage; which signaled
the error might not be the only or even the first &stage; that failed.</para>

<para>Both the <tag>p:group</tag> and the <tag>p:catch</tag>
must declare the same number of output ports with the same names. It is a 
<glossterm>static error</glossterm> if they do not.</para>
</section>

<!-- ============================================================ -->

<section xml:id="p.declare-step-type">
<title>p:declare-&atom;-type Element</title>

<para>A <tag>p:declare-&atom;-type</tag> provides the &kind; and <glossterm>signature</glossterm>
of an implementation-dependent &kind; of &atom;. It declares the inputs, outputs,
and parameters for all &atoms; of that &kind;.</para>

<e:element-syntax name="declare-&atom;-type">
  <e:in-category name="language-construct"/>
  <e:attribute name="&kind;" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="input" repeat="zero-or-more"/>
    <e:element name="output" repeat="zero-or-more"/>
    <e:element name="parameter" repeat="zero-or-more"/>
  </e:sequence>
</e:element-syntax>

<note role="editorial" xml:id="external-binding">
<para>We need to make some provision for identifying the
implementation of a declared step, even if it's no more than
implementation-defined extension attributes. We'll need some sort of
mechanism for declaring multiple implementations too.</para>
</note>

<para>It is a <glossterm>static error</glossterm> if the <tag class="attribute">&kind;</tag> attribute of a <tag>p:step</tag>
is not recognized by the processor. It is not
an error to declare such an &atom;, only to use it.</para>

<para>Exactly one input declaration of a
<tag>p:declare-&atom;-type</tag> <rfc2119>may</rfc2119> use the
<tag class="attribute">name</tag> “<literal>*</literal>” to indicate
that the &atom; accepts an arbitrary number of inputs.
</para>

</section>

<!-- ============================================================ -->

<section xml:id="p.pipeline-library">
<title>p:pipeline-library Element</title>

<para>A <tag>p:pipeline-library</tag> contains one or more &atom;
declarations and/or pipelines. It declares &atoms; that pipelines
can import.</para>

<e:element-syntax name="pipeline-library">
  <e:in-category name="language-construct"/>
  <e:sequence>
    <e:element name="import" repeat="zero-or-more"/>
    <e:element name="declare-&atom;-type" repeat="zero-or-more"/>
    <e:element name="pipeline" repeat="zero-or-more"/>
  </e:sequence>
</e:element-syntax>

<example xml:id="ex.p.pipeline-library">
<title>A Sample Pipeline Library</title>
<programlisting><![CDATA[<p:pipeline-library>
  <p:declare-]]>&atom;<![CDATA[-type> name="extension-component">…</p:declare-]]>&atom;<![CDATA[type>
  <p:pipeline name="xinclude-and-validate">…</p:pipeline>
  <p:pipeline name="validate-and-transform">…</p:pipeline>
  …
</p:pipeline>]]></programlisting>
</example>

</section>

<!-- ============================================================ -->

<section xml:id="p.import">
<title>p:import Element</title>

<para>An <tag>p:import</tag> loads a pipeline or pipeline library, making
it available in the current context.</para>

<e:element-syntax name="import">
  <e:in-category name="language-construct"/>
  <e:attribute name="href" required="yes">
    <e:data-type name="URI"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para>An import statement loads the specified URI and makes any pipelines
declared within it available to the current pipeline.</para>

<para>It is a <glossterm>dynamic error</glossterm> if the URI cannot
be retrieved or if, once retrieved, it does not point to a
<tag>p:pipeline-library</tag> or <tag>p:pipeline</tag>. If it points to
a <tag>p:pipeline</tag>, it is a <glossterm>dynamic error</glossterm> if the
pipeline does not have a <tag class="attribute">name</tag>.</para>
</section>
</section>
</section>

<section xml:id="errors">
<title>Errors</title>

<para>Errors in a pipeline can be divided into two classes:
<glossterm baseform="static error">static errors</glossterm>
and <glossterm baseform="dynamic error">dynamic errors</glossterm>.</para>

<section xml:id="static-errors">
<title>Static Errors</title>

<para><termdef xml:id="dt-static-error">A <glossterm>static
error</glossterm> is one which can be detected before pipeline evaluation
is even attempted.</termdef> Examples of static errors include cycles,
incorrect specification of inputs and outputs, and reference to unknown
components.</para>

<para>Static errors are fatal and must be detected before any components
are evaluated.</para>
</section>

<section xml:id="dynamic-errors">
<title>Dynamic Errors</title>

<para>A <termdef xml:id="dt-dynamic-error">A <glossterm>dynamic
error</glossterm> is one which occurs while a pipeline is being
evaluated.</termdef> Examples of dynamic errors include references
to URIs that cannot be resolved, components which fail, and pipelines
that exhaust the capacity of an implementation (such as memory or
disk space).</para>

<para>If a component fails due to a dynamic error, failure propagates
upwards until either a [[try]] is encountered or the entire pipeline
fails. In other words, outside of a [[try]], component failure causes
the entire pipeline to fail.</para>
</section>
</section>

<appendix xml:id="references">
<title>References</title>

<bibliolist>
<bibliomixed xml:id="xml-core-wg"><abbrev>XML Core Req</abbrev>
<citetitle xlink:href="http://www.w3.org/TR/proc-model-req/">XML
Processing Model Requirements</citetitle>
Dmitry Lenkov, Norman Walsh, editors. W3C
Working Group Note 05 April 2004
</bibliomixed>

<bibliomixed xml:id="xml-infoset-rec"><abbrev>Infoset</abbrev>
<citetitle xlink:href="http://www.w3.org/TR/xml-infoset/">XML
Information Set (Second Edition)</citetitle> John Cowan,
Richard Tobin, editors. W3C Working Group Note 04 February 2004.
</bibliomixed>

<bibliomixed xml:id="REC-xml"><abbrev>XML 1.0</abbrev>
<citetitle xlink:href="http://www.w3.org/TR/REC-xml/">Extensible
Markup Language (XML) 1.0 (Fourth Edition)</citetitle> Tim Bray,
Jean Paoli, C. M. Sperberg-McQueen, et. al.
editors. W3C Recommendation 16 August 2006.</bibliomixed>

<bibliomixed xml:id="xml11"><abbrev>XML 1.1</abbrev>
<citetitle xlink:href="http://www.w3.org/TR/xml11/">Extensible
Markup Language (XML) 1.1 (Second Edition)</citetitle> Tim Bray,
Jean Paoli, C. M. Sperberg-McQueen, et. al.
editors. W3C Recommendation 16 August 2006.</bibliomixed>

</bibliolist>
</appendix>

<appendix xmlns="http://docbook.org/ns/docbook" xmlns:db="http://docbook.org/ns/docbook" xml:id="glossary"><title>Glossary</title><glosslist><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">after</glossterm><glossdef><para>Component A is <glossterm>after</glossterm>
component B if component B is the <glossterm>container</glossterm>
for component A (or an ancestor of such a container) or if any output from component B
is connected to any input of component A, either directly or indirectly.</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">before</glossterm><glossdef><para>Component A is <glossterm>before</glossterm>
component B if component B is a <glossterm baseform="contained components">contained component</glossterm> of component A, either
directly or indirectly, or if any output from component A is connected
to any input of component B, either directly or indirectly.</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">by source</glossterm><glossdef><para>A document is specified
<glossterm>by source</glossterm>
if it refers to a specific port on another component.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">by URI</glossterm><glossdef><para>A document is specified
<glossterm>by URI</glossterm>
if it refers to it with a URI.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">connected</glossterm><glossdef><para>Components A and B are
<glossterm>connected</glossterm> if they are either
directly or indirectly connected.  Component A is directly
connected to B if an output of A is associated with an input
port of B.  Component A is indirectly connected to B if there
is a chain of directly connected components that allows
traversal from A to B.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">construct</glossterm><glossdef><para>A
<glossterm>construct</glossterm> is a component that
contains additional components. That is, a construct differs from a
step in that its semantics are at least partially determined by the
components that it contains.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">contained components</glossterm><glossdef><para>The components that occur
directly inside a construct
are called <glossterm>contained components</glossterm>.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">container</glossterm><glossdef><para>A construct which immediately
contains a component is called its <glossterm>container</glossterm>.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">context</glossterm><glossdef><para>The <glossterm>context</glossterm> is the
the set of input ports, output ports, and parameter
names that are visible.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">declared inputs</glossterm><glossdef><para>The input ports declared on a
component are its <glossterm>declared inputs</glossterm>.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">declared outputs</glossterm><glossdef><para>The output ports declared on a
component are its <glossterm>declared outputs</glossterm>.</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">dynamic
error</glossterm><glossdef><para>A <glossterm>dynamic
error</glossterm> is one which occurs while a pipeline is being
evaluated.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">extension attributes</glossterm><glossdef><para>An element from the
XProc namespace <rfc2119>may</rfc2119> have any attribute not from the
XProc namespace, provided that the expanded-QName of the attribute has
a non-null namespace URI. These attributes are called
<glossterm>extension attributes</glossterm>.</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">extension element</glossterm><glossdef><para>Outside the context of a
<quote>here document</quote>, any element not in the XProc namespace
is an <glossterm>extension element</glossterm>.</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">here document</glossterm><glossdef><para>An document is specified by
<glossterm>here document</glossterm>
if it is contained in the body of the element that binds it.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">matches</glossterm><glossdef><para>A component
<glossterm>matches</glossterm> its signature if and only if it specifies
an input for each declared input and it specifies no inputs that are not
declared; it specifies
a parameter for each parameter that is declared to be required; and it
specifies no parameters that are not declared.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">parameter</glossterm><glossdef><para>A <glossterm>parameter</glossterm> is
a QName/value pair.</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">pipeline</glossterm><glossdef><para>A <glossterm>pipeline</glossterm>
is a set of components connected
together, with outputs flowing into inputs, without any loops (no component can
read its own output, directly or indirectly).</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">signature</glossterm><glossdef><para>The
<glossterm>signature</glossterm> of a component is the set of inputs,
outputs, and parameters that it is declared to accept.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">static
error</glossterm><glossdef><para>A <glossterm>static
error</glossterm> is one which can be detected before pipeline evaluation
is even attempted.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">step</glossterm><glossdef><para>A <glossterm>step</glossterm> is an atomic
component that performs a
unit of XML processing, such as XInclude or transformation.</para><para>Note: defined but never referenced.</para></glossdef></glossentry><glossentry><glossterm xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">subpipeline</glossterm><glossdef><para>The components (and the connections between them)
within a container form
a <glossterm>subpipeline</glossterm>.</para></glossdef></glossentry></glosslist></appendix>

<appendix xml:id="err-vocab">
<title>The Error Vocabulary</title>

<para>This appendix describes the XML vocabulary that components are
expected to use to identify messages on their error ports.</para>

<para>To be described…</para>
</appendix>

<appendix xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" xmlns:p="http://www.w3.org/XML/XProc/2006/04/components#" version="5.0-extension w3c-xproc" xml:id="std-components">

<title>Standard Component Library</title>

<para>This appendix describes the standard XProc components.</para>

<note>
<para>The components described in this draft are intended mainly as a
starting point for discussion and to present a flavor for the sorts of
components envisioned. The WG has not yet discussed them in detail.</para>
</note>

<section xml:id="std-required">
<title>Required Components</title>

<para>This section describes standard components that must be supported
by any conforming processor.</para>

<para>To be described…</para>

<section xml:id="c.identity">
<title>Identity</title>

<para>The identity &construct; makes a verbatim copy of its input
available on its output.</para>

<p:declare-step-type type="p:identity">
  <p:input port="input" sequence="yes"/>   
  <p:output port="result" sequence="yes"/>   
</p:declare-step-type>

<note>
<para>The use of 'input' as a port name here probably isn't the best
choice. Since the identity component must be able to take a sequence
of documents, the port name 'document' isn't appropriate either.</para>
</note>
</section>

<section xml:id="c.xslt">
<title>XSLT</title>

<para>The xslt &stage; applies an XSLT 1.0 transformation supplied by the
input to the 'transform' port to the document provided on the 'document'
port. It produces a sequence of documents on its 'result'
port.</para>

<p:declare-step-type type="p:xslt">
  <p:input port="document" sequence="no"/>   
  <p:input port="transform" sequence="no"/>   
  <p:output port="result" sequence="yes"/>   
  <p:parameter name="*"/>
</p:declare-step-type>

<para>All of the specified parameters are made available to the
XSLT processor. If the XSLT processor signals a fatal error, the &stage; fails,
otherwise the result of the transformation is produced on the
<literal>result</literal> port.</para>

<para>Note, an XSLT 1.0 processor without any extensions can only produce a single
XML document as its result. However, many XSLT 1.0 processors provide extensions
which allow the processor to produce more than one result. In such cases, more than
one document may appear in the <literal>result</literal> port. The principle result
document will always appear <emphasis>last</emphasis>.</para>
</section>

<section xml:id="c.xinclude">
<title>XInclude</title>

<para>The XIinclude &stage; applies xinclude processing semantics
to the document. The referenced documents are calculated against the
base URI and are not provided as input to the &stage;.</para>

<p:declare-step-type type="p:xinclude">
  <p:input port="document" sequence="no"/>   
  <p:output port="result" sequence="no"/>   
</p:declare-step-type>
</section>

<section xml:id="c.serialize">
<title>Serialize</title>

<para>The serialize &stage; applies XML serialization to the
children of the document element and replaces those children with their
serialization. The outcome is a single element with text content that
represents the "escaped" syntax of the children if they were
serialized.</para>

<p:declare-step-type type="p:serialize">
  <p:input port="document" sequence="no"/>   
  <p:output port="result" sequence="no"/>   
</p:declare-step-type>

</section>

<section xml:id="c.parse">
<title>Parse</title>

<para>The parse &stage; takes the text value of the document
element and parses the content as if it was and unicode character stream
containing XML. The outcome is a single element with children from the
parsing of the XML content. This is the reverse of the serialize
&stage;.</para>

<para>When the text value is parsed, a document element wrapper should
be assumed so that element siblings can be parsed back into XML.
Further, if the 'namespace' parameter is specified, the default
namespace is declared on that wrapper element. If a wrapper element name
is specified, it is not returned in the result.</para>

<para>If the 'content-type' parameter is specified, an implementation
can use a different parser to produce XML content. Such a behavior is
implementation defined. For example, for the mime type 'text/html', an
implementation might provide an HTML to XHTML parser (e.g. Tidy).</para>

<p:declare-step-type type="p:parse">
  <p:input port="document" sequence="no"/>   
  <p:output port="result" sequence="no"/>
  <p:parameter name="namespace" required="no"/>  
  <p:parameter name="content-type" required="no"/>  
</p:declare-step-type>

</section>

<section xml:id="c.load">
<title>Load</title>

<para>The load &stage; has no inputs but takes a parameter that
specifies a URI of an XML resource that should be loaded and provided as
the result.</para>

<p:declare-step-type type="p:load">
  <p:output port="result"/>  
  <p:parameter name="href" required="yes"/>  
</p:declare-step-type>

<para>Load attempts to read an XML document from the specified URI. If the
document does not exist, or is not well-formed, the &stage; fails. Otherwise,
the document read is produced on the <literal>result</literal> port.</para>

<note>
  <para>Should this &stage; allow href to be a list of URIs and return a
  sequence of documents?</para>
</note>

</section>

<section xml:id="c.store">
<title>Store</title>

<para>The store &stage; stores a serialized version of its input
to a URI. The URI is either specified explicitly by the 'href' parameter
or implicitly by the base URI of the document. This &stage; has no
output.</para>

<note>
<para>Should this &stage; allow sequences on its input?</para>
</note>

<p:declare-step-type type="p:store">
   <p:input port="document"/>  
   <p:parameter name="href" required="no"/>  
</p:declare-step-type>

<note>
<para>A more direct “serialize-to-octet-stream” component may also be required.
One, for example, that supports the XSLT 2.0/XQuery 1.0 Serialization
specification.</para>
</note>
</section>

</section>

<section xml:id="std-optional">
<title>Optional Components</title>
<para>T.B.D.</para>
</section>

<section xml:id="std-micro-op">
<title>Micro-Operations Components</title>

<note>
<para>No decisions have been made about whether these components will be
optional or required.</para>
</note>

<section xml:id="c.rename">
<title>Rename</title>

<para>The rename component renames elements or attributes in a
document based on parameter values.</para>

<p:declare-step-type type="p:rename">
   <p:input port="document"/>
   <p:output port="result"/>  
   <p:parameter name="select" required="no"/>
   <p:parameter name="name" required="yes"/>
</p:declare-step-type>

<para>Each element, attribute, or processing-instruction identified by the
XPath 1.0 expression specified in the 'select' parameter is renamed. The name
of elements and attributes, and the target of processing-instructions, are
changed to the value of the 'name' parameter.</para>

<para>The component fails if the specified name is not a valid name or if the
renaming would introduce a syntactic error into the document (i.e., if it would
create two attributes with the same name on the same element).</para>

</section>

<section xml:id="c.wrap">
<title>Wrap</title>

<para>The wrap component wraps the document element with a new
document element.</para>

<p:declare-step-type type="p:wrap">
   <p:input port="document"/>
   <p:output port="result"/>  
   <p:parameter name="name" required="yes"/>
</p:declare-step-type>

</section>

<section xml:id="c.insert">
<title>Insert</title>

<para>The insert component inserts a document specified on the
'insertion' port as a child of the document element provided on the
'document' port. The position of this insert is governed by the
parameters.</para>

<p:declare-step-type type="p:insert">
   <p:input port="document"/>   
   <p:input port="insertion"/>   
   <p:output port="result"/>   
   <p:parameter name="at-start" required="yes"/>
</p:declare-step-type>

<para>If the <parameter>at-start</parameter> parameter is true, the
insertion document will be inserted as the first child(ren) of the document,
otherwise it will be inserted as the last child(ren). If the parameter
is not specified, a value of true is assumed.</para>

</section>

<section xml:id="c.set-attributes">
<title>Set-attributes</title>

<para>The set-attributes component sets attribute values on the
document element using the attribute values provided on the document
element of the 'attribute' port's document.</para>

<p:declare-step-type type="p:set-attributes">
   <p:input port="document"/>   
   <p:input port="attributes"/>   
   <p:output port="result"/>   
</p:declare-step-type>

</section>
</section>

<section xml:id="component-declarations">
<title>Component Declarations</title>

<para>T.B.D.</para>

<programlisting><![CDATA[<p:pipeline-library name="standard">

  <p:declare-step-type type="p:validate">
    <p:input port="document" sequence="no"/>
    <p:input port="schema" sequence="yes"/>
    <p:output port="result" sequence="no"/>
  </p:declare-step-type>

  <p:declare-step-type type="p:xinclude">
    <p:input port="document" sequence="no"/>
    <p:output port="result" sequence="no"/>
  </p:declare-step-type>

  <p:declare-step-type type="p:xslt">
    <p:input port="document" sequence="no"/>
    <p:input port="stylesheet" sequence="no"/>
    <p:output port="result" sequence="yes"/>
  </p:declare-step-type>

</p:pipeline-library>]]></programlisting>
</section>

</appendix>

<appendix xml:id="examples">
<title>Examples</title>

<para>This appendix contains some examples…</para>

<para>Consult <xref linkend="component-declarations"/> for a description of
the signatures of the standard components.</para>

<example xml:id="ex1">
<title>Pipeline for Figure 1</title>
<programlisting><![CDATA[<p:pipeline name="fig1"
	    xmlns:p="http://example.org/PipelineNamespace">
  <p:input port="doc" sequence="no"/>
  <p:input port="schemaDoc" sequence="yes"/>
  <p:output port="out" step="s2" source="result"/>

  <p:step type="p:xinclude" name="s1">
    <p:input port="document" step="fig1" source="doc"/>
  </p:step>

  <p:step type="p:validate" name="s2">
    <p:input port="document" step="s1" source="result"/>
    <p:input port="schema" step="fig1" source="schemaDoc"/>
  </p:step>
</p:pipeline>]]></programlisting>
</example>

<example xml:id="ex2">
<title>Pipeline for Figure 2</title>
<programlisting><![CDATA[<p:pipeline name="fig2"
	    xmlns:p="http://example.org/PipelineNamespace">
  <p:input port="doc" sequence="no"/>
  <p:output port="out" step="xform" source="result"/>

  <p:choose name="vcheck" step="fig2" source="doc">
    <p:when test="/*[@version &lt; 2.0]">
      <p:output name="valid" step="val1" source="result"/>
      <p:step type="p:validate" name="val1">
	<p:input port="document" step="fig2" source="doc"/>
	<p:input port="schema" href="v1schema.xsd"/>
      </p:step>
    </p:when>

    <p:otherwise>
      <p:output name="valid" step="val2" source="result"/>
      <p:step type="p:validate" name="val2">
	<p:input port="document" step="fig2" source="doc"/>
	<p:input port="schema" href="v2schema.xsd"/>
      </p:step>
    </p:otherwise>
  </p:choose>

  <p:step type="p:xslt" name="xform">
    <p:input port="document" step="vcheck" source="valid"/>
    <p:input port="stylesheet" href="stylesheet.xsl"/>
  </p:step>
</p:pipeline>]]></programlisting>
</example>
</appendix>

</specification>
