<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.1//EN"
 "http://www.w3.org/XML/1998/06/xmlspec-v21.dtd" [
<!ENTITY doctype "NOTE">
<!ENTITY nickname "xml-pipeline">
<!ENTITY http-ident "http://www.w3.org/TR/">
<!ENTITY draft.month "02">
<!ENTITY draft.monthname "February">
<!ENTITY draft.day "28">

<!ELEMENT e:element-syntax
  (e:in-category*, e:attribute*, (e:empty|e:text|e:element|e:model|e:sequence|e:choice))
>
<!ATTLIST e:element-syntax
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
  xmlns:xs CDATA #IMPLIED
  xmlns:xi CDATA #IMPLIED
  xmlns:p CDATA #IMPLIED
  name NMTOKEN #REQUIRED
>
<!ELEMENT e:in-category EMPTY>
<!ATTLIST
  e:in-category name NMTOKEN #REQUIRED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:attribute (e:attribute-value-template|(e:constant|e:data-type)+)>
<!ATTLIST e:attribute
  name NMTOKEN #REQUIRED
  required (yes) #IMPLIED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:attribute-value-template (e:constant|e:data-type)+>
<!ATTLIST e:attribute-value-template
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:constant EMPTY>
<!ATTLIST
  e:constant value CDATA #REQUIRED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:data-type EMPTY>
<!ATTLIST e:data-type
  name NMTOKEN #REQUIRED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:empty EMPTY>
<!ATTLIST e:empty
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:text EMPTY>
<!ATTLIST e:text
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:element EMPTY>
<!ATTLIST e:element
  name NMTOKEN #REQUIRED
  repeat (zero-or-one|zero-or-more|one-or-more) #IMPLIED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:model EMPTY>
<!ATTLIST e:model
  name NMTOKEN #REQUIRED
  repeat (zero-or-one|zero-or-more|one-or-more) #IMPLIED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:sequence (e:element|e:model|e:choice)+>
<!ATTLIST e:sequence
  repeat (zero-or-one|zero-or-more|one-or-more) #IMPLIED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:choice (e:element|e:model|e:sequence)+>
<!ATTLIST e:choice
  repeat (zero-or-one|zero-or-more|one-or-more) #IMPLIED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>
<!ELEMENT e:element-syntax-summary EMPTY>
<!ATTLIST e:element-syntax-summary
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>

<!ENTITY % local.illus.class "|e:element-syntax|e:element-syntax-summary">
<!ATTLIST spec
  xmlns:xlink CDATA #IMPLIED
  xmlns:xi CDATA #IMPLIED
  xmlns:e CDATA #FIXED "http://www.w3.org/1999/XSL/Spec/ElementSyntax"
>

<!ENTITY % local.p.class "|xi:include">
<!ENTITY % local.annot.class "|xi:include">
<!ELEMENT xi:include EMPTY>
<!ATTLIST xi:include
        href    CDATA   #REQUIRED
        parse   (xml|text)      "xml"
        diff    CDATA   #IMPLIED
>

<!ENTITY draft.year "2002">
<!ENTITY iso6.doc.date "&draft.year;&draft.month;&draft.day;">
<!ENTITY draft-name "NOTE-xml-pipeline">
<!ENTITY namespaceName "http://www.w3.org/2002/02/xml-pipeline">
]>
<spec w3c-doctype="note">
<header>
<title>XML Pipeline Definition Language</title>
<version>Version 1.0</version>
<w3c-designation>&doctype;-&nickname;-&iso6.doc.date;</w3c-designation>
<w3c-doctype>W3C Note</w3c-doctype>
<pubdate><day>&draft.day;</day><month>&draft.monthname;</month>
<year>
&draft.year;</year>
</pubdate>
<publoc><loc href="&http-ident;&draft.year;/&doctype;-&nickname;-&iso6.doc.date;">&http-ident;&draft.year;/&doctype;-&nickname;-&iso6.doc.date;/</loc>
(in <loc href="&http-ident;&draft.year;/&doctype;-&nickname;-&iso6.doc.date;/Overview.html">HTML</loc>
and <loc href="&http-ident;&draft.year;/&doctype;-&nickname;-&iso6.doc.date;/Overview.xml">XML</loc>
with separate provision of the <loc href="http://www.w3.org/2002/02/xml-pipeline.xsd">Pipeline
schema</loc>) </publoc>
<latestloc><loc href="&http-ident;&nickname;/">&http-ident;&nickname;/</loc>
</latestloc>
<authlist>
<author><name>Norman Walsh</name><affiliation>Sun Microsystems,
Inc.</affiliation>
<email href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</email></author>
<author><name>Eve Maler</name><affiliation>Sun Microsystems,
Inc.</affiliation>
<email href="mailto:Eve.Maler@Sun.COM">Eve.Maler@Sun.COM</email>
</author>
</authlist>
<copyright>
<p>Copyright © 2001 <loc href="http://www.sun.com/">Sun
Microsystems,
Inc.</loc></p>
</copyright>
<abstract>
<p>This Note describes the features and syntax for XML Pipeline
Definition Language. Pipeline is an XML vocabulary for describing the
processing relationships between XML resources. A pipeline document
specifies the inputs and outputs to XML processes and
a pipeline controller uses this document to figure out the
chain of processing that must be executed in order to get a particular
result.
</p>
</abstract>
<status>
<p>This document is a submission to the World Wide Web Consortium
(see <loc href="/Submission/2002/01/">Submission
Request</loc>, <loc href="/Submission/2002/01/Comment">W3C Staff Comment</loc>) that defines a way to increase
interoperability
of multi-process XML applications. Comments to the authors are
welcome.</p>
<p>This Note is made available by W3C for discussion only.
Publication of
this Note by the W3C indicates no endorsement by W3C or the W3C
Team,
or any
W3C Members. The W3C has had no editorial control over the
preparation of
this Note. This document is a work in progress and may be updated,
replaced,
or rendered obsolete by other documents at any time.</p>
<p>For a full list of acknowledged submissions, see
<loc href="http://www.w3.org/Submission/">Acknowledged
Submissions to W3C</loc>. A list of current W3C technical documents
can be
found at the <loc href="http://www.w3.org/TR/">Technical
Reports</loc> page.</p>
</status>
<sourcedesc>
<p>Created in electronic form.</p>
</sourcedesc>
<langusage>
<language id="EN">English</language>
</langusage>
<revisiondesc>
<slist>
<sitem>October 2001: Submission made.</sitem>
</slist>
</revisiondesc>
</header>
<body>
<div1 id="intro">
<head>Introduction</head>
<p>There is a large and growing set of specifications that describe
processes
operating on <bibref ref="xml-rec"/> documents. Considering how
these
specifications
interact raises many issues. This specification will address
the issues
related to interoperability of applications that involve multiple
processes
operating on documents. </p>
<p>This specification is not generally concerned with the XML
parsing
process.
XML documents are here considered to be operated on as <bibref ref="infoset"/>
information sets. Parsing, with some appropriate level of support
for
<bibref ref="xml-names"/> and <bibref ref="xml-base"/>, is assumed to be a
well-defined
process that is a necessary precursor to any operation over an XML
document.</p>
<p>The processes of interest in this specification are those that
construct,
inspect, augment, or extract from information sets. A process begins
with
zero or more information sets and produces zero or more information
sets (it
may also produce ancillary information, such as whether it succeeded
or failed).</p>
<p>Although some, perhaps most, applications work with concrete
object models
that are not identical to the Infoset, it is still useful to
describe
the
processing model in terms of the Infoset. In practice, applications
will
use SAX event streams or DOM object models, or even use XML
representations
of infosets, to pass information back and forth.</p>
<div2 id="terminology">
<head>Terminology</head>
<p><termdef id="dt-must" term="Must, May, etc.">The key words
<term>must</term>, <term>must not</term>, <term>required</term>,
<term>shall</term>, <term>shall not</term>, <term>should</term>,
<term>should not</term>, <term>recommended</term>, <term>may</term>, and
<term>optional</term>
in this specification are to be interpreted as described in
<bibref ref="rfc2119"/>.</termdef></p>
</div2>
<div2 id="motivation">
<head>Motivation</head>

