<?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 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-09-28</pubdate>

<bibliorelation type="isformatof" xlink:href="langspec.xml">XML</bibliorelation>

<!--
<bibliorelation type="replaces"
		xlink:href="ED-xproc-20060821"/>
-->

<authorgroup>
  <author>
    <personname>Norman Walsh</personname>
    <affiliation>
      <orgname>Sun Microsystems, Inc.</orgname>
    </affiliation>
    <email>Norman.Walsh@Sun.COM</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 first public Working Draft, based on the previously
published
<link xlink:href="http://www.w3.org/TR/xproc-requirements/">Requirements
Document</link>. Although not all the details of the design are
complete, the Working Group has chosen early publication 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 is the result of the
pipeline, “Result Document”.
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 &construct;. 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>

</section>

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

<para><termdef xml:id="dt-pipeline">A <glossterm>pipeline</glossterm>
is an acyclic, directed graph of &stages; connected together by
inputs and outputs.</termdef> In other words, it's a set of &stages; connected
together with outputs flowing into inputs without any loops (no &stage; can
read its own output, directly or indirectly).
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
<glossterm>flow graph</glossterm> that connects them. A pipeline must behave as if it
evaluated each &stage; each time it occurs in the flow graph. 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
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.</para>

<para>&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 unit of XML processing 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 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 flow graph of &stages;
immediately contained within a &construct; forms
a <glossterm>subpipeline</glossterm>.</termdef></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 a
well formed <biblioref linkend="REC-xml"/> or
<biblioref linkend="xml11"/> document.</para>

<note role="editorial" xml:id="xml11-optional">
<para>Is support for XML 1.1 optional?</para>
</note>

<para> The inputs and outputs can be
implemented as sequences of characters, events, or object models, or any other
representation the implementation chooses.</para>

<note role="editorial" xml:id="inconsistent-ref">
<para>It's inconsistent to point to the XML Recommendation on the one
hand, and on the other hand to specify that the representation doesn't
have to be a sequence of characters. Fix this, probably by referring to
the Infoset and describing XML 1.0/1.1 in some other way.</para>
</note>

<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>All of the input ports of a &stage; must be connected to
inputs. 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, 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 no outputs 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
of a &stage; which is declared to produce a sequence of documents to a port that accepts 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="flow-graph">
<title>Flow Graph</title>

<para><termdef xml:id="dt-flow-graph">The &stages; contained in a
pipeline or other &container; are
the nodes of a <glossterm>flow graph</glossterm>. The input and
output ports of the components are connected by arcs in that
graph.</termdef></para>

<para>Consider two &stages; in such a graph, “&stage; A” and
“&stage; B”.</para>

<para><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. In other words, every <glossterm>flow graph</glossterm> must
be acyclic.</para>
</section>
</section>

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

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

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

<para>A [[pipeline]] encapsulates the behavior of a
<glossterm>subpipeline</glossterm>. It has a number of declared input
and output ports and parameters. Viewed from the outside, it is a
black box which performs some calculation on the inputs and produces
the 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 over its
inputs; 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. 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. 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>

<para>The list of alternative subpipelines consists of zero or more
subpipelines, each guarded by an XPath expression and a 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. 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>.
It 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. A [[try]] &construct; begins with two subpipelines: an initial
subpipeline and a recovery (or “catch”) subpipeline.</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>It
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. In this
case, 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 &stage; 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>A pipeline is a <glossterm>flow graph</glossterm> of connected
&stages;, some of which may themselves contain
<glossterm baseform="flow graph">flow graphs</glossterm>. Elements in a
pipeline document represent the
<glossterm baseform="flow graph">flow graphs</glossterm>,
using one element for each &stage; and a combination of elements and attributes to specify
how the inputs and outputs of each &stage; are connected, and to
represent parameter bindings.</para>

<para><glossterm baseform="container">Containment</glossterm> is
represented naturally using nesting of XML elements.</para>

<para>Elements which represent &stages; all have names, the
value of the <tag class="attribute">name</tag> attribute. These
names are used to establish the bindings between inputs and outputs
(e.g. we can speak of “the ‘result’ output port of the &stage; named ‘foo’ being connected to the
‘document’ input port of the &stage; named ‘bar’.”).</para>

<!--
<para>The syntax of
a pipeline document has to identify each of those &stages;. Each
&stage; has a <glossterm>signature</glossterm> and that signature
has to be satisfied by the inputs and parameters specified in the
syntax. (Recall that a pipeline is not required to consume all the
outputs of a component, but it must identify all the inputs and
required parameters.)</para>
-->

<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, dependent
on context.</para>

<para>When the specification is for an input to a &stage;, the
specified port must be</para>

<orderedlist>
<listitem>
<para>a declared input on the component's <glossterm>&container;</glossterm>
(e.g., a [[choose]] or [[for-each]]) <emphasis>or</emphasis></para>
</listitem>
<listitem>
<para>an output port of some other &stage; within the component's
<glossterm>&container;</glossterm> <emphasis>or</emphasis></para>
</listitem>
<listitem xml:id="alt3">
<para>an allowed input, per these three alternatives, for the
component's <glossterm>&container;</glossterm>.
</para>
</listitem>
</orderedlist>

<para>If the specification is for the output of a construct, the
specified port must be an output port of some component within that
construct.</para>

<note><para><link linkend="alt3">Alternative 3</link> above
corresponds to a connection between &stages; in two separate
<glossterm baseform="subpipeline">subpipelines</glossterm>, for example from a &stage; in the
<glossterm>subpipeline</glossterm> of a pipeline itself to a &stage;
in the <glossterm>subpipeline</glossterm> of a [[for-each]]. This
contradicts the definition of <glossterm>subpipeline</glossterm> as a
self-contained <glossterm>flow graph</glossterm> in
<xref linkend="stages"/>.</para>

<para>It is the WG's intention to provide for the functionality
delivered by such connections, but how this will be accomplished has
not yet been decided.</para></note>

<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="scoping">
<title>Scoping of Names</title>

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

<para>The scope of &stage; names is the <glossterm>flow
graph</glossterm> of their <glossterm>container</glossterm> and the flow graphs
of the &constructs; therein, recursively.</para>

</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 <glossterm>flow graph</glossterm> to
differ from the <glossterm>flow graph</glossterm> that any other conformant XProc processor
might 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 <glossterm>flow graph</glossterm> to
differ from the <glossterm>flow graph</glossterm> that any other conformant XProc processor
might 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="declare-input" repeat="zero-or-more"/>
    <e:element name="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-parameter" repeat="zero-or-more"/>
    <e:element name="import" repeat="zero-or-more"/>
    <e:element name="declare-&atom;" 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:declare-input port="document"/>
  <p:declare-input port="stylesheet"/>
  <p:declare-output port="result"/>
  <p:declare-parameter name="validate"/>
  …
</p:pipeline>]]></programlisting>
</example>

</section>

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

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

<para>A <tag>p:declare-input</tag> declares an input port.</para>

<e:element-syntax name="declare-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 define
two ports with the same name.</para>

<para>An input 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> 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="declare-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="declare-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="declare-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:declare-input</tag> appears or it must be
a port declared with <tag>p:declare-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. See <xref linkend="p.input"/>.</para>
</section>

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

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

<para>A <tag>p:declare-output</tag> identifies an output port.</para>

<e:element-syntax name="declare-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 declare two
ports with the same name.</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="declare-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="declare-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="declare-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:declare-output</tag> appears.-->
It is a <glossterm>static error</glossterm> if more than one binding
is specified.
</para>
</section>

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

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

<para>A <tag>p:declare-parameter</tag> declares a parameter.</para>

<e:element-syntax name="declare-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>&Stages; must declare the parameters that they accept.</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>

<para>A “<literal>*</literal>” in a declared name functions as a wild card,
allowing any parameter with a matching name to be specified.</para>

<para>If <tag class="attribute">name</tag> is a QName, then the declaration
<rfc2119>may</rfc2119> include a default value using either content or a
<tag class="attribute">select</tag> attribute as per
<tag>p:param</tag>.</para> 
</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-param" repeat="zero-or-more"/>
    <e:element name="param" 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.input">