<p>Applications, for example many web services, can be implemented by
integrating business processing and standard XML processing. Business
processes vary greatly among different applications and environments,
but XML processing is often mostly a matter of composing the
individual operations described by separate specifications
(validation, transformation, and so on) in a useful order.</p>

<p><specref ref="usecases"/> provides use cases that demonstrate
that
no fixed
order of processing can be imposed. Although it would in many ways
be
easier
to build interoperable systems if a fixed order could be defined,
any
such
order would impede some classes of applications.</p>
<p>However, the order of processing actually used in any one
application is
an important aspect of the semantics of the application, in that it
might
be imperative that <emph>some</emph> operations precede others; if
some other
order is applied, the results might be incorrect. It follows that
the
ability
to identify an underlying processing model and describe how
processing is
to proceed is an imperative precondition to developing interoperable
applications.</p>
<p>Note that for any given application, the processes might require
a
partial
order, and not necessarily a total order. In other words:</p>
<olist>
<item><p>There are dependency relationships among the processes and
any processing
order that violates these dependencies is erroneous. </p></item>
<item><p>But <emph>any</emph> order that does not violate the
dependency relationships
is equally correct.</p></item>
</olist>
<p>The satisfaction of dependencies between processes is already a
well-understood
problem in software development; it forms the heart of systems like
<function>make</function>
and <bibref ref="ant"/>.</p>
<p>This specification describes a declarative XML vocabulary that
addresses
this need in a way that is tuned for XML processing.</p>
</div2>
<div2>
<head>Scope</head>
<p>The focus of this specification is intentionally quite narrow, in
order
to provide a working solution for the most pressing needs first. It
is clear
that a number of useful extensions could be made to support
processing meta-models,
wildcards in process inputs and outputs, and so on. These features
might be
developed over time, but they are not critical to solving the most
immediate
problems.</p>
<p>It is clear that addressing the whole problem will ultimately
require APIs
that allow a process manager to initiate individual processes as
necessary.
This specification does not attempt to address this issue. However,
the software
development community has already begun to do so with the
development
of SAX,
TRaX, and other APIs.</p>
<p>The identification of a processing model itself could be
performed
entirely
at the programming API level, but this approach seems to set the bar
too high.
True interoperability will be achieved only when it is possible for
end-users
working with stock XML tools to build processing models for
themselves. Thus,
this specification proposes an XML vocabulary rather than an
API.</p>
</div2>
<div2 id="classification">
<head>Process Classification</head>
<p>The following process classification provides a framework in
which
to discuss
the operations of applications in general terms:</p>
<olist>
<item><p>Constructive processes. These are processes that build new
information
sets. Processes which produce a new information set or add
information items
or property values defined in <bibref ref="infoset"/> (such as
elements and
attributes) to an existing information set are described as
constructive;
the latter scenario is an example of transformation, which is a
subclass of
construction. An <bibref ref="xinclude"/> process is constructive,
as
are <bibref ref="xslt"/> and <bibref ref="xquery"/>.</p></item>
<item><p>Augmenting processes. Processes, like <bibref ref="xml-schema"/>
validation or <bibref ref="css"/> styling, that add new <emph>types</emph>
of information items or properties to an existing information set
are
performing
some sort of augmentation. A schema that adds default element or
attribute
values, as well as adding datatype information, is constructive as
well as
augmenting. </p></item>
<item><p>Inspection processes. Processes that inspect but do not
modify a
document, such as <bibref ref="schematron"/> or <bibref ref="relax-ng"/> validation,
fall into this category. Verifying a digital signature might also
leave the
document unchanged, indicating somehow that the process passed or
failed.</p>
</item>
<item><p>Extraction processes. Some processes reach into an existing
information
set and remove or copy parts of it for further processing. Processes
that
use <bibref ref="xpointer"/> (such as <bibref ref="xlink"/> and
XInclude)
fall into this category by virtue of their ability to address
specific parts
of a document. XML Schema processes are extractive in that they
operate on
namespace-specific portions of information sets. Some processes
might
decrypt
only a region of encrypted content. We note that such processes
might
have
different characteristics than more global operations, especially
with respect
to implementation efficiency.</p></item>
<item><p>Packaging processes. Distributed or federated web
applications will
need to package a collection of resources to transmit to another
location
or service. This packaging could be performed using SOAP with
attachments <bibref ref="soap"/>, for example. We note that the whole issue of packaging
resources
and providing a useful manifest is not adequately addressed.</p>
</item>
</olist>
<p>It is important to note that the classes are not mutually
exclusive, as
shown, for example, by the fact that some schemas can cause a
process
to perform
construction, augmentation, and extraction. In addition, processes
can be
hierarchical, with a constructive process performing a bit of
validation or
extraction, for example.</p>
<p>The fact that documents can be augmented or transformed raises
another
set of issues with respect to addressing into augmented or
transformed results. <bibref ref="style-note"/> discusses this at some length.</p>
</div2>
</div1>
<div1 id="xpipe">
<head>XML Pipeline Definition Language</head>
<p><termdef id="dt-xmlpipeline" term="XML Pipeline Definition Language">The <term>XML Pipeline Definition Language</term>
(<quote>the Pipeline
language</quote>) is a vocabulary for describing the processing
relationships
between XML resources.</termdef> This section describes Pipeline
language
concepts, defines the language, and defines the required behavior of
applications
that take the language as input.</p>
<p><termdef id="dt-pipelinedocument" term="Pipeline  Document">A document that is an instance of the XML Pipeline
Definition Language
is a <term>pipeline document</term>.</termdef> <termdef id="dt-pipelinecontroller" term="Pipeline Controller">A <term>pipeline controller</term> is an
application
that builds a resource identified in the pipeline document by
determining
and then executing the processes necessary to produce it.</termdef>
</p>
<p>The high-level requirements of the Pipeline language are as
follows:</p>
<olist>
<item><p>It shall be expressed in XML.</p>
<p>It should be possible to author and manipulate pipeline documents
using
standard XML tools.</p></item>
<item><p>It shall be as declarative as possible.</p>
<p>Declarative languages are more amenable to optimization and other
compilation
techniques. It should be relatively easy to implement a conformant
pipeline
controller, but it should also be possible to build a sophisticated
controller
that can perform parallel operations, lazy or greedy processing, and
other
optimizations.</p></item>
<item><p>It shall be neutral with respect to implementation
language.</p>
<p>Just as there is no single language that can process XML
exclusively, there
should be no single language that can implement the Pipeline
language
exclusively.
It should be possible to interoperably exchange pipeline documents
across
computing platforms.</p></item>
</olist>
<div2 id="xpipe.concepts">
<head>Resources and URIs in the Pipeline Language</head>
<p>An individual process produces one or more result resources from
some set
of input resources. The Pipeline language uses URIs to identify
resources
(both inputs and results). A pipeline controller uses these URIs to
keep track
of the resources that it has available. In the context of a
pipeline,
every
resource is identified by exactly one URI. Two resources are the
same
if they
have the same URI. Two URIs are the same if they are lexically
equivalent.</p>
<p>To indicate that an inspection process (a process that does not
modify
an input infoset) has succeeded, the Pipeline forces the process to
produce
a result with a new URI. The resulting information set will be
identical to
the input information set, but its new label allows the pipeline
controller
to keep track of its status.</p>
<p>Note that the processing of URIs in pipeline documents depends on
<bibref ref="xml-base"/> processing.</p>
</div2>
<div2>
<head>Information Sets and Pipeline Controller Behavior</head>
<p>The resources operated on by a pipeline controller are considered
to consist
of XML information sets.</p>
<note>
<p>In practice, some information set properties introduce
dependencies between
information items that makes composition non-trivial:</p>
<ulist>
<item><p>XML Schema validity properties introduce dependencies on
descendants. </p>
</item>
<item><p>The in-scope namespaces property can introduce dependencies
(at least
implicitly) on ancestors. </p></item>
<item><p>Markers, as have existed in earlier drafts of <bibref ref="infoset"/>,
introduce dependencies among siblings. </p></item>
</ulist>
<p>These dependencies have to be addressed by the specification of
each process
that operates on information sets.</p>
</note>
<p>Processing begins with an initial set of zero or more information
sets,
the name of some target that is the desired result, and a pipeline
document
that describes how documents are related to each other. Every
relationship
has three parts: a set of input information sets, a process, and a
set of
result information sets. For example, the result <emph>R.xml</emph>
might
be related to a set of inputs, <emph>S.xml</emph> and <emph>T.xsl</emph>,
by an XSLT transformation. Informally, we say that the process
identified
by a relationship can produce the results from its inputs.</p>
<p>Processing begins with the pipeline document and the URI of the
desired
target.</p>
<olist>
<item><p>If the target is up to date, no processing is required and
the target
is returned. <termdef id="dt-up-to-date" term="Up-to-date">Given two
information
sets A and B, A is <term>up to date</term> with respect to B if A
exists and
unless B is known to be more recent than A. A target is up to date
if
and
only if it is up to date with respect to all of the resources it
depends on.</termdef></p>
</item>
<item><p>If the target is not up to date, the controller identifies
the process
from the pipeline document that can produce the target. It does this
by examining
the <el>output</el> elements of each process, searching for one that
has a <att>label</att>
whose value matches the target.</p>
<p>It is an error if there is not exactly one such process in the
pipeline
document. If there is no such process, the target cannot be
produced;
if there
is more than one, the processing is ambiguous.</p></item>
<item><p>Assuming that exactly one process is found, the controller
considers
each of the information sets that are inputs to that process as
intermediate
targets. These intermediate targets are resolved in exactly the same
manner
as the principal target. </p>
<p>It is an error for processes to depend directly or indirectly on
their
outputs. In other words, if Process 1 produces C from B and Process
2
produces
B from A, it is an error for the pipeline document to contain a
process that
produces A from B or C (or any intermediate target produced from B
or
C). </p>
</item>
<item><p>When all of the input documents are up to date, and no
errors have
occurred, the process is executed to produce the output result(s)
and
the
target is returned. </p></item>
<item><p>If an error occurs, processing terminates. Each process can
selectively
ignore errors and return appropriate error documents in place of its
normal
outputs.</p></item>
</olist>
<p>Note that the order of the processes specified in the pipeline
document is insignificant. Users need not figure out the right order
for the whole pipeline; they need only declare the dependencies.
Naturally, dependencies can be made linear, forcing a fixed order if
that is what is desired.</p>
</div2>
<div2>
<head>Example</head>
<p>We consider a simple application of <bibref ref="xinclude"/>,
<bibref ref="xml-schema"/>
validation, and <bibref ref="xslt"/> in which the following order is
required:</p>
<olist>
<item><p>Begin with a source document, <emph>mydoc.xml</emph>. </p>
</item>
<item><p>Expand any XInclude directives that it contains. </p>
</item>
<item><p>Make sure that it is schema-valid with respect to <emph>someschema.xsd</emph>. </p>
</item>
<item><p>If it is, transform it with <emph>mystyle.xsl</emph>, and
return
the result. Otherwise return an error document.</p></item>
</olist>
<p>The following example shows what the corresponding pipeline
document might
look like.</p>
<example>
<head>Simple Pipeline Document</head>
<eg xml:space="preserve">&lt;pipeline xmlns="http://www.w3.org/2002/02/xml-pipeline"
          xml:base="http://example.org/"&gt;

  &lt;param name="target" select="'result'"/&gt;

  &lt;processdef name="xinclude.p" definition="org.example.xml.Xinclude"/&gt;
  &lt;processdef name="validate.p" definition="org.example.xml.XmlSchema"/&gt;
  &lt;processdef name="transform.p" definition="org.example.xml.XSLT"/&gt;

  &lt;process id="p3" type="transform.p"&gt;
    &lt;input name="stylesheet" label="mystyle.xsl"/&gt;
    &lt;input name="document" label="valid"/&gt;
    &lt;output name="result" label="result"/&gt;
    &lt;param name="chunk"&gt;0&lt;/param&gt;
  &lt;/process&gt;

  &lt;process id="p2" type="validate.p"&gt;
    &lt;input name="document" label="xresult"/&gt;
    &lt;input name="schema" label="someschema.xsd"/&gt;
    &lt;output name="result" label="valid"/&gt;
    &lt;error name="invalid" label="#invalidDocument"/&gt;
  &lt;/process&gt;

  &lt;process id="p1" type="xinclude.p"&gt;
    &lt;input name="document" label="myfile.xml"/&gt;
    &lt;output name="result" label="xresult"/&gt;
  &lt;/process&gt;

  &lt;document name="invalidDocument"&gt;
    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
	&lt;title&gt;Failure!&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
	&lt;h1&gt;Your job failed because the document is invalid.&lt;/h1&gt;
      &lt;/body&gt;
    &lt;/html&gt;
  &lt;/document&gt;