<title>p.input Element</title>

<para>A <tag>p:input</tag> identifies input for a &stage;.</para>

<para>Inputs identify their source in exactly one of three ways,
<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="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:attribute name="select">
    <e:data-type name="xpath expression"/>
  </e:attribute>
  <e:empty/>
</e:element-syntax>

<para><glossterm baseform="by 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="NCName"/>
  </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="input">
  <e:in-category name="language-construct"/>
  <e:attribute name="port" required="yes">
    <e:data-type name="NCName"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="xpath expression"/>
  </e:attribute>
  <e:model name="here document"/>
</e:element-syntax>

<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">port</tag> attribute identifies the
input port of the component that will read from the specified source.
It is a
<glossterm>static error</glossterm>
if the name given does not match the name of an input port for the
component or if  more than one input is specified
for any given port.</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.param">
<title>p:param Element</title>

<para>A <tag>p:param</tag> associates a particular value with a parameter.</para>

<para>The value of the parameter can be specified in several ways; as the
content of
the <tag>p:param</tag> element:</para>

<e:element-syntax name="param">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:model name="any content"/>
</e:element-syntax>

<para>In this case, the (XPath 1.0) <emphasis>string value</emphasis> of the
content becomes the value of the parameter.</para>

<para>With a <tag class="attribute">value</tag> attribute:</para>

<e:element-syntax name="param">
  <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>Or as an XPath expression. In this case, the context in which
the expression is evaluated must be specified in exactly one of three
ways, <glossterm linkend="dt-input-source">by source</glossterm>:
</para>

<e:element-syntax name="param">
  <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 baseform="by URI">by URI:</glossterm>
</para>

<e:element-syntax name="param">
  <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="param">
  <e:in-category name="language-construct"/>
  <e:attribute name="name" required="yes">
    <e:data-type name="QNName"/>
  </e:attribute>
  <e:attribute name="select">
    <e:data-type name="xpath expression"/>
  </e:attribute>
  <e:model name="here document"/>
</e:element-syntax>

<para>The (XPath 1.0) <emphasis>string value</emphasis> of the result of evaluating
the expression becomes the value of the parameter.</para>

</section>

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

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

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

<e:element-syntax name="import-param">
  <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:param</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="declare-input"/>
    <e:element name="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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:declare-input port="chap" href="http://example.org/docbook.xml" select="//chapter"/>
  <p:declare-output port="html" step="xform-to-html source="result"/>
  <p:declare-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:declare-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="declare-input"/>
    <e:element name="declare-output"/>
    <e:element name="declare-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:declare-input port="div" step="step" source="port" select="//h:div[@class='enc']"/>
  <p:declare-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>

<para>It is a <glossterm>static error</glossterm> if there is not exactly one
<tag>p:declare-input</tag> child and exactly one
<tag>p:declare-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="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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:declare-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:declare-input</tag>
elements from <tag>p:for-each</tag> and <tag>p:viewport</tag>.)</para>
<para>Note, in particular, that without the <tag>p:declare-input</tag>,
there's no direct way to specify a here document for the context.</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="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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">
<title>p:declare-&atom; Element</title>

<para>A <tag>p:declare-&atom;</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;">
  <e:in-category name="language-construct"/>
  <e:attribute name="&kind;" required="yes">
    <e:data-type name="QName"/>
  </e:attribute>
  <e:sequence>
    <e:element name="declare-input" repeat="zero-or-more"/>
    <e:element name="declare-output" repeat="zero-or-more"/>
    <e:element name="declare-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;</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;" 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[> name="extension-component">…</p:declare-]]>&atom;<![CDATA[>
  <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 unit of XML processing 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 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">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">flow graph</glossterm><glossdef><para>The components contained in a
pipeline or other container are
the nodes of a <glossterm>flow graph</glossterm>. The input and
output ports of the components are connected by arcs in that
graph.</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 no outputs 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 an acyclic, directed graph of components connected together by
inputs and outputs.</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
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 flow graph of components
immediately contained within a construct forms
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 xml:id="std-components">
<title>Standard Component Library</title>

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

<para>To be described…</para>

</appendix>

</specification>