&lt;/pipeline&gt;
</eg>
</example>
<p>Assume that initially, the pipeline controller is handed this
pipeline
document along with <emph>myfile.xml</emph>, <emph>mystyle.xsl</emph>, and <emph>someschema.xsd</emph>
(all with the base URI <emph>http://example.org/</emph>). For the
purpose
of this example, assume that no other documents exist when
processing
begins.
The pipeline controller proceeds along the following lines:</p>
<olist>
<item><p>The target information set, <emph>http://example.org/result</emph>,
will be inferred from the default value of the <att>target</att>
parameter
and the <att>xml:base</att> setting (unless some other target was
specified
through a command line or other option).</p></item>
<item><p>The process <quote>p3</quote> has an <el>output</el>
parameter with
the label <emph>http://example.org/result</emph>, so it has to be
run
to produce
the target. </p></item>
<item><p>The <quote>p3</quote> process depends on <emph>mystyle.xsl</emph>,
which the controller already has, and <emph>valid</emph>. </p>
</item>
<item><p>The process <quote>p2</quote> has an <el>output</el>
parameter with
the label <emph>valid</emph>, so it has to be run to produce the
intermediate
target. </p></item>
<item><p>The <quote>p2</quote> process in turn depends on <emph>xresult</emph>
in addition to the schema document already available. </p></item>
<item><p>The process <quote>p1</quote> has an <el>output</el>
parameter with
the label <emph>xresult</emph>, so it has to be run to produce the
intermediate
target. </p></item>
<item><p>The only input to the <quote>p1</quote> process already
exists, so
the <quote>xinclude.p</quote> process is executed according to
whatever definition
was provided. </p></item>
<item><p>Assuming that <quote>p1</quote> runs without error, it
produces the <emph>xresult</emph>
that we need to run <quote>p2</quote>.</p></item>
<item><p>With all of the inputs to <quote>p2</quote> available, it
can be
executed, producing the necessary <emph>valid</emph>. </p></item>
<item><p>Finally, <quote>p3</quote> can be executed, producing the
result.
The controller succeeds. </p></item>
<item><p>If at any point an error occurs, the controller returns
either a
specified error document or a built-in error document and fails.
</p>
</item>
</olist>
<p>In this example, there is only one order of processing that can
satisfy
all of the dependencies: <quote>xinclude.p</quote> then <quote>validate.p</quote>
then <quote>transform.p</quote>. In a more complex pipeline,
multiple
or even
parallel orders are possible. For example, in <specref ref="pipeline.xpipe"/>,
all of the <emph>*.ex</emph> targets are independent.</p>
</div2>
<div2 id="xpipe.definition">
<head>Definition of the Pipeline Language</head>
<p>The following sections define the rules for pipeline documents
and
the
required semantics of elements in the Pipeline language.</p>
<div3 id="xpipe.schema">
<head>XML Schema for the Pipeline Language</head>
<p>The following XML Schema describes the Pipeline language. The
<emph>p:</emph>
namespace prefix is used here and in examples in the following
sections to
denote the Pipeline namespace, <emph>http://www.w3.org/2002/02/xml-pipeline</emph>. A few
co-occurrence
constraints are described normatively in the text of the following
sections.</p>
<example>
<head>Pipeline XML Schema</head>
<eg xml:space="preserve">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
           xmlns:p='http://www.w3.org/2002/02/xml-pipeline'
           targetNamespace='http://www.w3.org/2002/02/xml-pipeline'
           elementFormDefault='qualified'&gt;

  &lt;!-- $Id: Overview.xml,v 1.3 2002/02/28 09:37:05 dom Exp $ --&gt;

  &lt;xs:complexType name='pipeline'&gt;
    &lt;xs:choice minOccurs='1' maxOccurs='unbounded'&gt;
      &lt;xs:element ref='p:processdef'/&gt;
      &lt;xs:element ref='p:param'/&gt;
      &lt;xs:element ref='p:process'/&gt;
      &lt;xs:element ref='p:document'/&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name='processdef'&gt;
    &lt;xs:choice minOccurs='0' maxOccurs='unbounded'&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:attribute name="name" type="xs:ID" use="required"/&gt;
    &lt;xs:attribute name="definition" type="xs:string"/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name='process'&gt;
    &lt;xs:choice minOccurs='0' maxOccurs='unbounded'&gt;
      &lt;xs:element ref='p:input'/&gt;
      &lt;xs:element ref='p:output'/&gt;
      &lt;xs:element ref='p:error'/&gt;
      &lt;xs:element ref='p:param'/&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:attribute name='type' type='xs:IDREF' use="required"/&gt;
    &lt;xs:attribute name='ignore-errors' type='xs:boolean'/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name='input' mixed="true"&gt;
    &lt;xs:choice minOccurs='0' maxOccurs='unbounded'&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:attribute name='name' type='xs:string'/&gt;
    &lt;xs:attribute name='label' type='xs:anyURI'/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name='output'&gt;
    &lt;xs:choice minOccurs='0' maxOccurs='unbounded'&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:attribute name='name' type='xs:string'/&gt;
    &lt;xs:attribute name='label' type='xs:anyURI' use="required"/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name='error'&gt;
    &lt;xs:choice minOccurs='0' maxOccurs='unbounded'&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:attribute name='name' type='xs:string'/&gt;
    &lt;xs:attribute name='label' type='xs:anyURI'/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name='document'&gt;
    &lt;xs:choice minOccurs='0' maxOccurs='unbounded'&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:attribute name='label' type='xs:anyURI' use="required"/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name='param' mixed="true"&gt;
    &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
      &lt;xs:any namespace='##other' processContents='skip'/&gt;
    &lt;/xs:choice&gt;
    &lt;xs:attribute name='id' type='xs:ID'/&gt;
    &lt;xs:attribute name='name' type='xs:string' use="required"/&gt;
    &lt;xs:attribute name='select' type='xs:string'/&gt;
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:element name="pipeline" type="p:pipeline"/&gt;
  &lt;xs:element name="processdef" type="p:processdef"/&gt;
  &lt;xs:element name="process" type="p:process"/&gt;
  &lt;xs:element name="input" type="p:input"/&gt;
  &lt;xs:element name="output" type="p:output"/&gt;
  &lt;xs:element name="error" type="p:error"/&gt;
  &lt;xs:element name="document" type="p:document"/&gt;
  &lt;xs:element name="param" type="p:param"/&gt;
&lt;/xs:schema&gt;
</eg>
</example></div3>
<div3 id="xpipe.constructs">
<head>Pipeline Document Constructs</head>
<p>A pipeline document primarily contains elements from the
pipeline
namespace.
The processing pipeline begins with the root element, <el>pipeline</el>.</p>
<p>In certain locations, the pipeline document may contain any
element not
from the pipeline namespace, provided that the expanded-name of the
element
has a non-null namespace URI. The presence of such foreign content
must not
change the behavior of pipeline elements and functions defined in
this specification.
Thus, a pipeline controller is always free to ignore such foreign
content,
and must ignore a foreign element or attribute (other than
<att>xml:base</att>)
without giving an error if it does not recognize the namespace
URI.</p>
<p>It is an error for foreign elements to contain elements from the
pipeline
namespace.</p>
<div4 id="elem.pipeline">
<head>The <el>pipeline</el> element</head>
<e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="pipeline"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:choice repeat="one-or-more"><e:element name="processdef"/><e:element name="param"/><e:element name="process"/><e:element name="document"/><e:model name="foreign-content"/></e:choice></e:element-syntax>
<p>The <el>pipeline</el> element must be the root of a pipeline
document.</p>
<p>The <el>pipeline</el> element contains a mixture of one or more
process
definitions (<el>processdef</el>), top-level parameters (<el>param</el>),
processes (<el>process</el>), other labeled documents (<el>document</el>),
and foreign elements. It may contain foreign attributes.</p>
</div4>
<div4 id="elem.processdef">
<head>The <el>processdef</el> element</head><e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="processdef"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="name" required="yes"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="definition"><e:data-type name="xs:string"/></e:attribute><e:choice repeat="zero-or-more"><e:model name="foreign-content"/></e:choice></e:element-syntax>
<p>The <el>processdef</el> element associates a name with an
external
process
definition. Subsequent <el>process</el> elements must identify the
process
that they wish to perform by reference to a named process
definition.</p>
<p>The value of the <att>definition</att> attribute is
implementation
defined.
Process names may have multiple definitions (there may be multiple
<el>processdef</el>
elements with the same <att>name</att>). If a controller understands
more
than one definition, it should use the first definition (in pipeline
document
order) that it understands.</p>
<p>The <el>processdef</el> element may contain foreign elements and
attributes.</p>
</div4>
<div4 id="elem.process">
<head>The <el>process</el> element</head><e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="process"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="type" required="yes"><e:data-type name="xs:IDREF"/></e:attribute><e:attribute name="ignore-errors"><e:data-type name="xs:boolean"/></e:attribute><e:choice repeat="zero-or-more"><e:element name="input"/><e:element name="output"/><e:element name="error"/><e:element name="param"/><e:model name="foreign-content"/></e:choice></e:element-syntax>
<p>Each <el>process</el> element describes one <quote>step</quote>
in
the
pipeline. A process must have a <att>type</att> attribute which
refers to
the value of the <att>name</att> attribute on one of the <el>processdef</el>
elements in this pipeline document. The <el>process</el> element may
have
an <att>id</att> attribute.</p>
<p>A <el>process</el> may contain <el>input</el>s, <el>output</el>s,
<el>param</el>s,
and <el>error</el>s as well as foreign content.</p>
<p>The <el>input</el>s to a process are the information sets on
which
it depends.
The <el>output</el>s of a process are the information sets that it
produces.
If an error occurs, a pipeline controller may produce <el>error</el>
information
sets instead of its normal outputs. Parameters, if there are any,
will be
passed to the process if it executes.</p>
<p>A process is executed if and only if at least one of its <el>output</el>s
is not up to date with respect to at least one of its <el>input</el>
s. If
a process is executed, it is the responsibility of the pipeline
controller
to marshal the arguments appropriately for the process.</p>
<p>The dependency evaluation process is recursive. If Process 2
depends on
information set A that is produced by Process 1, the dependencies on
A described
by Process 1 must be evaluated, and information set A may be updated
by Process
1, before the controller can determine if the outputs of Process 2
are up
to date with respect to A.</p>
<p>If the process has unnamed <el>input</el>s, they cannot be passed
to the
controller, although they are treated as dependencies and can cause
the controller
to execute.</p>
<p>It is an error for more than one process to produce the same
information
set.</p>
<p>The pipeline controller is responsible for storing and tracking
output
documents. Arguments are passed to processes by name, not position,
so the
order of the children of the <el>process</el> element is
irrelevant.</p>
<p>When a process is executed, it either succeeds or fails. If it
succeeds,
it produces its named <el>output</el> information sets and returns
an
indication
of success.</p>
<p>If it fails, processing either terminates or proceeds. A process
may proceed
only if both of the following conditions are met:</p>
<olist>
<item><p>The <att>ignore-errors</att> attribute on this process is
set to <code>true</code>.</p>
</item>
<item><p>For each <el>output</el> information set there is a
corresponding <el>error</el>
information set. A corresponding information set is one within the
same <el>process</el>
that has the same <att>name</att>.</p></item>
</olist>
<p>If the process is to proceed, the <el>error</el> information sets
are used
to produce its named <el>output</el> information sets and an
indication of
success is returned.</p>
<p>If the process fails, no information sets are produced and an
indication
of failure is returned. The failure of any executed process causes
the pipeline
controller to abandon the task of building the target.</p>
</div4>
<div4 id="elem.input">
<head>The <el>input</el> element</head><e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="input"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="name"><e:data-type name="xs:string"/></e:attribute><e:attribute name="label"><e:data-type name="xs:anyURI"/></e:attribute><e:choice repeat="zero-or-more"><e:model name="foreign-content"/></e:choice></e:element-syntax>
<p>An <el>input</el> element identifies an information set. An <el>input</el>
may be named or anonymous (indicated by the absence of a value for
the <att>label</att>
attribute). Names must be unique within a <el>process</el>. The
content of
the input information set comes from one of three locations:</p>
<olist>
<item><p>If the <el>input</el> has no <att>label</att>, the content
of the
element itself is considered to be the information set.</p></item>
<item><p>If the <att>label</att> attribute matches the <att>label</att> of
some <el>output</el> element somewhere in the pipeline, that output
document
is the information set.</p></item>
<item><p>Otherwise, the resource is retrieved from the URI in the
<att>label</att>
attribute.</p></item>
</olist>
<p>It is an error for the <att>label</att> of an <el>input</el>
element to
match the label of an <el>output</el> of the same <el>process</el>.
The label
is a URI; if it is relative, it is interpreted with respect to the
current
base URI as defined by <bibref ref="xml-base"/>. </p>
</div4>
<div4 id="elem.output">
<head>The <el>output</el> element</head><e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="output"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="name"><e:data-type name="xs:string"/></e:attribute><e:attribute name="label" required="yes"><e:data-type name="xs:anyURI"/></e:attribute><e:choice repeat="zero-or-more"><e:model name="foreign-content"/></e:choice></e:element-syntax>
<p>An <el>output</el> element associates a label with an information
set produced
by a process. At most one result information set can be anonymous,
all the
others must be named. Names must be unique within a process.</p>
<p>When a process is executed, it is the responsibility of the
pipeline controller
to collect the result information sets produced by the controller,
associate
them with the appropriate output statements, and store them for use
in evaluating
other processes.</p>
<p>The <el>output</el> must also have a <att>label</att> which must
be unique
within a <el>pipeline</el>. The label is a URI; if it is relative,
it
is interpreted
with respect to the current base URI as defined by <bibref ref="xml-base"/>.</p>
</div4>
<div4 id="elem.error">
<head>The <el>error</el> element</head><e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="error"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="name"><e:data-type name="xs:string"/></e:attribute><e:attribute name="label"><e:data-type name="xs:anyURI"/></e:attribute><e:choice repeat="zero-or-more"><e:model name="foreign-content"/></e:choice></e:element-syntax>
<p>If a process fails, the <el>error</el> element may be used to
provide an
alternate result for the normal <el>output</el>s of a process.</p>
<p>The content of the error information set comes from one of two
locations:</p>
<olist>
<item><p>If the <el>error</el> has no <att>label</att>, the content
of the
element itself is considered to be the information set.</p></item>
<item><p>Otherwise, the resource is retrieved from the URI in the
<att>label</att>
attribute.</p></item>
</olist>
</div4>
<div4 id="elem.param">
<head>The <el>param</el> element</head>

<e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="param"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="name" required="yes"><e:data-type name="xs:string"/></e:attribute><e:attribute name="select"><e:data-type name="xs:string"/></e:attribute><e:choice repeat="zero-or-more"><e:model name="foreign-content"/></e:choice></e:element-syntax>

<p>Additional parameters may be passed to a process with the <el>param</el> element. </p>

<p>Pipeline parameters are named. It is the responsibility of the
pipeline controller to marshal them appropriately for the actual
process used.</p>

<p>If the <att>select</att> attribute is specified, its content
is the value of the parameter, otherwise the content of the
<el>param</el> element is the value.
</p>

</div4>
<div4 id="elem.document">
<head>The <el>document</el> element</head><e:element-syntax xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" name="document"><e:attribute name="id"><e:data-type name="xs:ID"/></e:attribute><e:attribute name="label" required="yes"><e:data-type name="xs:anyURI"/></e:attribute><e:choice repeat="zero-or-more"><e:model name="foreign-content"/></e:choice></e:element-syntax>
<p>The <el>document</el> element associates labels with information
sets that
may be used as the <el>input</el> to <el>process</el>es (or <el>error</el>s)
in the <el>pipeline</el>.</p>
<p>The <el>document</el> element is shorthand for a common <el>process</el>
construct. Given the following document element:</p>
<eg xml:space="preserve">&lt;p:document label="someUri"&gt;
  &lt;foo/&gt;
&lt;/p:document&gt;</eg>
<p>and a process definition for the "identity" transformation, the
<el>document</el>
element has precisely the same effect as the following <el>process</el> definition:</p>
<eg xml:space="preserve">&lt;p:process type="identity"&gt;
  &lt;p:input&gt;
    &lt;foo/&gt;
  &lt;/p:input&gt;
  &lt;p:output label="someUri"/&gt;
&lt;/p:process&gt;</eg>
</div4>
</div3>
</div2>
</div1>
</body><back>
<div1 id="usecases">
<head>Use Cases</head>
<p>The need for a pipeline definition language is motivated by a
selection
of use cases.</p>
<div2 id="usecase.business">
<head>Simple Business Transactions</head>
<p>Two parties agree to conduct business electronically. They will
exchange
purchase orders, invoices, and other business documents using some
appropriate
transport protocol. Before responding to a request, each party
wishes
to validate
the request against a known schema so that errors do not result in
mismanaged
funds.</p>
<p>This use case depends on approximately the following processing
order:</p>
<olist>
<item><p>Documents must be parsed and verified as well-formed with
respect
to <bibref ref="xml-rec"/>, <bibref ref="xml-names"/>, and <bibref ref="xml-base"/>.</p>
</item>
<item><p>Any XInclude elements must be expanded.</p></item>
<item><p>Validation must be performed against a specific schema,
ignoring
any schema location information in the document.</p></item>
</olist>
</div2>
<div2 id="usecase.upgrade">
<head>Transforming to a New Schema</head>
<p>A company has a collection of documents in "XYZ Schema V1.0". A
new release,
"XYZ Schema V1.1" is released which contains a small number of
backwards incompatible
(but programmatically correctable) changes and a few new features.
The company
needs to to update its existing documents to the new schema in order
to exploit
the new features.</p>
<p>This use case depends on approximately the following processing
order:</p>
<olist>
<item><p>Documents must be parsed and verified as well-formed with
respect
to XML 1.0, XML Namespaces, and XML Base.</p></item>
<item><p>Validation must be performed against a specific "XYZ Schema
V1.0"
schema, ignoring any schema location information in the document (in
order
to be sure that local extensions will not interfere with the
automated conversion
process).</p></item>
<item><p>Documents must be transformed with a specific stylesheet,
ignoring
any style information in the document. </p></item>
<item><p>The transformation must preserve all existing markup (it
must be
an identity transformation) except for the specific changes required
to convert
to V1.1. (In particular, it must preserve existing XInclude
elements.) </p>
</item>
<item><p>Schema location information in the document must be
updated.
</p>
</item>
<item><p>The converted document must be validated against the V1.1
schema,
making use of any local schema information that is present, in order
to assure
that the transformation did not introduce errors. </p></item>
</olist>
</div2>
<div2 id="usecase.publishing">
<head>Document Publishing</head>
<p>A company has a collection of documents in XML. It wishes to
publish them
on a periodic basis.</p>
<p>This use case depends on approximately the following processing
order:</p>
<olist>
<item><p>Documents must be parsed and verified as well-formed with
respect
to XML 1.0, XML Namespaces, and XML Base.</p></item>
<item><p>The document must be schema validated using local schema
information
that is present. </p></item>
<item><p>The document must be transformed and published either with
the stylesheet
information in the document or with a specific set of stylesheets.
</p></item>
</olist>
</div2>
<div2 id="usecase.bushub">
<head>Business Transaction Hub</head>
<p>A company has built some sort of a hub for doing business
transaction processing.
It accepts documents in a variety of schemas, transforms them to
some
internal
schema, operates on those documents, and returns results in the
schema appropriate
for the requestor.</p>
<p>This use case depends on approximately the following processing
order:</p>
<olist>
<item><p>Documents must be parsed and verified as well-formed with
respect
to XML 1.0, XML Namespaces, and XML Base.</p></item>
<item><p>XInclude elements must be expanded. </p></item>
<item><p>The document must be schema validated using either the
schema identified
by the document or an out of band schema. </p></item>
<item><p>The document must be transformed to the "hub schema". This
new document
may use XInclude elements to refer to standard boilerplate or other
constant
information. </p></item>
<item><p>XInclude elements must be expanded again. </p></item>
<item><p>Validate again, to make sure the transformation did not
introduce
errors. </p></item>
<item><p>Perform whatever processing is required. </p></item>
<item><p>Transform the result into an appopriate outbound schema.
</p></item>
<item><p>Perhaps expand XIncludes again. </p></item>
</olist>
</div2>
<div2 id="usecase.webservice">
<head>Web Service Implementation</head>
<p>Consider a web service that is part of some larger service chain.
It might
need to operate only on portions of a document (because other
portions are
encrypted, for example, or simply because it only deals with a
certain namespace).
It might perform validation on only some elements, for example, or
expand
only certain XIncludes. </p>
<p>This use case depends on approximately the following processing
order:</p>
<olist>
<item><p>Documents must be parsed and verified as well-formed with
respect
to XML 1.0, XML Namespaces, and XML Base.</p></item>
<item><p>Selected portions of the document must be schema validated.
</p>
</item>
<item><p>XInclude processing must be performed selectively. </p>
</item>
<item><p>The information set may be augmented or transformed as a
result of
the web services operation. </p></item>
</olist>
</div2>
</div1>
<div1 id="pipeline.xpipe">
<head>A Complex Example</head>
<p>The following pipeline document describes the build process for
the HTML
version of this specification. This specification consists of three
source
XML files (<emph>pipeline.xml</emph>, <emph>example1.xml</emph>, and
<emph>xml-pipeline.xsd</emph>),
and a small set of XML files derived from the XSD document (<emph>*.ex</emph>).
They are all stitched together in various ways by some XSL
stylesheets and
an XInclude processor.</p>
<p>The pipeline controller in this case is a command-line processor.
Each
of the processes is defined to be a standard command line that is
executed
to perform the process. All of the information sets in this case are
XML files
on disk, but that is not necessary (or even desirable).</p>

<p>Note that an implementation-specific XPath-like notation is used
here in the <att>definition</att> attribute for the
<el>processdef</el> elements.  While this specification does not
mandate this notational strategy, it might prove fruitful in building
common APIs to achieve added interoperability.</p>

<example>
<head>pipeline.xpipe Document</head>
<eg xml:space="preserve">&lt;pipeline xmlns="http://www.w3.org/2002/02/xml-pipeline"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;

  &lt;processdef name="xinclude"
   definition="xinclude {$document} {$result}"/&gt;
  &lt;processdef name="validate.dtd"
   definition="validate.dtd {$document} {$result}"/&gt;
  &lt;processdef name="validate.xsd"
   definition="validate.xsd {$document} {$schema} {$result}"/&gt;
  &lt;processdef name="transform"
   definition="xslt {$document} {$stylesheet} {$result} {$#param}"/&gt;
  &lt;processdef name="tidy"
   definition="tidy -iq -latin1 -n {$document} &amp;gt; {$result}"/&gt;
  &lt;processdef name="clean"
   definition="rm {$opts} {$glob}"/&gt;
  &lt;processdef name="makediff"
   definition="cvsdiffmk -d {$doctype} -r {$DIFFV1} -r {$DIFFV2}
               -o {$result} {$document}"/&gt;

  &lt;param name="target" select="'pipeline.html'"/&gt;

  &lt;process type="tidy"&gt;
    &lt;input name="document" label="/tmp/pipeline.html"/&gt;
    &lt;output name="result" label="pipeline.html"/&gt;
  &lt;/process&gt;

  &lt;process type="xinclude"&gt;
    &lt;input name="document" label="pipeline.xml"/&gt;
    &lt;output name="result" label="/tmp/pipeline.xml"/&gt;
    &lt;input label="pipeline.ex"/&gt;
    &lt;input label="processdef.ex"/&gt;
    &lt;input label="process.ex"/&gt;
    &lt;input label="input.ex"/&gt;
    &lt;input label="output.ex"/&gt;
    &lt;input label="error.ex"/&gt;
    &lt;input label="document.ex"/&gt;
    &lt;input label="param.ex"/&gt;
    &lt;input label="xml-pipeline.xsd"/&gt;
    &lt;input label="example1.xml"/&gt;
    &lt;input label="pipeline.xpipe"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="/tmp/pipeline.xml"/&gt;
    &lt;input name="stylesheet" label=".stylesheets/xmlspec.xsl"/&gt;
    &lt;output name="result" label="/tmp/pipeline.html"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="pipeline.ex"/&gt;
    &lt;param name="element" select="'pipeline'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="processdef.ex"/&gt;
    &lt;param name="element" select="'processdef'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="process.ex"/&gt;
    &lt;param name="element" select="'process'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="input.ex"/&gt;
    &lt;param name="element" select="'input'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="output.ex"/&gt;
    &lt;param name="element" select="'output'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="error.ex"/&gt;
    &lt;param name="element" select="'error'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="document.ex"/&gt;
    &lt;param name="element" select="'document'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="xml-pipeline.xsd"/&gt;
    &lt;input name="stylesheet" label="hackxsd.xsl"/&gt;
    &lt;output name="result" label="param.ex"/&gt;
    &lt;param name="element" select="'param'"/&gt;
  &lt;/process&gt;

  &lt;process type="transform"&gt;
    &lt;input name="document" label="diff.xml"/&gt;
    &lt;input name="stylesheet" label=".stylesheets/notediff.xsl"/&gt;
    &lt;output name="result" label="/tmp/diff.html"/&gt;
  &lt;/process&gt;

  &lt;process type="tidy"&gt;
    &lt;input name="document" label="/tmp/diff.html"/&gt;
    &lt;output name="result" label="diff.html"/&gt;
  &lt;/process&gt;

  &lt;process type="makediff"&gt;
    &lt;input name="document" label="pipeline.xml"/&gt;
    &lt;output name="result" label="diff.xml"/&gt;
    &lt;param name="doctype" select="'xmlspec'"/&gt;
    &lt;param name="DIFFV1" select="{$diffv1}"/&gt;
    &lt;param name="DIFFV2" select="{$diffv2}"/&gt;
  &lt;/process&gt;

  &lt;process type="clean"&gt;
    &lt;output label="clean"/&gt;
    &lt;param name="glob" select="*.{aux,fo,log,out,html,pdf}"/&gt;
    &lt;param name="opts" select="-f"/&gt;
  &lt;/process&gt;
&lt;/pipeline&gt;
</eg>
</example></div1>
<div1 id="sec-bibliography">
<head>References</head>
<blist>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ant" href="http://jakarta.apache.org/ant/" key="Ant" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">The
Jakarta
Project. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">Ant</titleref>. The Apache Foundation,
2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="css" href="http://www.w3.org/TR/REC-CSS2/" key="CSS" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Bert
Bos, HÃ¥kon
Wium Lie, Chris Lilley, et al., editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">Cascading Style
Sheets,
level 2</titleref>. World Wide Web Consortium, 1998.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="style-note" href="http://www.w3.org/TR/xml-link-style/" key="Linking/Style" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Norman
Walsh, editor. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML Linking and Style</titleref>. World
Wide
Web
Consortium, 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="plh" href="http://www.w3.org/2001/06/ProcessingModel- plh.html" key="PLH" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Philippe
Le HÃ©garet. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">The XML Processing Model</titleref>. World
Wide
Web
Consortium, 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="relax-ng" href="http://www.oasis- open.org/committees/relax- ng/" key="RELAX NG" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">James Clark, editor. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">OASIS RELAX NG
Technical Committee</titleref>.
OASIS. 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="rfc2119" href="http://www.ietf.org/rfc/rfc2119.txt" key="RFC 2119" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">S.
Bradner, editor. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">Key words for use in RFCs to Indicate
Requirement
Levels</titleref>. IETF (Internet Engineering Task Force), March
1997.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="schematron" href="http://xml.ascc.net/xml/resource/schematron/schematron.html" key="Schematron" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Rick Jelliffe. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">The Schematron</titleref>.
Academia
Sinica Computing Centre. 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="soap" href="http://www.w3.org/TR/SOAP-attachments" key="SwA" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">John
Barton, Satish Thatte, Henrik Frystyk Nielsen, editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">SOAP Messages
with Attachments</titleref>. World Wide Web Consortium, 2000.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xinclude" href="http://www.w3.org/TR/xinclude/" key="XInclude" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Jonathan
Marsh and David Orchard, editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML Inclusions
(XInclude)
Version
1.0</titleref>. World Wide Web Consortium, 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xlink" href="http://www.w3.org/TR/xlink/" key="XLink" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Steve
DeRose,
Eve Maler, David Orchard, editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML Linking Language
(XLink)
Version 1.0</titleref>. World Wide Web Consortium, 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xml-rec" href="http://www.w3.org/TR/REC-xml" key="XML" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Tim
Bray,
Jean Paoli, C. M. Sperberg-McQueen, et al., editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">Extensible
Markup Language (XML) 1.0 Second Edition</titleref>. World Wide Web
Consortium,
1998.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xml-base" href="http://www.w3.org/TR/xmlbase/" key="XML Base" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Jonathan
Marsh, editor. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML Base</titleref>. World Wide Web
Consortium, 2000.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="infoset" href="http://www.w3.org/TR/xml-infoset/" key="XML Infoset" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Richard
Tobin and John Cowan, editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML Information
Set</titleref>. World
Wide Web Consortium, 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xml-names" href="http://www.w3.org/TR/REC-xml-names/" key="XML Namespaces" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Tim
Bray, Dave Hollander, Andrew Layman, editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">Namespaces
in
XML</titleref>.
World Wide Web Consortium, 1999.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xml-schema" href="http://www.w3.org/TR/xmlschema-1/" key="XML Schema" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Henry
S. Thompson, David Beech, Murray Maloney, et al. editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML Schema
Part 1: Structures</titleref>. World Wide Web Consortium,
2000.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xpointer" href="http://www.w3.org/TR/xptr/" key="XPointer" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Steve
DeRose, Eve Maler, Ron Daniel Jr., editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML Pointer
Language
(XPointer) Version 1.0</titleref>. World Wide Web Consortium,
2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xquery" href="http://www.w3.org/TR/xquery/" key="XQuery" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Don Chamberlin,
James Clark, Daniela Florescu, et al., editors. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XQuery
1.0: An XML
Query Language</titleref>. World Wide Web Consortium, 2001.</bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="xslt" href="http://www.w3.org/TR/xslt" key="XSLT" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">James
Clark, editor. <titleref xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">XML
Transformations (XSLT) Version 1.0</titleref>. World Wide Web
Consortium,
1999.</bibl>
</blist></div1>
<div1>
<head>Open Issues</head>
<p>This appendix identifies some open issues.</p>
<olist>
<item><p>In <specref ref="xpipe.concepts"/>, URI equality is defined
as lexical.
Is this sufficiently specific?</p></item>
<item><p>Can a pipeline document be its own target? Can it have
XInclude instructions
and validity constraints and other anticipated processing?</p>
</item>

<item><p>In order to provide greater flexibility in the Pipeline document,
does it make sense to consider allowing some attribute values (for example,
the <att>definition</att> attribute of <el>processdef</el> and
the <att>select</att> attribute of <el>param</el>) to be XPath expressions?
</p></item>

<item><p>As currently defined, the <el>processdef</el> element defined
in <specref ref="elem.processdef"/> has an implementation-specific
attribute, which introduces interoperability problems.  What is the
right solution for this problem? Is it related to the possibility of
introducing XPath expressions?</p></item>

<item><p>The schema for Pipeline in <specref ref="xpipe.schema"/>
should be
expanded to define <el>key</el>/<el>keyref</el> constructs for the
uniqueness
and reference constraints in its elements.</p></item>
<item><p>The issue of controlling extractive processes (beyond the
control
already built into specifications such as XML Schema) is not so far
addressed
here. The issue was explored to a certain extent at the XML
Processing Model
Workshop (see, for example, the paper presented by Philippe Le
HÃ©garet <bibref ref="plh"/>) and does need to be accounted for eventually.</p>
</item>
</olist>
</div1>
</back></spec>