Another abandoned server code base... this is kind of an ancestor of taskrambler.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16698 lines
836 KiB

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.3), see www.w3.org" />
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />
<title>XProc: An XML Pipeline Language</title>
<link rel="alternate" title="XML" href="langspec.xml" />
<link rel="alternate" title="Latest editor's draft" href=
"http://www.w3.org/XML/XProc/docs/langspec.html" />
<link rel="alternate" title="Latest Public Working Draft" href=
"http://www.w3.org/TR/xproc/" />
<link rel="alternate" href=
"http://www.w3.org/TR/2010/PR-xproc-20100309/" title=
"09 Mar 2010 Working Draft" />
<link rel="alternate" href=
"http://www.w3.org/TR/2010/WD-xproc-20100105/" title=
"05 Jan 2010 Working Draft" />
<link rel="alternate" href=
"http://www.w3.org/TR/2009/CR-xproc-20090528/" title=
"28 May 2009 Working Draft" />
<link rel="stylesheet" type="text/css" href=
"http://www.w3.org/StyleSheets/TR/base.css" />
<link rel="stylesheet" type="text/css" href="xproc.css" />
<link rel="stylesheet" type="text/css" href=
"http://www.w3.org/StyleSheets/TR/W3C-REC.css" />
</head>
<body>
<div class="specification">
<div class="head" id="spec.head">
<p><a href="http://www.w3.org/"><img height="48" width="72" alt=
"W3C" src="http://www.w3.org/Icons/w3c_home" /></a></p>
<h1>XProc: An XML Pipeline Language</h1>
<h2>W3C Recommendation 11 May 2010</h2>
<dl>
<dt>This Version:</dt>
<dd><a href=
"http://www.w3.org/TR/2010/REC-xproc-20100511/">http://www.w3.org/TR/2010/REC-xproc-20100511/</a></dd>
<dt>Latest Version:</dt>
<dd><a href=
"http://www.w3.org/TR/xproc/">http://www.w3.org/TR/xproc/</a></dd>
<dt>Previous versions:</dt>
<dd><a href=
"http://www.w3.org/TR/2010/PR-xproc-20100309/">http://www.w3.org/TR/2010/PR-xproc-20100309/</a><br />
<a href=
"http://www.w3.org/TR/2010/WD-xproc-20100105/">http://www.w3.org/TR/2010/WD-xproc-20100105/</a><br />
<a href=
"http://www.w3.org/TR/2009/CR-xproc-20090528/">http://www.w3.org/TR/2009/CR-xproc-20090528/</a><br />
</dd>
<dt>Editors:</dt>
<dd><span class="personname">Norman Walsh</span>, <span class=
"orgname">MarkLogic Corporation</span> <tt class=
"email">&lt;<a href=
"mailto:norman.walsh@marklogic.com">norman.walsh@marklogic.com</a>&gt;</tt></dd>
<dd><span class="personname">Alex Milowski</span>, <span class=
"orgname">Invited expert</span> <tt class="email">&lt;<a href=
"mailto:alex@milowski.org">alex@milowski.org</a>&gt;</tt></dd>
<dd><span class="personname">Henry S. Thompson</span>, <span class=
"orgname">University of Edinburgh</span> <tt class=
"email">&lt;<a href=
"mailto:ht@inf.ed.ac.uk">ht@inf.ed.ac.uk</a>&gt;</tt></dd>
</dl>
<p>Please refer to the <a href=
"http://www.w3.org/XML/2010/xproc-errata.html"><strong>errata</strong></a>
for this document, which may include some normative
corrections.</p>
<p>See also <a href=
"http://www.w3.org/2003/03/Translations/byTechnology?technology=xproc">
<strong>translations</strong></a>.</p>
<p>This document is also available in these non-normative formats:
<a href="langspec.xml">XML</a></p>
<p class="copyright"><a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
© 2010 <a href="http://www.w3.org/"><acronym title=
"World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href=
"http://www.csail.mit.edu/"><acronym title=
"Massachusetts Institute of Technology">MIT</acronym></a>, <a href=
"http://www.ercim.org/"><acronym title=
"European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
<a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
W3C <a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a href=
"http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<hr />
<div class="abstract">
<h2>Abstract</h2>
<p>This specification describes the syntax and semantics of
<em class="citetitle">XProc: An XML Pipeline Language</em>, a
language for describing operations to be performed on XML
documents.</p>
<p>An XML Pipeline specifies a sequence of operations to be
performed on zero or more XML documents. Pipelines generally accept
zero or more XML documents as input and produce zero or more XML
documents as output. Pipelines are made up of simple steps which
perform atomic operations on XML documents and constructs similar
to conditionals, iteration, and exception handlers which control
which steps are executed.</p>
</div>
<div class="status">
<h2>Status of this Document</h2>
<p><em>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 <a href=
"http://www.w3.org/TR/">W3C technical reports index</a> at
http://www.w3.org/TR/.</em></p>
<p>This document is a <a href=
"http://www.w3.org/2005/10/Process-20051014/tr.html#q74">W3C
Recommendation</a>. It implements the requirements and use cases
documented in [<a href="#use-cases"><span class="abbrev">XProc
Requirements</span></a>]. This document is a product of the
<a href="http://www.w3.org/XML/Processing/">XML Processing Model
Working Group</a> as part of the W3C <a href=
"http://www.w3.org/XML/Activity">XML Activity</a>.</p>
<p>This document has been reviewed by W3C Members, by software
developers, and by other W3C groups and interested parties, and is
endorsed by the Director as a W3C Recommendation. It is a stable
document and may be used as reference material or cited from
another document. W3C's role in making the Recommendation is to
draw attention to the specification and to promote its widespread
deployment. This enhances the functionality and interoperability of
the Web.</p>
<p>Please report errors in this document to the public mailing list
<a href=
"mailto:public-xml-processing-model-comments@w3.org">public-xml-processing-model-comments@w3.org</a>
(public <a href=
"http://lists.w3.org/Archives/Public/public-xml-processing-model-comments/">
archives</a> are available).</p>
<p>There is an <a href=
"http://www.w3.org/XML/XProc/2010/02/ir.html">Implementation Report
for XProc</a>. It documents the performance of implementations
against the <a href="http://tests.xproc.org/">XProc Test
Suite</a>.</p>
<p>This document was produced by a group operating under the
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
February 2004 W3C Patent Policy</a>. W3C maintains a <a href=
"http://www.w3.org/2004/01/pp-impl/38398/status">public list of any
patent disclosures</a> 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 <a href=
"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">
Essential Claim(s)</a> must disclose the information in accordance
with <a href=
"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">
section 6 of the W3C Patent Policy</a>.</p>
</div>
</div>
<hr />
<div id="spectoc">
<div class="toc">
<h2 id="TableOfContents">Table of Contents</h2>
<dl class="toc">
<dt><span>1&#160;<a href=
"#introduction">Introduction</a></span></dt>
<dt><span>2&#160;<a href="#pipeline-concepts">Pipeline
Concepts</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.1&#160;<a href="#step-concept">Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.1.1&#160;<a href="#step-names">Step
names</a></span></dt>
</dl>
</dd>
<dt><span>2.2&#160;<a href="#input-output">Inputs and
Outputs</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.2.1&#160;<a href="#external-docs">External
Documents</a></span></dt>
<dt><span>2.2.2&#160;<a href="#binary">Non-XML
Documents</a></span></dt>
</dl>
</dd>
<dt><span>2.3&#160;<a href="#primary-input-output">Primary Inputs
and Outputs</a></span></dt>
<dt><span>2.4&#160;<a href=
"#connections">Connections</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.4.1&#160;<a href="#namespace-fixup">Namespace Fixup on
Outputs</a></span></dt>
</dl>
</dd>
<dt><span>2.5&#160;<a href=
"#environment">Environment</a></span></dt>
<dt><span>2.6&#160;<a href="#xpath-context">XPaths in
XProc</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.6.1&#160;<a href="#xpath10-processors">XPath 1.0
processors</a></span></dt>
<dt><span>2.6.2&#160;<a href="#xpath20-processors">XPath 2.0
processors</a></span></dt>
</dl>
</dd>
<dt><span>2.7&#160;<a href="#xpath-extension-functions">XPath
Extension Functions</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.7.1&#160;<a href="#f.system-property">System
Properties</a></span></dt>
<dt><span>2.7.2&#160;<a href="#f.step-available">Step
Available</a></span></dt>
<dt><span>2.7.3&#160;<a href="#f.value-available">Value
Available</a></span></dt>
<dt><span>2.7.4&#160;<a href="#f.iteration-position">Iteration
Position</a></span></dt>
<dt><span>2.7.5&#160;<a href="#f.iteration-size">Iteration
Size</a></span></dt>
<dt><span>2.7.6&#160;<a href="#f.base-uri">Base URI</a></span></dt>
<dt><span>2.7.7&#160;<a href="#f.resolve-uri">Resolve
URI</a></span></dt>
<dt><span>2.7.8&#160;<a href="#f.version-available">Version
Available</a></span></dt>
<dt><span>2.7.9&#160;<a href="#f.xpath-version-available">XPath
Version Available</a></span></dt>
<dt><span>2.7.10&#160;<a href=
"#other-xpath-extension-functions">Other XPath Extension
Functions</a></span></dt>
</dl>
</dd>
<dt><span>2.8&#160;<a href="#psvi-support">PSVIs in
XProc</a></span></dt>
<dt><span>2.9&#160;<a href="#variables">Variables</a></span></dt>
<dt><span>2.10&#160;<a href="#options">Options</a></span></dt>
<dt><span>2.11&#160;<a href=
"#parameters">Parameters</a></span></dt>
<dt><span>2.12&#160;<a href="#security-considerations">Security
Considerations</a></span></dt>
<dt><span>2.13&#160;<a href="#versioning-considerations">Versioning
Considerations</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.13.1&#160;<a href="#vers-backcomp">Backwards-compatible
Mode</a></span></dt>
<dt><span>2.13.2&#160;<a href="#vers-forwcomp">Forwards-compatible
Mode</a></span></dt>
</dl>
</dd>
</dl>
</dd>
<dt><span>3&#160;<a href="#syntax">Syntax Overview</a></span></dt>
<dd>
<dl class="toc">
<dt><span>3.1&#160;<a href="#namespaces">XProc
Namespaces</a></span></dt>
<dt><span>3.2&#160;<a href="#scoping">Scoping of
Names</a></span></dt>
<dt><span>3.3&#160;<a href="#xml-base-attribute">Base URIs and
xml:base</a></span></dt>
<dt><span>3.4&#160;<a href="#xml-id-attribute">Unique
identifiers</a></span></dt>
<dt><span>3.5&#160;<a href="#syntax-docs-ports">Associating
Documents with Ports</a></span></dt>
<dt><span>3.6&#160;<a href=
"#documentation">Documentation</a></span></dt>
<dt><span>3.7&#160;<a href="#annotations">Processor
annotations</a></span></dt>
<dt><span>3.8&#160;<a href="#extension-attributes">Extension
attributes</a></span></dt>
<dt><span>3.9&#160;<a href="#use-when">Conditional Element
Exclusion</a></span></dt>
<dt><span>3.10&#160;<a href="#syntax-summaries">Syntax
Summaries</a></span></dt>
<dt><span>3.11&#160;<a href="#common-errors">Common
errors</a></span></dt>
</dl>
</dd>
<dt><span>4&#160;<a href="#steps">Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.1&#160;<a href="#p.pipeline">p:pipeline</a></span></dt>
<dt><span>4.2&#160;<a href="#p.for-each">p:for-each</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.2.1&#160;<a href="#for-each-xpath-context">XPath
Context</a></span></dt>
</dl>
</dd>
<dt><span>4.3&#160;<a href="#p.viewport">p:viewport</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.3.1&#160;<a href="#viewport-xpath-context">XPath
Context</a></span></dt>
</dl>
</dd>
<dt><span>4.4&#160;<a href="#p.choose">p:choose</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.4.1&#160;<a href=
"#p.xpath-context">p:xpath-context</a></span></dt>
<dt><span>4.4.2&#160;<a href="#p.when">p:when</a></span></dt>
<dt><span>4.4.3&#160;<a href=
"#p.otherwise">p:otherwise</a></span></dt>
</dl>
</dd>
<dt><span>4.5&#160;<a href="#p.group">p:group</a></span></dt>
<dt><span>4.6&#160;<a href="#p.try">p:try</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.6.1&#160;<a href="#err-vocab">The Error
Vocabulary</a></span></dt>
</dl>
</dd>
<dt><span>4.7&#160;<a href="#p.atomic">Atomic Steps</a></span></dt>
<dt><span>4.8&#160;<a href="#p.extension">Extension
Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.8.1&#160;<a href="#option-shortcut">Syntactic Shortcut
for Option Values</a></span></dt>
</dl>
</dd>
</dl>
</dd>
<dt><span>5&#160;<a href="#other-elements">Other pipeline
elements</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.1&#160;<a href="#p.input">p:input</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.1.1&#160;<a href="#document-inputs">Document
Inputs</a></span></dt>
<dt><span>5.1.2&#160;<a href="#parameter-inputs">Parameter
Inputs</a></span></dt>
</dl>
</dd>
<dt><span>5.2&#160;<a href=
"#p.iteration-source">p:iteration-source</a></span></dt>
<dt><span>5.3&#160;<a href=
"#p.viewport-source">p:viewport-source</a></span></dt>
<dt><span>5.4&#160;<a href="#p.output">p:output</a></span></dt>
<dt><span>5.5&#160;<a href="#p.log">p:log</a></span></dt>
<dt><span>5.6&#160;<a href=
"#p.serialization">p:serialization</a></span></dt>
<dt><span>5.7&#160;<a href=
"#variables-options-parameters">Variables, Options, and
Parameters</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.7.1&#160;<a href=
"#p.variable">p:variable</a></span></dt>
<dt><span>5.7.2&#160;<a href="#p.option">p:option</a></span></dt>
<dt><span>5.7.3&#160;<a href=
"#p.with-option">p:with-option</a></span></dt>
<dt><span>5.7.4&#160;<a href=
"#p.with-param">p:with-param</a></span></dt>
<dt><span>5.7.5&#160;<a href="#opt-param-bindings">Namespaces on
variables, options, and parameters</a></span></dt>
</dl>
</dd>
<dt><span>5.8&#160;<a href=
"#p.declare-step">p:declare-step</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.8.1&#160;<a href="#declare-atomic-steps">Declaring
atomic steps</a></span></dt>
<dt><span>5.8.2&#160;<a href="#declare-pipelines">Declaring
pipelines</a></span></dt>
</dl>
</dd>
<dt><span>5.9&#160;<a href="#p.library">p:library</a></span></dt>
<dt><span>5.10&#160;<a href="#p.import">p:import</a></span></dt>
<dt><span>5.11&#160;<a href="#p.pipe">p:pipe</a></span></dt>
<dt><span>5.12&#160;<a href="#p.inline">p:inline</a></span></dt>
<dt><span>5.13&#160;<a href=
"#p.document">p:document</a></span></dt>
<dt><span>5.14&#160;<a href="#p.data">p:data</a></span></dt>
<dt><span>5.15&#160;<a href="#p.empty">p:empty</a></span></dt>
<dt><span>5.16&#160;<a href=
"#p.documentation">p:documentation</a></span></dt>
<dt><span>5.17&#160;<a href=
"#p.pipeinfo">p:pipeinfo</a></span></dt>
</dl>
</dd>
<dt><span>6&#160;<a href="#errors">Errors</a></span></dt>
<dd>
<dl class="toc">
<dt><span>6.1&#160;<a href="#static-errors">Static
Errors</a></span></dt>
<dt><span>6.2&#160;<a href="#dynamic-errors">Dynamic
Errors</a></span></dt>
<dt><span>6.3&#160;<a href="#step-errors">Step
Errors</a></span></dt>
</dl>
</dd>
<dt><span>7&#160;<a href="#std-components">Standard Step
Library</a></span></dt>
<dd>
<dl class="toc">
<dt><span>7.1&#160;<a href="#std-required">Required
Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>7.1.1&#160;<a href=
"#c.add-attribute">p:add-attribute</a></span></dt>
<dt><span>7.1.2&#160;<a href=
"#c.add-xml-base">p:add-xml-base</a></span></dt>
<dt><span>7.1.3&#160;<a href="#c.compare">p:compare</a></span></dt>
<dt><span>7.1.4&#160;<a href="#c.count">p:count</a></span></dt>
<dt><span>7.1.5&#160;<a href="#c.delete">p:delete</a></span></dt>
<dt><span>7.1.6&#160;<a href=
"#c.directory-list">p:directory-list</a></span></dt>
<dt><span>7.1.7&#160;<a href="#c.error">p:error</a></span></dt>
<dt><span>7.1.8&#160;<a href=
"#c.escape-markup">p:escape-markup</a></span></dt>
<dt><span>7.1.9&#160;<a href="#c.filter">p:filter</a></span></dt>
<dt><span>7.1.10&#160;<a href=
"#c.http-request">p:http-request</a></span></dt>
<dt><span>7.1.11&#160;<a href=
"#c.identity">p:identity</a></span></dt>
<dt><span>7.1.12&#160;<a href="#c.insert">p:insert</a></span></dt>
<dt><span>7.1.13&#160;<a href=
"#c.label-elements">p:label-elements</a></span></dt>
<dt><span>7.1.14&#160;<a href="#c.load">p:load</a></span></dt>
<dt><span>7.1.15&#160;<a href=
"#c.make-absolute-uris">p:make-absolute-uris</a></span></dt>
<dt><span>7.1.16&#160;<a href=
"#c.namespace-rename">p:namespace-rename</a></span></dt>
<dt><span>7.1.17&#160;<a href="#c.pack">p:pack</a></span></dt>
<dt><span>7.1.18&#160;<a href=
"#c.parameters">p:parameters</a></span></dt>
<dt><span>7.1.19&#160;<a href="#c.rename">p:rename</a></span></dt>
<dt><span>7.1.20&#160;<a href=
"#c.replace">p:replace</a></span></dt>
<dt><span>7.1.21&#160;<a href=
"#c.set-attributes">p:set-attributes</a></span></dt>
<dt><span>7.1.22&#160;<a href="#c.sink">p:sink</a></span></dt>
<dt><span>7.1.23&#160;<a href=
"#c.split-sequence">p:split-sequence</a></span></dt>
<dt><span>7.1.24&#160;<a href="#c.store">p:store</a></span></dt>
<dt><span>7.1.25&#160;<a href=
"#c.string-replace">p:string-replace</a></span></dt>
<dt><span>7.1.26&#160;<a href=
"#c.unescape-markup">p:unescape-markup</a></span></dt>
<dt><span>7.1.27&#160;<a href="#c.unwrap">p:unwrap</a></span></dt>
<dt><span>7.1.28&#160;<a href="#c.wrap">p:wrap</a></span></dt>
<dt><span>7.1.29&#160;<a href=
"#c.wrap-sequence">p:wrap-sequence</a></span></dt>
<dt><span>7.1.30&#160;<a href=
"#c.xinclude">p:xinclude</a></span></dt>
<dt><span>7.1.31&#160;<a href="#c.xslt">p:xslt</a></span></dt>
</dl>
</dd>
<dt><span>7.2&#160;<a href="#std-optional">Optional
Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>7.2.1&#160;<a href="#c.exec">p:exec</a></span></dt>
<dt><span>7.2.2&#160;<a href="#c.hash">p:hash</a></span></dt>
<dt><span>7.2.3&#160;<a href="#c.uuid">p:uuid</a></span></dt>
<dt><span>7.2.4&#160;<a href=
"#c.validate-with-relax-ng">p:validate-with-relax-ng</a></span></dt>
<dt><span>7.2.5&#160;<a href=
"#c.validate-with-schematron">p:validate-with-schematron</a></span></dt>
<dt><span>7.2.6&#160;<a href=
"#c.validate-with-xml-schema">p:validate-with-xml-schema</a></span></dt>
<dt><span>7.2.7&#160;<a href=
"#c.www-form-urldecode">p:www-form-urldecode</a></span></dt>
<dt><span>7.2.8&#160;<a href=
"#c.www-form-urlencode">p:www-form-urlencode</a></span></dt>
<dt><span>7.2.9&#160;<a href="#c.xquery">p:xquery</a></span></dt>
<dt><span>7.2.10&#160;<a href=
"#c.xsl-formatter">p:xsl-formatter</a></span></dt>
</dl>
</dd>
<dt><span>7.3&#160;<a href="#serialization-options">Serialization
Options</a></span></dt>
</dl>
</dd>
</dl>
</div>
<h3><a name="appendices" id="appendices"></a>Appendices</h3>
<div class="toc">
<dl class="toc">
<dt><span>A&#160;<a href="#conformance">Conformance</a></span></dt>
<dd>
<dl class="toc">
<dt><span>A.1&#160;<a href=
"#implementation-defined">Implementation-defined
features</a></span></dt>
<dt><span>A.2&#160;<a href=
"#implementation-dependent">Implementation-dependent
features</a></span></dt>
<dt><span>A.3&#160;<a href="#infoset-conformance">Infoset
Conformance</a></span></dt>
</dl>
</dd>
<dt><span>B&#160;<a href="#references">References</a></span></dt>
<dd>
<dl class="toc">
<dt><span>B.1&#160;<a href="#normative-references">Normative
References</a></span></dt>
<dt><span>B.2&#160;<a href="#informative-references">Informative
References</a></span></dt>
</dl>
</dd>
<dt><span>C&#160;<a href="#glossary">Glossary</a></span></dt>
<dt><span>D&#160;<a href="#language-summary">Pipeline Language
Summary</a></span></dt>
<dt><span>E&#160;<a href="#errors-list">List of Error
Codes</a></span></dt>
<dd>
<dl class="toc">
<dt><span>E.1&#160;<a href="#app.static-errors">Static
Errors</a></span></dt>
<dt><span>E.2&#160;<a href="#app.dynamic-errors">Dynamic
Errors</a></span></dt>
<dt><span>E.3&#160;<a href="#app.step-errors">Step
Errors</a></span></dt>
</dl>
</dd>
<dt><span>F&#160;<a href="#namespace-fixup-guidance">Guidance on
Namespace Fixup (Non-Normative)</a></span></dt>
<dt><span>G&#160;<a href="#handling-imports">Handling Circular and
Re-entrant Library Imports (Non-Normative)</a></span></dt>
<dt><span>H&#160;<a href="#parallelism">Sequential steps,
parallelism, and side-effects</a></span></dt>
<dt><span>I&#160;<a href="#xproc-media-type">The <tt class=
"code">application/xproc+xml</tt> media type</a></span></dt>
<dd>
<dl class="toc">
<dt><span>I.1&#160;<a href="#media-type-registration">Registration
of MIME media type application/xproc+xml</a></span></dt>
<dt><span>I.2&#160;<a href="#fragid">Fragment
Identifiers</a></span></dt>
</dl>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="introduction" id=
"introduction"></a>1&#160;Introduction</h3>
<p>An XML Pipeline specifies a sequence of operations to be
performed on a collection of XML input documents. Pipelines take
zero or more XML documents as their input and produce zero or more
XML documents as their output.</p>
<p>A <em class="glossterm"><a href="#dt-pipeline">pipeline</a></em>
consists of steps. Like pipelines, steps take zero or more XML
documents as their inputs and produce zero or more XML documents as
their outputs. The inputs of a step come from the web, from the
pipeline document, from the inputs to the pipeline itself, or from
the outputs of other steps in the pipeline. The outputs from a step
are consumed by other steps, are outputs of the pipeline as a
whole, or are discarded.</p>
<p>There are three kinds of steps: atomic steps, compound steps,
and multi-container steps. Atomic steps carry out single operations
and have no substructure as far as the pipeline is concerned.
Compound steps and multi-container steps control the execution of
other steps, which they include in the form of one or more
subpipelines.</p>
<p>This specification defines a standard library, <a href=
"#std-components" title="Standard Step Library">Section&#160;7,
“Standard Step Library”</a>, of steps. Pipeline implementations
<span class="rfc2119">may</span> support additional types of steps
as well.</p>
<p><a href="#fig-xival" title=
"A simple, linear XInclude/Validate pipeline">Figure&#160;1, “A
simple, linear XInclude/Validate pipeline”</a> is a graphical
representation of a simple pipeline that performs XInclude
processing and validation on a document.</p>
<div class="figure-wrapper" id="fig-xival">
<div class="figure">
<div class="mediaobject"><img src=
"graphics/sch-xinclude-validate-pipeline.png" alt=
"A simple, linear XInclude/Validate pipeline" /></div>
</div>
<div class="title">Figure&#160;1.&#160;A simple, linear
XInclude/Validate pipeline</div>
</div>
<p>This is a pipeline that consists of two atomic steps, XInclude
and Validate with XML Schema. The pipeline itself has two inputs,
“source” (a source document) and “schemas” (a sequence of W3C XML
Schemas). The XInclude step reads the pipeline input “source” and
produces a result document. The Validate with XML Schema step reads
the pipeline input “schemas” and the result of the XInclude step
and produces its own result document. The result of the validation,
“result”, is the result of the pipeline. (For consistency across
the step vocabulary, the standard input is usually named “source”
and and the standard output is usually named “result”.)</p>
<p>The pipeline document determines how the steps are connected
together inside the pipeline, that is, how the output of one step
becomes the input of another.</p>
<p>The pipeline document for this pipeline is shown in <a href=
"#ex1" title=
"A simple, linear XInclude/Validate pipeline">Example&#160;1, “A
simple, linear XInclude/Validate pipeline”</a>.</p>
<div class="example-wrapper" id="ex1">
<div class="title">Example&#160;1.&#160;A simple, linear
XInclude/Validate pipeline</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
name="xinclude-and-validate"
version="1.0"&gt;
&lt;p:input port="source" primary="true"/&gt;
&lt;p:input port="schemas" sequence="true"/&gt;
&lt;p:output port="result"&gt;
&lt;p:pipe step="validated" port="result"/&gt;
&lt;/p:output&gt;
&lt;p:xinclude name="included"&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="xinclude-and-validate" port="source"/&gt;
&lt;/p:input&gt;
&lt;/p:xinclude&gt;
&lt;p:validate-with-xml-schema name="validated"&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="included" port="result"/&gt;
&lt;/p:input&gt;
&lt;p:input port="schema"&gt;
&lt;p:pipe step="xinclude-and-validate" port="schemas"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;/p:declare-step&gt;
</pre></div>
</div>
</div>
<p>The example in <a href="#ex1" title=
"A simple, linear XInclude/Validate pipeline">Example&#160;1, “A
simple, linear XInclude/Validate pipeline”</a> is very verbose. It
makes all of the connections seen in the figure explicit. In
practice, pipelines do not have to be this verbose. XProc supports
defaults for many common cases:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If you use <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> instead of <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
the “<tt class="port">source</tt>” input port and “<tt class=
"port">result</tt>” output port are implicitly declared for
you.</p>
</li>
<li>
<p>Where inputs and outputs are connected between sequential
sibling steps, they do not have to be made explicit.</p>
</li>
</ul>
</div>
<p>The same pipeline, using XProc defaults, is shown in <a href=
"#ex1-abbr" title=
"A simple, linear XInclude/Validate pipeline (simplified)">Example&#160;2,
“A simple, linear XInclude/Validate pipeline (simplified)”</a>.</p>
<div class="example-wrapper" id="ex1-abbr">
<div class="title">Example&#160;2.&#160;A simple, linear
XInclude/Validate pipeline (simplified)</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
name="xinclude-and-validate"
version="1.0"&gt;
&lt;p:input port="schemas" sequence="true"/&gt;
&lt;p:xinclude/&gt;
&lt;p:validate-with-xml-schema&gt;
&lt;p:input port="schema"&gt;
&lt;p:pipe step="xinclude-and-validate" port="schemas"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p><a href="#fig-style-proc" title=
"A validate and transform pipeline">Figure&#160;2, “A validate and
transform pipeline”</a> is a more complex example: it performs
schema validation with an appropriate schema and then styles the
validated document.</p>
<div class="figure-wrapper" id="fig-style-proc">
<div class="figure">
<div class="mediaobject"><img src="graphics/sch-transform.png" alt=
"A validate and transform pipeline" /></div>
</div>
<div class="title">Figure&#160;2.&#160;A validate and transform
pipeline</div>
</div>
<p>The heart of this example is the conditional. The “choose” step
evaluates an XPath expression over a test document. Based on the
result of that expression, one or another branch is run. In this
example, each branch consists of a single validate step.</p>
<div class="example-wrapper" id="ex2">
<div class="title">Example&#160;3.&#160;A validate and transform
pipeline</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:choose&gt;
&lt;p:when test="/*[@version &amp;lt; 2.0]"&gt;
&lt;p:validate-with-xml-schema&gt;
&lt;p:input port="schema"&gt;
&lt;p:document href="v1schema.xsd"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;/p:when&gt;
&lt;p:otherwise&gt;
&lt;p:validate-with-xml-schema&gt;
&lt;p:input port="schema"&gt;
&lt;p:document href="v2schema.xsd"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;/p:otherwise&gt;
&lt;/p:choose&gt;
&lt;p:xslt&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="stylesheet.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p>This example, like the preceding, relies on XProc defaults for
simplicity. It is always valid to write the fully explicit form if
you prefer.</p>
<p>The media type for pipeline documents is <tt class=
"literal">application/xml</tt>. Often, pipeline documents are
identified by the extension <tt class="filename">.xpl</tt>.</p>
<p>In this specification the words <span class=
"rfc2119">must</span>, <span class="rfc2119">must not</span>,
<span class="rfc2119">should</span>, <span class="rfc2119">should
not</span>, <span class="rfc2119">may</span> and <span class=
"rfc2119">recommended</span> are to be interpreted as described in
[<a href="#rfc2119"><span class="abbrev">RFC 2119</span></a>].</p>
</div>
<div class="section">
<h3><a name="pipeline-concepts" id=
"pipeline-concepts"></a>2&#160;Pipeline Concepts</h3>
<p><span class="termdef" id="dt-pipeline">[Definition: A <em class=
"glossterm">pipeline</em> is a set of connected steps, with outputs
of one step flowing into inputs of another.]</span> A pipeline is
itself a <em class="glossterm"><a href="#dt-step">step</a></em> and
must satisfy the constraints on steps. Connections between steps
occur where the input of one step is connected to the output of
another.</p>
<p>The result of evaluating a pipeline (or <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>) is the
result of evaluating the steps that it contains, in an order
consistent with the connections between them. A pipeline must
behave as if it evaluated each step each time it is encountered.
Unless otherwise indicated, implementations <span class=
"rfc2119">must not</span> assume that steps are functional (that
is, that their outputs depend only on their <a href=
"#input-output">inputs</a>, <em class="glossterm"><a href=
"#dt-option">options</a></em>, and <em class="glossterm"><a href=
"#dt-parameter">parameters</a></em>) or side-effect free.</p>
<p>The pattern of connections between steps will not always
completely determine their order of evaluation. <a name="impl-1"
id="impl-1"></a>The evaluation order of steps not connected to one
another is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<div class="section">
<h4><a name="step-concept" id=
"step-concept"></a>2.1&#160;Steps</h4>
<p><span class="termdef" id="dt-step">[Definition: A <em class=
"glossterm">step</em> is the basic computational unit of a
pipeline.]</span> A typical step has zero or more inputs, from
which it receives XML documents to process, zero or more outputs,
to which it sends XML document results, and can have options and/or
parameters.</p>
<p>There are three kinds of steps: <em class="glossterm"><a href=
"#dt-atomic-step">atomic</a></em>, <em class="glossterm"><a href=
"#dt-compound-step">compound</a></em>, and <em class=
"glossterm"><a href=
"#dt-multi-container-step">multi-container</a></em>.</p>
<p><span class="termdef" id="dt-atomic-step">[Definition: An
<em class="glossterm">atomic step</em> is a step that performs a
unit of XML processing, such as XInclude or transformation, and has
no internal <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>. ]</span> Atomic steps carry
out fundamental XML operations and can perform arbitrary amounts of
computation, but they are indivisible. An XSLT step, for example,
performs XSLT processing; a Validate with XML Schema step validates
one input with respect to some set of XML Schemas, etc.</p>
<p>There are many <em>types</em> of atomic steps. The standard
library of atomic steps is described in <a href="#std-components"
title="Standard Step Library">Section&#160;7, “Standard Step
Library”</a>, but implementations <span class="rfc2119">may</span>
provide others as well. <a name="impl-2" id="impl-2"></a>It is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
additional step types, if any, are provided. Each use, or instance,
of an atomic step invokes the processing defined by that type of
step. A pipeline may contain instances of many types of steps and
many instances of the same type of step.</p>
<p>Compound steps, 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. They contain other steps, whose evaluation
they control.</p>
<p><span class="termdef" id="dt-compound-step">[Definition: A
<em class="glossterm">compound step</em> is a step that contains a
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.]</span> That is, a compound
step differs from an atomic step in that its semantics are at least
partially determined by the steps that it contains.</p>
<p>Finally, there are two “multi-container steps”: <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> and <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>. <span class=
"termdef" id="dt-multi-container-step">[Definition: A <em class=
"glossterm">multi-container step</em> is a step that contains
several alternate <em class="glossterm"><a href=
"#dt-subpipeline">subpipelines</a></em>. ]</span> Each subpipeline
is identified by a non-step wrapper element: <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> and <a href=
"#p.otherwise"><tt class="tag-element">p:otherwise</tt></a> in the
case of <a href="#p.choose"><tt class=
"tag-element">p:choose</tt></a>, <a href="#p.group"><tt class=
"tag-element">p:group</tt></a> and <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> in the case of <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>.</p>
<p>The output of a multi-container step is the output of exactly
one of its subpipelines. In this sense, a multi-container step
functions like a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>. However, evaluating a
multi-container step may involve evaluating, or partially
evaluating, more than one of its subpipelines. It's possible for
steps in a partially evaluated pipeline to have side effects that
are visible outside the processor, even if the final output of the
multi-container step is the result of some other subpipeline. For
example, a web server might record that some interaction was
performed, or a file on the local file system might have been
modified.</p>
<p><span class="termdef" id="dt-container">[Definition: A compound
step or multi-container step is a <em class=
"glossterm">container</em> for the steps directly within it or
within non-step wrappers directly within it.]</span> <span class=
"termdef" id="dt-contained-steps">[Definition: The steps that occur
directly within, or within non-step wrappers directly within, a
step are called that step's <em class="glossterm">contained
steps</em>. In other words, “container” and “contained steps” are
inverse relationships.]</span> <span class="termdef" id=
"dt-ancestors">[Definition: The <em class=
"glossterm">ancestors</em> of a step, if it has any, are its
<em class="glossterm"><a href="#dt-container">container</a></em>
and the ancestors of its container.]</span></p>
<p><span class="termdef" id="dt-subpipeline">[Definition: Sibling
steps (and the connections between them) form a <em class=
"glossterm">subpipeline</em>.]</span> <span class="termdef" id=
"dt-last-step">[Definition: The <em class="glossterm">last
step</em> in a subpipeline is its last step in document
order.]</span></p>
<p id="p.subpipeline" class=
"element-syntax element-syntax-language-construct hanging-indent">
<tt class="code">subpipeline</tt>&#160;=&#160;<a href=
"#p.variable"><tt class=
"tag-element">p:variable</tt></a>*,&#160;(<a href=
"#p.for-each"><tt class="tag-element">p:for-each</tt></a>|<a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a>|<a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a>|<a href=
"#p.group"><tt class="tag-element">p:group</tt></a>|<a href=
"#p.try"><tt class="tag-element">p:try</tt></a>|<tt class=
"code"><a href="#p.atomic">p:<em class="replaceable"><tt class=
"replaceable">standard-step</tt></em></a></tt>|<tt class=
"code"><a href="#p.atomic"><em class="replaceable"><tt class=
"replaceable">pfx:user-pipeline</tt></em></a></tt>)+</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>User-defined pipelines (identified with <tt class=
"code"><em class="replaceable"><tt class=
"replaceable">pfx:user-pipeline</tt></em></tt> in the preceding
syntax summary) are atomic. A pipeline <em>declaration</em> may
contain a subpipeline, but the invocation of that pipeline is
atomic and does not contain a subpipeline.</p>
</div>
<p>Steps have “ports” into which inputs and outputs are connected.
Each step has a number of input ports and a number of output ports;
a step can have zero input ports and/or zero output ports. (All
steps have an implicit output port for reporting errors that
<span class="rfc2119">must not</span> be declared.) The names of
all ports on each step must be unique on that step (you can't have
two input ports named “source”, nor can you have an input port
named “schema” and an output port named “schema”).</p>
<p>A Step may have zero or more <a href="#options">options</a>, all
with unique names.</p>
<p>Steps may have parameter input ports, on which <a href=
"#parameters">parameters</a> can be passed. A step can have zero,
one, or many parameter input ports, and each parameter input port
can have zero or more parameters passed on it. If more than one
parameter with the same name is passed to any given parameter input
port, only the last value specified will be available to the step;
the names of the parameters passed to the step are unique on each
port. Parameters with the same name can be passed to different
ports, the uniqueness constraint on names only applies to the
parameters passed on each individual port.</p>
<p>All of the different instances of steps (atomic or compound) in
a pipeline can be distinguished from one another by name. If the
pipeline author does not provide a name for a step, a default name
is <a href="#step-names">manufactured automatically</a>.</p>
<div class="section">
<h5><a name="step-names" id="step-names"></a>2.1.1&#160;Step
names</h5>
<p>The <tt class="tag-attribute">name</tt> attribute on any step
can be used to give it a name. The name must be unique within its
scope, see <a href="#scoping" title=
"Scoping of Names">Section&#160;3.2, “Scoping of Names”</a>.</p>
<p>If the pipeline author does not provide an explicit name, the
processor manufactures a default name. All default names are of the
form “<tt class="literal">!1</tt><em class="replaceable"><tt class=
"replaceable">.m</tt></em><em class="replaceable"><tt class=
"replaceable">.n</tt></em>…” where “<em class=
"replaceable"><tt class="replaceable">m</tt></em>” is the position
(in the sense of counting sibling elements) of the step's highest
ancestor element within the pipeline document or library which
contains it, “<em class="replaceable"><tt class=
"replaceable">n</tt></em>” is the position of the next-highest
ancestor, and so on, including both steps and non-step wrappers.
For example, consider the pipeline in <a href="#ex2" title=
"A validate and transform pipeline">Example&#160;3, “A validate and
transform pipeline”</a>. The <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> step has no name, so it gets the
default name “<tt class="literal">!1</tt>”; the <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> gets the name
<tt class="literal">!1.1</tt>”; the first <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> gets the name
<tt class="literal">!1.1.1</tt>”; the <a href=
"#p.otherwise"><tt class="tag-element">p:otherwise</tt></a> gets
the name “<tt class="literal">!1.1.2</tt>”, etc. If the <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> had had a
name, it would not have received a default name, but it would still
have been counted and its first <a href="#p.when"><tt class=
"tag-element">p:when</tt></a> would still have been “<tt class=
"literal">!1.1.1</tt>”.</p>
<p>Providing every step in the pipeline with an interoperable name
has several benefits:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>It allows implementors to refer to all steps in an interoperable
fashion, for example, in error messages.</p>
</li>
<li>
<p>Pragmatically, we say that <em class="glossterm"><a href=
"#dt-readable-ports">readable ports</a></em> are identified by a
step name/port name pair. By manufacturing names for otherwise
anonymous steps, we include implicit connections without changing
our model.</p>
</li>
</ol>
</div>
<p>In a valid pipeline that runs successfully to completion, the
manufactured names aren't visible (except perhaps in debugging or
logging output).</p>
<div class="admonition" id="def-name-ncname">
<div class="admon-title">Note</div>
<p>The format for defaulted names does not conform to the
requirements of an <a href=
"http://www.w3.org/TR/xml-names/#NT-NCName">NCName</a>. This is an
explicit design decision; it prevents pipelines from using the
defaulted names on <a href="#p.pipe"><tt class=
"tag-element">p:pipe</tt></a> elements. If an explicit connection
is required, the pipeline author must provide an explicit name for
the step.</p>
</div>
</div>
</div>
<div class="section">
<h4><a name="input-output" id="input-output"></a>2.2&#160;Inputs
and Outputs</h4>
<p>Although some steps can read and write non-XML resources, what
flows <em>between</em> steps through input ports and output ports
are exclusively XML documents or sequences of XML documents.</p>
<p>For the purposes of this specification, an XML document is an
[<a href="#xml-infoset-rec"><span class=
"abbrev">Infoset</span></a>]. Implementations are free to transmit
Infosets as sequences of characters, sequences of events, object
models, or any other representation that preserves the necessary
Infoset properties (see <a href="#infoset-conformance" title=
"Infoset Conformance">Section&#160;A.3, “Infoset
Conformance”</a>).</p>
<p>Most steps in this specification manipulate XML documents, or
portions of XML documents. In these cases, we speak of changing
elements, attributes, or nodes without prejudice to the actual
representation used by an implementation.</p>
<p>An implementation <span class="rfc2119">may</span> make it
possible for a step to produce non-XML output (through channels
other than a named output port)—for example, writing a PDF document
to a URI—but that output cannot flow through the pipeline.
Similarly, one can imagine a step that takes no pipeline inputs,
reads a non-XML file from a URI, and produces an XML output. But
the non-XML data cannot arrive on an input port to a step.</p>
<p><a name="err.inline.D0001" id="err.inline.D0001"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0001"><code class=
"errqname">err:XD0001</code></a>) if a non-XML resource is produced
on a step output or arrives on a step input.</p>
<p>The common case is that each step has one or more inputs and one
or more outputs. <a href="#fig-atomic-step" title=
"An atomic step">Figure&#160;3, “An atomic step”</a> illustrates
symbolically an <em class="glossterm"><a href=
"#dt-atomic-step">atomic step</a></em> with two inputs and one
output.</p>
<div class="figure-wrapper" id="fig-atomic-step">
<div class="figure">
<div class="mediaobject"><img src="graphics/atomic-step.png" alt=
"An atomic step with two inputs and one output" /></div>
</div>
<div class="title">Figure&#160;3.&#160;An atomic step</div>
</div>
<p>All atomic steps are defined by a <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>.
The declaration of an atomic step type defines the input ports,
output ports, and options of all steps of that type. For example,
every <a href="#c.validate-with-xml-schema"><tt class=
"tag-element">p:validate-with-xml-schema</tt></a> step has two
inputs, named “<tt class="literal">source</tt>” and “<tt class=
"literal">schema</tt>”, one output named “<tt class=
"literal">result</tt>”, and the same set of options.</p>
<p>Like atomic steps, top level, user-defined pipelines also have
declarations. The situation is slightly more complicated for the
other compound steps because they don't have separate declarations;
each instance of the compound step serves as its own declaration.
On these compound steps, the number and names of the outputs can be
different on each instance of the step.</p>
<p><a href="#fig-compound-step" title=
"A compound step">Figure&#160;4, “A compound step”</a> illustrates
symbolically a compound step with one subpipeline and one output.
As you can see from the diagram, the output from the compound step
comes from one of the outputs of the subpipeline within the
step.</p>
<div class="figure-wrapper" id="fig-compound-step">
<div class="figure">
<div class="mediaobject"><img src="graphics/compound-step.png" alt=
"A compound step with two inputs and one output" /></div>
</div>
<div class="title">Figure&#160;4.&#160;A compound step</div>
</div>
<p><span class="termdef" id="dt-declared-inputs">[Definition: The
input ports declared on a step are its <em class=
"glossterm">declared inputs</em>.]</span> <span class="termdef" id=
"dt-declared-outputs">[Definition: The output ports declared on a
step are its <em class="glossterm">declared outputs</em>.]</span>
When a step is used in a pipeline, it is connected to other steps
through its inputs and outputs.</p>
<p>When a step is used, all of the <em class="glossterm"><a href=
"#dt-declared-inputs">declared inputs</a></em> of the step
<span class="rfc2119">must</span> be connected. Each input can be
connected to:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The output port of some other step.</p>
</li>
<li>
<p>A fixed, inline document or sequence of documents.</p>
</li>
<li>
<p>A document read from a URI.</p>
</li>
<li>
<p>One of the inputs declared on one of its <em class=
"glossterm"><a href="#dt-ancestors">ancestors</a></em>.</p>
</li>
<li>
<p>A special port provided by an ancestor compound step, for
example, “<tt class="port">current</tt>” in a <a href=
"#p.for-each"><tt class="tag-element">p:for-each</tt></a> or
<a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
</li>
</ul>
</div>
<p>When an input accepts a sequence of documents, the documents can
come from any combination of these locations.</p>
<p><a name="err.inline.S0003" id="err.inline.S0003"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0003"><code class=
"errqname">err:XS0003</code></a>) if any declared input is not
connected.</p>
<p>The <em class="glossterm"><a href=
"#dt-declared-outputs">declared outputs</a></em> of a step may be
connected to:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The input port of some other step (including <a href=
"#p.iteration-source"><tt class=
"tag-element">p:iteration-source</tt></a> or <a href=
"#p.viewport-source"><tt class=
"tag-element">p:viewport-source</tt></a>).</p>
</li>
<li>
<p>The <a href="#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a> of a <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> or <a href=
"#p.when"><tt class="tag-element">p:when</tt></a>.</p>
</li>
<li>
<p>An option assigned with <a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or a parameter assigned with
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a>.</p>
</li>
<li>
<p>One of the outputs declared on its container.</p>
</li>
</ul>
</div>
<p>The <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em> of a step
<span class="rfc2119">must</span> be connected. <a name=
"err.inline.S0005" id="err.inline.S0005"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0005"><code class=
"errqname">err:XS0005</code></a>) if the primary output port of any
step is not connected. Other outputs can remain unconnected. Any
documents produced on an unconnected output port are discarded.</p>
<p>Primary input and primary output ports may be implicitly
connected if no explicit connection is given, see <a href=
"#primary-input-output" title=
"Primary Inputs and Outputs">Section&#160;2.3, “Primary Inputs and
Outputs”</a>.</p>
<p>Output ports on compound steps have a dual nature: from the
perspective of the compound step's siblings, its outputs are just
ordinary outputs and must be connected as described above. From the
perspective of the subpipeline inside the compound step, they are
inputs into which something may be connected.</p>
<p>Within a compound step, the <em class="glossterm"><a href=
"#dt-declared-outputs">declared outputs</a></em> of the step can be
connected to:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The output port of some <em class="glossterm"><a href=
"#dt-contained-steps">contained step</a></em>.</p>
</li>
<li>
<p>A fixed, inline document or sequence of documents.</p>
</li>
<li>
<p>A document read from a URI.</p>
</li>
</ul>
</div>
<p>If a (non-primary) output port of a compound step is left
unconnected, it produces an empty sequence of documents from the
perspective of its siblings.</p>
<p>Each input and output on a step is declared to accept or produce
either a single document or a sequence of documents. It <em>is
not</em> an error to connect a port that is declared to produce a
sequence of documents to a port that is declared to accept only a
single document. It is, however, an error if the former step
actually produces more than one document at run time.</p>
<p>It is also not an error to connect a port that is declared to
produce a single document to a port that is declared to accept a
sequence. A single document is the same as a sequence of one
document.</p>
<p>An output port may have more than one connection: it may be
connected to more than one input port, more than one of its
container's output ports, or both. At runtime this will result in
distinct copies of the output.</p>
<p><span class="termdef" id="dt-signature">[Definition: The
<em class="glossterm">signature</em> of a step is the set of
inputs, outputs, and options that it is declared to accept.]</span>
The declaration for a step provides a fixed signature which all its
instances share.</p>
<p><span class="termdef" id="dt-matches">[Definition: A step
<em class="glossterm">matches</em> its signature if and only if it
specifies an input for each declared input, it specifies no inputs
that are not declared, it specifies an option for each option that
is declared to be required, and it specifies no options that are
not declared.]</span> In other words, every input and required
option <span class="rfc2119">must</span> be specified and only
inputs and options that are declared <span class=
"rfc2119">may</span> be specified. Options that aren't required do
not have to be specified.</p>
<p>Steps <span class="rfc2119">may</span> also produce error,
warning, and informative messages. These messages are captured and
provided on the <tt class="port">error</tt> port inside of a
<a href="#p.catch"><tt class="tag-element">p:catch</tt></a>.
<a name="impl-3" id="impl-3"></a>Outside of a <a href=
"#p.try">try/catch</a>, the disposition of error messages is
<em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p><a name="impl-4" id="impl-4"></a>How inputs are connected to XML
documents outside the pipeline is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. In
order to be consistent with the XPath data model, all general and
external parsed entities in such documents <span class=
"rfc2119">must</span> be fully expanded; they <span class=
"rfc2119">must not</span> contain any representation of [<a href=
"#xml-infoset-rec"><span class="abbrev">Infoset</span></a>]
<tt class="literal">[unexpanded entity reference information
items]</tt>.</p>
<p><a name="impl-5" id="impl-5"></a>How pipeline outputs are
connected to XML documents outside the pipeline is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<div class="section">
<h5><a name="external-docs" id=
"external-docs"></a>2.2.1&#160;External Documents</h5>
<p>It's common for some of the documents used in processing a
pipeline to be read from URIs. Sometimes this occurs directly, for
example with a <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> element. Sometimes it occurs
indirectly, for example if an implementation allows the URI of a
pipeline input to be specified on the command line or if an
<a href="#c.xslt"><tt class="tag-element">p:xslt</tt></a> step
encounters an <tt class="tag-element">xsl:import</tt> in the
stylesheet that it is processing. It's also common for some of the
documents produced in processing a pipeline to be written to
locations which have, or at least could have, a URI.</p>
<p>The process of dereferencing a URI to retrieve a document is
often more interesting than it seems at first. On the web, it may
involve caches, proxies, and various forms of indirection. <a name=
"impl-6" id="impl-6"></a>Resolving a URI locally may involve
resolvers of various sorts and possibly appeal to <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>
mechanisms such as catalog files.</p>
<p>In XProc, the situation is made even more interesting by the
fact that many intermediate results produced by steps in the
pipeline have base URIs. <a name="impl-7" id="impl-7"></a>Whether
(and when and how) or not the intermediate results that pass
between steps are ever written to a filesystem is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p><a name="impl-8" id="impl-8"></a>In Version 1.0 of XProc, how
(or if) implementers provide local resolution mechanisms and how
(or if) they provide access to intermediate results by URI is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Version 1.0 of XProc does not require implementations to
guarantee that multiple attempts to dereference the same URI always
produce consistent results.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>On the one hand, this is a somewhat unsatisfying state of
affairs because it leaves room for interoperability problems. On
the other, it is not expected to cause such problems very often in
practice.</p>
<p>If these problems arise in practice, implementers are encouraged
to use the existing extension mechanisms to give users the control
needed to circumvent them. Should such mechanisms become
widespread, a standard mechanism could be added in some future
version of the language.</p>
</div>
</div>
<div class="section">
<h5><a name="binary" id="binary"></a>2.2.2&#160;Non-XML
Documents</h5>
<p>XProc is designed to allow pipeline authors to specify how an
XML document, or sequence of XML documents, flows through a series
of steps. For the most part, non-XML documents are considered
out-of-scope.</p>
<p>However, to be useful, XProc pipelines must interact with the
real world where non-XML documents (HTML documents, raster images,
non-XML encodings of data, etc.) are a fact of life.</p>
<p>Accordingly, some pipelines may need to access non-XML documents
and some non-XML documents may “leak” into pipelines. XProc
provides a limited set of tools for processing these documents. In
particular, XProc offers the ability to turn some “almost-XML”
documents into XML and to allow some non-XML documents to flow
quietly through the pipeline.</p>
<p>It <em>is not</em> a goal of XProc that it should be a
general-purpose pipeline language for manipulating arbitrary,
non-XML resources.</p>
<p>There are two standard ways that a non-XML document may enter a
pipeline: directly through <a href="#p.data"><tt class=
"tag-element">p:data</tt></a> or as the result of performing an
<a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step. Loading non-XML data
with a computed URI requires the <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
step. Implementors are encouraged to support the <tt class=
"literal">file:</tt> URI scheme so that users can load local data
from computed URIs.</p>
<p>In either case, non-XML documents are converted into text or are
base64-encoded, depending on their content type and character
encoding. The result is an XML document that consists of a document
element containing either escaped text or base64-encoded text. This
document can be processed like any other XML document.</p>
<p>The <a href="#c.unescape-markup"><tt class=
"tag-element">p:unescape-markup</tt></a> step can be used to
(attempt to) convert a non-XML document into XML. Well-formed XML
that just happens to be represented with escaped markup can always
be recovered. For other media types, the ability to construct XML
and the precise mechanisms used to make the markup well-formed are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>XProc provides no standard means to save encoded data in its
unencoded binary form. Implementors may provide extension methods
to allow the <a href="#c.store"><tt class=
"tag-element">p:store</tt></a> step to save the binary data. For
example, an implementation might provide a <tt class=
"code">ext:binary</tt> serialization method that decoded base64
encoded data before saving it:</p>
<div class="programlisting">
<pre>
&lt;p:store method="ext:binary" href="my.png"&gt;
&lt;p:input port="source"&gt;
&lt;p:inline&gt;
&lt;c:data content-type="image/png"&gt;BASE64ENCODEDDATA&lt;/c:data&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:store&gt;
</pre></div>
</div>
</div>
<div class="section">
<h4><a name="primary-input-output" id=
"primary-input-output"></a>2.3&#160;Primary Inputs and Outputs</h4>
<p>As a convenience for pipeline authors, each step may have one
input port designated as the primary input port and one output port
designated as the primary output port.</p>
<p><span class="termdef" id="dt-primary-input-port">[Definition: If
a step has a document input port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document input port and that port is <em>not</em> explicitly marked
<tt class="code">primary='false'</tt>”, then that input port is
the <em class="glossterm">primary input port</em> of the
step.]</span> If a step has a single input port and that port is
explicitly marked “<tt class="code">primary='false'</tt>”, or if a
step has more than one input port and none is explicitly marked as
the primary, then the primary input port of that step is undefined.
A step can have at most one primary input port.</p>
<p><span class="termdef" id="dt-primary-output-port">[Definition:
If a step has a document output port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document output port and that port is <em>not</em> explicitly
marked “<tt class="code">primary='false'</tt>”, then that output
port is the <em class="glossterm">primary output port</em> of the
step.]</span> If a step has a single output port and that port is
explicitly marked “<tt class="code">primary='false'</tt>”, or if a
step has more than one output port and none is explicitly marked as
the primary, then the primary output port of that step is
undefined. A step can have at most one primary output port.</p>
<p>The special significance of primary input and output ports is
that they are connected automatically by the processor if no
explicit connection is given. Generally speaking, if two steps
appear sequentially in a subpipeline, then the primary output of
the first step will automatically be connected to the primary input
of the second.</p>
<p>Additionally, if a compound step has no declared outputs and the
<em class="glossterm"><a href="#dt-last-step">last step</a></em> in
its subpipeline has an unconnected primary output, then an implicit
primary output port will be added to the compound step (and
consequently the last step's primary output will be connected to
it). This implicit output port has no name. It inherits the
<tt class="tag-attribute">sequence</tt> property of the port
connected to it. This rule does not apply to <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>;
step declarations must provide explicit names for all of their
outputs.</p>
</div>
<div class="section">
<h4><a name="connections" id=
"connections"></a>2.4&#160;Connections</h4>
<p>Steps are connected together by their input ports and output
ports. <a name="err.inline.S0001" id="err.inline.S0001"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0001"><code class=
"errqname">err:XS0001</code></a>) if there are any loops in the
connections between steps: no step can be connected to itself nor
can there be any sequence of connections through other steps that
leads back to itself.</p>
<div class="section">
<h5><a name="namespace-fixup" id=
"namespace-fixup"></a>2.4.1&#160;Namespace Fixup on Outputs</h5>
<p>XProc processors are expected, and sometimes required, to
perform <em class="glossterm"><a href=
"#dt-namespace-fixup">namespace fixup</a></em>. Unless the
semantics of a step explicitly says otherwise:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The in-scope namespaces associated with a node (even those that
are inherited from namespace bindings that appear among its
ancestors in the document in which it appears initially) are
assumed to travel with that node.</p>
</li>
<li>
<p>Changes to one part of a tree (wrapping or unwrapping a node or
renaming an element, for example) do not change the in-scope
namespaces associated with the descendants of the node so
changed.</p>
</li>
</ul>
</div>
<p>As a result, some steps can produce XML documents which have no
direct serialization (because they include nodes with conflicting
or missing namespace declarations, for example). <span class=
"termdef" id="dt-namespace-fixup">[Definition: To produce a
serializable <em class="glossterm"><a href="#dt-XML">XML</a></em>
document, the XProc processor must sometimes add additional
namespace nodes, perhaps even renaming prefixes, to satisfy the
constraints of <em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em>. This process is
referred to as <em class="glossterm">namespace
fixup</em>.]</span></p>
<p>Implementors are encouraged to perform <em class=
"glossterm"><a href="#dt-namespace-fixup">namespace fixup</a></em>
before passing documents between steps, but they are not required
to do so. Conversely, an implementation which <em>does</em>
serialize between steps and therefore must perform such fixups, or
reject documents that cannot be serialized, is also conformant.</p>
<p>Except where the semantics of a step explicitly require changes,
processors are required to preserve the information in the
documents and fragments they manipulate. In particular, the
information corresponding to the [<a href=
"#xml-infoset-rec"><span class="abbrev">Infoset</span></a>]
properties <tt class="literal">[attributes]</tt>, <tt class=
"literal">[base URI]</tt>, <tt class="literal">[children]</tt>,
<tt class="literal">[local name]</tt>, <tt class=
"literal">[namespace name]</tt>, <tt class="literal">[normalized
value]</tt>, <tt class="literal">[owner]</tt>, and <tt class=
"literal">[parent]</tt> <span class="rfc2119">must</span> be
preserved.</p>
<p>The information corresponding to <tt class=
"literal">[prefix]</tt>, <tt class="literal">[in-scope
namespaces]</tt>, <tt class="literal">[namespace attributes]</tt>,
and <tt class="literal">[attribute type]</tt> <span class=
"rfc2119">should</span> be preserved, with changes to the first
three only as required for <em class="glossterm"><a href=
"#dt-namespace-fixup">namespace fixup</a></em>. In particular,
processors are encouraged to take account of prefix information in
creating new namespace bindings, to minimize negative impact on
prefixed names in content.</p>
<p><a name="impl-9" id="impl-9"></a>Except for cases which are
specifically called out in <a href="#std-components" title=
"Standard Step Library">Section&#160;7, “Standard Step
Library”</a>, the extent to which namespace fixup, and other checks
for outputs which cannot be serialized, are performed on
intermediate outputs is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Whenever an implementation serializes pipeline contents, for
example for pipeline outputs, logging, or as part of steps such as
<a href="#c.store"><tt class="tag-element">p:store</tt></a> or
<a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a>, it is a <a href=
"#err.D0001">dynamic error</a> if that serialization could not be
done so as to produce a document which is both well-formed and
namespace-well-formed, as specified in <em class=
"glossterm"><a href="#dt-XML">XML</a></em> and <em class=
"glossterm"><a href="#dt-Namespaces-in-XML">Namespaces in
XML</a></em>, regardless of what serialization method, if any, is
called for.</p>
</div>
</div>
<div class="section">
<h4><a name="environment" id=
"environment"></a>2.5&#160;Environment</h4>
<p><span class="termdef" id="dt-environment">[Definition: The
<em class="glossterm">environment</em> is a context-dependent
collection of information available within subpipelines.]</span>
Most of the information in the environment is static and can be
computed for each subpipeline before evaluation of the pipeline as
a whole begins. The in-scope bindings have to be calculated as the
pipeline is being evaluated.</p>
<p>The environment consists of:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>A set of readable ports. <span class="termdef" id=
"dt-readable-ports">[Definition: The <em class="glossterm">readable
ports</em> are a set of step name/port name pairs.]</span> Inputs
and outputs can only be connected to readable ports.</p>
</li>
<li>
<p>A default readable port. <span class="termdef" id=
"dt-default-readable-port">[Definition: The <em class=
"glossterm">default readable port</em>, which may be undefined, is
a specific step name/port name pair from the set of readable
ports.]</span></p>
</li>
<li>
<p>A set of in-scope bindings. <span class="termdef" id=
"dt-in-scope-bindings">[Definition: The <em class=
"glossterm">in-scope bindings</em> are a set of name-value pairs,
based on <em class="glossterm"><a href="#dt-option">option</a></em>
and <em class="glossterm"><a href="#dt-variable">variable</a></em>
bindings.]</span></p>
</li>
</ol>
</div>
<p><span class="termdef" id="dt-empty-environment">[Definition: The
<em class="glossterm">empty environment</em> contains no readable
ports, an undefined default readable port and no in-scope
bindings.]</span></p>
<p>Unless otherwise specified, the environment of a <em class=
"glossterm"><a href="#dt-contained-steps">contained step</a></em>
is its <em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em>.
<span class="termdef" id="dt-inherited-environment">[Definition:
The <em class="glossterm">inherited environment</em> of a
<em class="glossterm"><a href="#dt-contained-steps">contained
step</a></em> is an environment that is the same as the environment
of its <em class="glossterm"><a href=
"#dt-container">container</a></em> with the <a href=
"#dt-standard-modifications">standard modifications</a>.
]</span></p>
<p>The <span id="dt-standard-modifications">standard
modifications</span> made to an inherited environment are:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>The declared inputs of the container are added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
<p>In other words, contained steps can see the inputs to their
container.</p>
</li>
<li>
<p>The union of all the declared outputs of all of the step's
sibling steps are added to the <em class="glossterm"><a href=
"#dt-readable-ports">readable ports</a></em>.</p>
<p>In other words, sibling steps can see each other's outputs in
addition to the outputs visible to their container.</p>
</li>
<li>
<p>If there is a preceding sibling step element:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If that preceding sibling has a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, then that
output port becomes the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>.</p>
</li>
<li>
<p>Otherwise, the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined.</p>
</li>
</ul>
</div>
</li>
<li>
<p>If there <em>is not</em> a preceding sibling step element:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the container has a <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>, the
<em class="glossterm"><a href="#dt-default-readable-port">default
readable port</a></em> is that <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>.</p>
</li>
<li>
<p>Otherwise, the default readable port is unchanged.</p>
</li>
</ul>
</div>
</li>
<li>
<p>The names and values from each <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a> present at the beginning of the
container are added, in document order, to the <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em>. A new binding replaces an old binding with the
same name. See <a href="#p.variable" title=
"p:variable">Section&#160;5.7.1, “p:variable”</a> for the
specification of variable evaluation.</p>
</li>
</ol>
</div>
<p>A step with no parent inherits the <em class=
"glossterm"><a href="#dt-empty-environment">empty
environment</a></em>.</p>
</div>
<div class="section">
<h4><a name="xpath-context" id="xpath-context"></a>2.6&#160;XPaths
in XProc</h4>
<p>XProc uses XPath as an expression language. XPath expressions
are evaluated by the XProc processor in several places: on compound
steps, to compute the default values of options and the values of
variables; on atomic steps, to compute the actual values of options
and the values of parameters.</p>
<p>XPath expressions are also passed to some steps. These
expressions are evaluated by the implementations of the individual
steps.</p>
<p>This distinction can be seen in the following example:</p>
<div class="programlisting">
<pre>
&lt;p:variable name="home" select="'http://example.com/docs'"/&gt;
&lt;p:load name="read-from-home"&gt;
&lt;p:with-option name="href" select="concat($home,'/document.xml')"/&gt;
&lt;/p:load&gt;
&lt;p:split-sequence name="select-chapters" test="@role='chapter'"&gt;
&lt;p:input port="source" select="//section"/&gt;
&lt;/p:split-sequence&gt;
</pre></div>
<p>The select expression on the variable “<tt class=
"varname">home</tt>” is evaluated by the XProc processor. The value
of the variable is “<tt class=
"uri">http://example.com/docs</tt>”.</p>
<p>The <tt class="option">href</tt> option of the <a href=
"#c.load"><tt class="tag-element">p:load</tt></a> step is evaluated
by the XProc processor. The actual <tt class="literal">href</tt>
option received by the step is simply the string literal
<tt class="uri">http://example.com/docs/document.xml</tt>”. (The
select expression on the <tt class="literal">source</tt> input of
the <a href="#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a> step is also evaluated by
the XProc processor.)</p>
<p>The XPath expression “<tt class="literal">@role='chapter'</tt>
is passed literally to the <tt class="literal">test</tt> option on
the <a href="#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a> step. That's because the
nature of the <a href="#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a> is that <em>it
evaluates</em> the expression. Only some options on some steps
expect XPath expressions.</p>
<p>The XProc processor evaluates all of the XPath expressions in
<tt class="tag-attribute">select</tt> attributes on variables,
options, parameters, and inputs, in <tt class=
"tag-attribute">match</tt> attributes on <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a>, and in
<tt class="tag-attribute">test</tt> attributes on <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> steps.</p>
<p>An XProc implementation can use <em>either</em> [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] or [<a href=
"#xpath2"><span class="abbrev">XPath 2.0</span></a>] to evaluate
these expressions.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Allowing either XPath 1.0 or XPath 2.0 is a compromise driven
entirely by the timing of XProc development. During the development
of this specification, the community indicated that it was too
early to mandate that all implementations use XPath 2.0 and too
late to mandate that all implementations use XPath 1.0.</p>
</div>
<p>Many, many expressions that are likely to be used in XProc
pipelines are the same in both versions (simple element tests,
ancestor and descendant tests, string-based attribute tests,
etc.).</p>
<p>As an aid to interoperability, pipeline authors may indicate the
version of XPath that they require. The attribute <tt class=
"tag-attribute">xpath-version</tt> may be used on <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>, <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
or <a href="#p.library"><tt class="tag-element">p:library</tt></a>
to identify the XPath version that <span class=
"rfc2119">must</span> be used to evaluate XPath expressions on the
pipeline(s). The attribute is lexically scoped, but see below.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In Version 1.0 of XProc, no similar level of control is provided
for specifying (or testing) the version of XSLT used when
evaluating <tt class="type">XSLTMatchPattern</tt>s. The expectation
is that XPath 1.0 processors will be using XSLT 1.0 match patterns
and XPath 2.0 processors will be using XSLT 2.0 match patterns, but
that is not necessarily the case.</p>
<p>As XPath, XSLT, and XProc continue to evolve, additional
facilities for specifying and testing the version of XSLT used to
evaluate match patterns may be added to XProc.</p>
</div>
<p>If an <tt class="tag-attribute">xpath-version</tt> is specified
on a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
then that is the version of XPath that the step requires. If it
does not specify a version, but a version is specified on one of
its ancestors, the nearest ancestor version specified is the
version that it requires. An <tt class=
"tag-attribute">xpath-version</tt> attribute on a <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> specifies a
default version for all steps defined in that library. <a name=
"impl-10" id="impl-10"></a>If no version is specified on the step
or among its ancestors, then its XPath version is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The decision about which XPath version applies can be made
dynamically. For example, if a pipeline explicitly labeled with
<tt class="tag-attribute">xpath-version</tt> “1.0” imports a
library that does not specify a version, the implementation may
elect to make the implementation-defined XPath version of the steps
in the library also “1.0”. If the same implementation imports that
library into a pipeline explicitly labeled with <tt class=
"tag-attribute">xpath-version</tt> “2.0”, it can make the
implementation-defined version of those steps “2.0”.</p>
</div>
<p>The following rules determine how the indicated version and the
implementation's actual version interact:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the indicated version and the implementation version are the
same, then that version is used.</p>
</li>
<li>
<p>If the indicated version is 1.0 and the implementation uses
XPath 2.0 (or later), the expression <span class=
"rfc2119">must</span> be evaluated in XPath 1.0 compatibility mode.
<a name="err.inline.D0024" id="err.inline.D0024"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0024"><code class=
"errqname">err:XD0024</code></a>) if a 2.0 processor encounters an
XPath 1.0 expression and it does not support XPath 1.0
compatibility mode.</p>
</li>
<li>
<p>Otherwise: <a name="err.inline.D0027" id=
"err.inline.D0027"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0027"><code class="errqname">err:XD0027</code></a>) if the
processor encounters an <tt class=
"tag-attribute">xpath-version</tt> that it does not support.</p>
</li>
</ol>
</div>
<p>XProc processors divide naturally into two classes: XPath 1.0
processors and XPath 2.0 processors.</p>
<p>Irrespective of which version of XPath is used, all expressions
evaluated by XProc or passed to steps for evaluation must be valid
XPath expressions. <a name="err.inline.D0023" id=
"err.inline.D0023"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0023"><code class="errqname">err:XD0023</code></a>) if an
XPath expression is encountered which cannot be evaluated (because
it is syntactically incorrect, contains references to unbound
variables or unknown functions, or for any other reason).</p>
<div class="section">
<h5><a name="xpath10-processors" id=
"xpath10-processors"></a>2.6.1&#160;XPath 1.0 processors</h5>
<p>XProc processors that support only XPath 1.0 do not support any
types (or features) beyond those described in [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>]. They use the
XPath 1.0 data model. Processors <span class="rfc2119">must</span>
implement all of the XPath 1.0 functions, but are not expected to
implement the functions described in [<a href=
"#xslt10"><span class="abbrev">XSLT 1.0</span></a>].</p>
<div class="section">
<h6><a name="xproc-xpath-context-10" id=
"xproc-xpath-context-10"></a>2.6.1.1&#160;Processor XPath
Context</h6>
<p>When the XProc processor evaluates an XPath expression using
XPath 1.0, unless otherwise indicated by a particular step, it does
so with the following initial context:</p>
<div class="variablelist">
<dl>
<dt>context node</dt>
<dd>
<p>The document node of a document. The document is either
specified with a <em class="glossterm"><a href=
"#dt-connection">connection</a></em> or is taken from the
<em class="glossterm"><a href="#dt-default-readable-port">default
readable port</a></em>. <a name="err.inline.D0008" id=
"err.inline.D0008"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0008"><code class="errqname">err:XD0008</code></a>) if a
document sequence appears where a document to be used as the
context node is expected.</p>
<p>If there is no explicit connection and there is no default
readable port then the context node is an empty document node.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The context position and context size are both “1”.</p>
</dd>
<dt>variable bindings</dt>
<dd>
<p>The union of the in-scope <em class="glossterm"><a href=
"#dt-specified-options">specified options</a></em> and variables
are available as variable bindings to the XPath processor.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>An option that has neither a specified value nor a default value
will not appear as an in-scope variable. Consequently, an attempt
to refer to that variable will raise an error.</p>
</div>
</dd>
<dt>function library</dt>
<dd>
<p>The [<a href="#xpath"><span class="abbrev">XPath 1.0</span></a>]
core function library and the <a href="#xpath-extension-functions"
title="XPath Extension Functions">Section&#160;2.7, “XPath
Extension Functions”</a>. Function names that do not contain a
colon always refer to the XPath 1.0 functions, any in-scope binding
for the default namespace <em>does not</em> apply.</p>
</dd>
<dt>in-scope namespaces</dt>
<dd>
<p>The namespace bindings in-scope on the element where the
expression occurred.</p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h6><a name="step-xpath-context-10" id=
"step-xpath-context-10"></a>2.6.1.2&#160;Step XPath Context</h6>
<p>When <em>a step</em> evaluates an XPath expression using XPath
1.0, unless otherwise indicated by a particular step, it does so
with the following initial context:</p>
<div class="variablelist">
<dl>
<dt>context node</dt>
<dd>
<p>The document node that appears on the primary input port of the
step, unless otherwise specified by the step.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The position and size are both “1”, unless otherwise specified
by the step.</p>
</dd>
<dt>variable bindings</dt>
<dd>
<p>None, unless otherwise specified by the step.</p>
</dd>
<dt>function library</dt>
<dd>
<p>The [<a href="#xpath"><span class="abbrev">XPath 1.0</span></a>]
core function library, unless otherwise specified by the step.
Function names that do not contain a colon always refer to the
XPath 1.0 functions, any in-scope binding for the default namespace
<em>does not</em> apply.</p>
</dd>
<dt>in-scope namespaces</dt>
<dd>
<p>The set of namespace bindings provided by the XProc processor.
The processor computes this set of bindings by taking a union of
the bindings on the step element itself as well as the bindings on
any of the options and parameters used in computing values for the
step (see <a href="#opt-param-bindings" title=
"Namespaces on variables, options, and parameters">Section&#160;5.7.5,
“Namespaces on variables, options, and parameters”</a>).</p>
<p><a name="impl-11" id="impl-11"></a>The results of computing the
union of namespaces in the presence of conflicting declarations for
a particular prefix are <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
</dl>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Some steps may also provide for implementation-defined or
implementation-dependent amendments to the contexts. Those
amendments are in addition to any specified by XProc.</p>
</div>
</div>
</div>
<div class="section">
<h5><a name="xpath20-processors" id=
"xpath20-processors"></a>2.6.2&#160;XPath 2.0 processors</h5>
<p>XProc processors that support XPath 2.0 are XPath 2.0
processors. Such processors can refer to the primitive atomic
schema types, but cannot import additional types.</p>
<p>XPath 2.0 processors <span class="rfc2119">must</span> implement
all of the XPath 2.0 functions, but are not expected to implement
the functions described in [<a href="#xslt20"><span class=
"abbrev">XSLT 2.0</span></a>].</p>
<div class="section">
<h6><a name="xproc-xpath-context-20" id=
"xproc-xpath-context-20"></a>2.6.2.1&#160;Processor XPath
Context</h6>
<p>When the XProc processor evaluates an XPath expression using
XPath 2.0, unless otherwise indicated by a particular step, it does
so with the following static context:</p>
<div class="variablelist">
<dl>
<dt>XPath 1.0 compatibility mode</dt>
<dd>
<p>Is true if the indicated XPath version is 1.0, false
otherwise.</p>
</dd>
<dt>Statically known namespaces</dt>
<dd>
<p>The namespace declarations in-scope for the containing
element.</p>
</dd>
<dt>Default element/type namespace</dt>
<dd>
<p>The null namespace.</p>
</dd>
<dt>Default function namespace</dt>
<dd>
<p>The [<a href="#xpath2"><span class="abbrev">XPath
2.0</span></a>] function namespace. Function names that do not
contain a colon always refer to the default function namespace, any
in-scope binding for the default namespace <em>does not</em> apply.
This specification does not provide a mechanism to override the
default function namespace.</p>
</dd>
<dt>In-scope schema definitions</dt>
<dd>
<p>A basic XPath 2.0 XProc processor includes the following named
type definitions in its in-scope schema definitions:</p>
<div class="itemizedlist">
<ul>
<li>
<p>All the primitive atomic types defined in [<a href=
"#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>], with the exception of <tt class=
"literal">xs:NOTATION</tt>. That is: <tt class=
"literal">xs:string</tt>, <tt class="literal">xs:boolean</tt>,
<tt class="literal">xs:decimal</tt>, <tt class=
"literal">xs:double</tt>, <tt class="literal">xs:float</tt>,
<tt class="literal">xs:date</tt>, <tt class="literal">xs:time</tt>,
<tt class="literal">xs:dateTime</tt>, <tt class=
"literal">xs:duration</tt>, <tt class="literal">xs:QName</tt>,
<tt class="literal">xs:anyURI</tt>, <tt class=
"literal">xs:gDay</tt>, <tt class="literal">xs:gMonthDay</tt>,
<tt class="literal">xs:gMonth</tt>, <tt class=
"literal">xs:gYearMonth</tt>, <tt class="literal">xs:gYear</tt>,
<tt class="literal">xs:base64Binary</tt>, and <tt class=
"literal">xs:hexBinary</tt>.</p>
</li>
<li>
<p>The derived atomic type <tt class="literal">xs:integer</tt>
defined in [<a href="#xmlschema-2"><span class="abbrev">W3C XML
Schema: Part 2</span></a>].</p>
</li>
<li>
<p>The types <tt class="literal">xs:anyType</tt>, <tt class=
"literal">xs:anySimpleType</tt>, <tt class=
"literal">xs:yearMonthDuration</tt>, <tt class=
"literal">xs:dayTimeDuration</tt>, <tt class=
"literal">xs:anyAtomicType</tt>, <tt class=
"literal">xs:untyped</tt>, and <tt class=
"literal">xs:untypedAtomic</tt> defined in [<a href=
"#xpath-datamodel"><span class="abbrev">XQuery 1.0 and XPath 2.0
Data Model (XDM)</span></a>].</p>
</li>
</ul>
</div>
</dd>
<dt>In-scope variables</dt>
<dd>
<p>The union of the in-scope <em class="glossterm"><a href=
"#dt-specified-options">specified options</a></em> and variables
are available as variable bindings to the XPath processor.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>An option that has neither a specified value nor a default value
will not appear as an in-scope variable. Consequently, an attempt
to refer to that variable will raise an error.</p>
</div>
</dd>
<dt>Context item static type</dt>
<dd>
<p>Document.</p>
</dd>
<dt>Function signatures</dt>
<dd>
<p>The signatures of the [<a href="#xpath-functions"><span class=
"abbrev">XPath 2.0 Functions and Operators</span></a>] and the
<a href="#xpath-extension-functions" title=
"XPath Extension Functions">Section&#160;2.7, “XPath Extension
Functions”</a>.</p>
</dd>
<dt>Statically known collations</dt>
<dd>
<p>Implementation-defined but <span class="rfc2119">must</span>
include the Unicode code point collation. <a name="impl-12" id=
"impl-12"></a>The version of Unicode supported is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>, but
it is recommended that the most recent version of Unicode be
used.</p>
</dd>
<dt>Default collation</dt>
<dd>
<p>Unicode code point collation.</p>
</dd>
<dt>Base URI</dt>
<dd>
<p>The base URI of the element on which the expression occurs.</p>
</dd>
<dt>Statically known documents</dt>
<dd>
<p>None.</p>
</dd>
<dt>Statically known collections</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
<p>And the following dynamic context:</p>
<div class="variablelist">
<dl>
<dt>context item</dt>
<dd>
<p>The document node of a document. The document is either
specified with a <em class="glossterm"><a href=
"#dt-connection">connection</a></em> or is taken from the
<em class="glossterm"><a href="#dt-default-readable-port">default
readable port</a></em>. <a name="err.inline.D0008.1" id=
"err.inline.D0008.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0008"><code class="errqname">err:XD0008</code></a>) if a
document sequence appears where a document to be used as the
context node is expected.</p>
<p>If there is no explicit connection and there is no default
readable port then the context node is undefined.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The context position and context size are both “1”.</p>
</dd>
<dt>Variable values</dt>
<dd>
<p>The union of the in-scope options and variables are available as
variable bindings to the XPath processor.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The [<a href="#xpath-functions"><span class="abbrev">XPath 2.0
Functions and Operators</span></a>] and the <a href=
"#xpath-extension-functions" title=
"XPath Extension Functions">Section&#160;2.7, “XPath Extension
Functions”</a>.</p>
</dd>
<dt>Current dateTime</dt>
<dd>
<p><a name="impl-13" id="impl-13"></a>The point in time returned as
the current dateTime is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Implicit timezone</dt>
<dd>
<p><a name="impl-14" id="impl-14"></a>The implicit timezone is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Available documents</dt>
<dd>
<p><a name="impl-15" id="impl-15"></a>The set of available
documents (those that may be retrieved with a URI) is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Available collections</dt>
<dd>
<p><a name="impl-16" id="impl-16"></a>The set of available
collections is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h6><a name="step-xpath-context-20" id=
"step-xpath-context-20"></a>2.6.2.2&#160;Step XPath Context</h6>
<p>When a step evaluates an XPath expression using XPath 2.0,
unless otherwise indicated by a particular step, it does so with
the following static context:</p>
<div class="variablelist">
<dl>
<dt>XPath 1.0 compatibility mode</dt>
<dd>
<p>Is true if the indicated XPath version is 1.0, false
otherwise.</p>
</dd>
<dt>Statically known namespaces</dt>
<dd>
<p>The namespace declarations in-scope for the containing element
or made available through <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a>.</p>
</dd>
<dt>Default element/type namespace</dt>
<dd>
<p>The null namespace.</p>
</dd>
<dt>Default function namespace</dt>
<dd>
<p>The [<a href="#xpath2"><span class="abbrev">XPath
2.0</span></a>] function namespace. Function names that do not
contain a colon always refer to the default function namespace, any
in-scope binding for the default namespace <em>does not</em> apply.
This specification does not provide a mechanism to override the
default function namespace.</p>
</dd>
<dt>In-scope schema definitions</dt>
<dd>
<p>The same as the <a href="#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</p>
</dd>
<dt>In-scope variables</dt>
<dd>
<p>None, unless otherwise specified by the step.</p>
</dd>
<dt>Context item static type</dt>
<dd>
<p>Document.</p>
</dd>
<dt>Function signatures</dt>
<dd>
<p>The signatures of the [<a href="#xpath-functions"><span class=
"abbrev">XPath 2.0 Functions and Operators</span></a>].</p>
</dd>
<dt>Statically known collations</dt>
<dd>
<p>Implementation-defined but <span class="rfc2119">must</span>
include the Unicode code point collation.</p>
</dd>
<dt>Default collation</dt>
<dd>
<p>Unicode code point collation.</p>
</dd>
<dt>Base URI</dt>
<dd>
<p>The base URI of the element on which the expression occurs.</p>
</dd>
<dt>Statically known documents</dt>
<dd>
<p>None.</p>
</dd>
<dt>Statically known collections</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
<p>And the following initial dynamic context:</p>
<div class="variablelist">
<dl>
<dt>context item</dt>
<dd>
<p>The document node of the document that appears on the primary
input of the step, unless otherwise specified by the step.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The context position and context size are both “1”, unless
otherwise specified by the step.</p>
</dd>
<dt>Variable values</dt>
<dd>
<p>None, unless otherwise specified by the step.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The [<a href="#xpath-functions"><span class="abbrev">XPath 2.0
Functions and Operators</span></a>].</p>
</dd>
<dt>Current dateTime</dt>
<dd>
<p>An implementation-defined point in time.</p>
</dd>
<dt>Implicit timezone</dt>
<dd>
<p><a name="impl-17" id="impl-17"></a>The implicit timezone is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Available documents</dt>
<dd>
<p><a name="impl-18" id="impl-18"></a>The set of available
documents (those that may be retrieved with a URI) is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Available collections</dt>
<dd>
<p>None.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Some steps may also provide for implementation-defined or
implementation-dependent amendments to the contexts. Those
amendments are in addition to any specified by XProc.</p>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="xpath-extension-functions" id=
"xpath-extension-functions"></a>2.7&#160;XPath Extension
Functions</h4>
<p>The XProc processor <span class="rfc2119">must</span> support
the additional functions described in this section in XPath
expressions evaluated by the processor.</p>
<p>In the following descriptions, the names of types (<tt class=
"type">string</tt>, <tt class="type">boolean</tt>, etc.) should be
taken to mean the corresponding [<a href=
"#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>] data types for an implementation that uses XPath 2.0
and as the most appropriate XPath 1.0 types for an XPath 1.0
implementation.</p>
<div class="section">
<h5><a name="f.system-property" id=
"f.system-property"></a>2.7.1&#160;System Properties</h5>
<p>XPath expressions within a pipeline document can interrogate the
processor for information about the current state of the pipeline.
Various aspects of the processor are exposed through the <a href=
"#f.system-property"><tt class=
"function">p:system-property</tt></a> function in the pipeline
namespace:</p>
<div class="funcsynopsis"><span class=
"funcname">p:system-property</span><span class=
"funcparen">(</span><span class="paramname">$property</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span></div>
<p>The <tt class="varname">$property</tt> string must have the form
of a <a href="http://www.w3.org/TR/xml-names/#NT-QName">QName</a>;
the QName is expanded into a name using the namespace declarations
in scope for the expression. <a name="err.inline.D0015" id=
"err.inline.D0015"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0015"><code class="errqname">err:XD0015</code></a>) if the
specified QName cannot be resolved with the in-scope namespace
declarations. The <a href="#f.system-property"><tt class=
"function">p:system-property</tt></a> function returns the string
representing the value of the system property identified by the
QName. If there is no such property, the empty string <span class=
"rfc2119">must</span> be returned.</p>
<p>Implementations <span class="rfc2119">must</span> provide the
following system properties, which are all in the XProc
namespace:</p>
<div class="variablelist">
<dl>
<dt><tt class="varname">p:episode</tt></dt>
<dd>
<p>Returns a string which <span class="rfc2119">should</span> be
unique for each invocation of the pipeline processor. In other
words, if a processor is run several times in succession, or if
several processors are running simultaneously, each invocation of
each processor should get a distinct value from <tt class=
"varname">p:episode</tt>.</p>
<p>The unique identifier must be a valid <a href=
"http://www.w3.org/TR/XML#NT-Name">XML name</a>.</p>
</dd>
<dt><tt class="varname">p:language</tt></dt>
<dd>
<p>Returns a string which identifies the current language, for
example, for message localization purposes. <a name="impl-19" id=
"impl-19"></a>The exact format of the language string is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> but
<span class="rfc2119">should</span> be consistent with the
<tt class="tag-attribute">xml:lang</tt> attribute.</p>
</dd>
<dt><tt class="varname">p:product-name</tt></dt>
<dd>
<p>Returns a string containing the name of the implementation, as
defined by the implementer. This should normally remain constant
from one release of the product to the next. It should also be
constant across platforms in cases where the same source code is
used to produce compatible products for multiple execution
platforms.</p>
</dd>
<dt><tt class="varname">p:product-version</tt></dt>
<dd>
<p>Returns a string identifying the version of the implementation,
as defined by the implementer. This should normally vary from one
release of the product to the next, and at the discretion of the
implementer it may also vary across different execution
platforms.</p>
</dd>
<dt><tt class="varname">p:vendor</tt></dt>
<dd>
<p>Returns a string which identifies the vendor of the
processor.</p>
</dd>
<dt><tt class="varname">p:vendor-uri</tt></dt>
<dd>
<p>Returns a URI which identifies the vendor of the processor.
Often, this is the URI of the vendor's web site.</p>
</dd>
<dt><tt class="varname">p:version</tt></dt>
<dd>
<p>Returns the version(s) of XProc implemented by the processor as
a space-separated list. For example, a processor that supports
XProc 1.0 would return “1.0”; a processor that supports XProc 1.0
and 2.0 would return “1.0 2.0”; a processor that supports only
XProc 2.0 would return “2.0”.</p>
</dd>
<dt><tt class="varname">p:xpath-version</tt></dt>
<dd>
<p>Returns the version(s) of XPath implemented by the processor for
evaluating XPath expressions on XProc elements. The result is a
space-separated list of versions supported. For example, a
processor that only supports XPath 1.0 would return “1.0”; a
processor that supports XPath 2.0 and XPath 1.0 backwards
compatibility mode could return “1.0 2.0”; a processor that
supports only XPath 2.0 would return “2.0”.</p>
</dd>
<dt><tt class="varname">p:psvi-supported</tt></dt>
<dd>
<p>Returns true if the implementation supports passing PSVI
annotations between steps, false otherwise.</p>
</dd>
</dl>
</div>
<p>Implementations may support additional system properties but
such properties <span class="rfc2119">must</span> be in a namespace
and <span class="rfc2119">must not</span> be in the XProc
namespace.</p>
</div>
<div class="section">
<h5><a name="f.step-available" id=
"f.step-available"></a>2.7.2&#160;Step Available</h5>
<p>The <a href="#f.step-available"><tt class=
"function">p:step-available</tt></a> function reports whether or
not a particular type of step is understood by the processor.</p>
<div class="funcsynopsis"><span class=
"funcname">p:step-available</span><span class=
"funcparen">(</span><span class="paramname">$step-name</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>The <tt class="varname">$step-type</tt> string <span class=
"rfc2119">must</span> have the form of a QName; the QName is
expanded into a name using the namespace declarations in-scope for
the expression. The <a href="#f.step-available"><tt class=
"function">p:step-available</tt></a> function returns true if and
only if the processor knows how to evaluate steps of the specified
type.</p>
</div>
<div class="section">
<h5><a name="f.value-available" id=
"f.value-available"></a>2.7.3&#160;Value Available</h5>
<p>The <a href="#f.value-available"><tt class=
"function">p:value-available</tt></a> function reports whether or
not a particular in-scope option has a value.</p>
<div class="funcsynopsis"><span class=
"funcname">p:value-available</span><span class=
"funcparen">(</span><span class="paramname">$option-name</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<div class="funcsynopsis"><span class=
"funcname">p:value-available</span><span class=
"funcparen">(</span><span class="paramname">$option-name</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funccomma">,</span>
<span class="paramname">$fail-if-unknown</span> <span class=
"typeas">as</span> <span class="type">xs:boolean</span><span class=
"funcparen">)</span> <span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>The <tt class="varname">$option-name</tt> string <span class=
"rfc2119">must</span> have the form of a QName; the QName is
expanded into a name using the namespace declarations in-scope for
the expression. The <a href="#f.value-available"><tt class=
"function">p:value-available</tt></a> function returns true if and
only if the name specified is the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em> and the binding has a value. <a name=
"err.inline.D0033" id="err.inline.D0033"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0033"><code class=
"errqname">err:XD0033</code></a>) if the name specified is not the
name of an in-scope option or variable.</p>
<p>In the two-argument form, it is not an error to specify a name
that is not the name of an in-scope option or variable if
<tt class="varname">$fail-if-unknown</tt> is false; the function
simply returns false. The semantics of the two-argument form when
<tt class="varname">$fail-if-unknown</tt> is true are precisely the
same as the single argument form.</p>
<p>Consider the following example:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step type="ex:dir-list"&gt;
&lt;p:output port="result"/&gt;
&lt;p:option name="path"/&gt;
&lt;p:choose&gt;
&lt;p:when test="p:value-available('path')"&gt;
&lt;p:directory-list&gt;
&lt;p:with-option name="path" select="$path"/&gt;
&lt;/p:directory-list&gt;
&lt;/p:when&gt;
&lt;p:otherwise&gt;
&lt;p:directory-list path="."/&gt;
&lt;/p:otherwise&gt;
&lt;/p:choose&gt;
&lt;/p:declare-step&gt;
</pre></div>
<p>If the <tt class="option">path</tt> option is specified in the
call to <tt class="code">ex:dir-list</tt>, then the first <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> clause will be
evaluated and the specified value will be used. If the option is
not specified, then the <a href="#p.otherwise"><tt class=
"tag-element">p:otherwise</tt></a> clause will be evaluated and
"<tt class="literal">.</tt>" will be used instead.</p>
</div>
<div class="section">
<h5><a name="f.iteration-position" id=
"f.iteration-position"></a>2.7.4&#160;Iteration Position</h5>
<p>Both <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> and <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> process a
sequence of documents. The iteration position is the position of
the current document in that sequence: the first document has
position 1, the second 2, etc. The <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> function returns the
iteration position of the nearest ancestor <a href=
"#p.for-each"><tt class="tag-element">p:for-each</tt></a> or
<a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
<div class="funcsynopsis"><span class=
"funcname">p:iteration-position</span><span class=
"funcparen">(</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:integer</span></div>
<p>If there is no <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> or <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> among the
ancestors of the element on which the expression involving <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> occurs, it returns 1.</p>
</div>
<div class="section">
<h5><a name="f.iteration-size" id=
"f.iteration-size"></a>2.7.5&#160;Iteration Size</h5>
<p>Both <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> and <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> process a
sequence of documents. The iteration size is the total number of
documents in that sequence. The <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
function returns the iteration size of the nearest ancestor
<a href="#p.for-each"><tt class="tag-element">p:for-each</tt></a>
or <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
<div class="funcsynopsis"><span class=
"funcname">p:iteration-size</span><span class=
"funcparen">(</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:integer</span></div>
<p>If there is no <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> or <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> among the
ancestors of the element on which the expression involving <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
occurs, it returns 1.</p>
</div>
<div class="section">
<h5><a name="f.base-uri" id="f.base-uri"></a>2.7.6&#160;Base
URI</h5>
<p>Returns the base URI of the specified node, if it has one. This
function provides an interoperable way for XPath 1.0 based
processors to access the base URI of a node. It is conceptually the
same as the XPath 2.0 <tt class="literal">fn:base-uri()</tt>
function.</p>
<div class="funcsynopsis"><span class=
"funcname">p:base-uri</span><span class=
"funcparen">(</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:string</span></div>
<div class="funcsynopsis"><span class=
"funcname">p:base-uri</span><span class=
"funcparen">(</span><span class="paramname">$node</span>
<span class="typeas">as</span> <span class=
"type">node()</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:string</span></div>
<p>If no argument is specified, the context node is taken to be the
argument.</p>
<p>This function returns the <tt class="literal">[base-uri]</tt>
property of its argument, or the empty string if no base URI is
defined for that argument or argument type.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>This function is defined in our namespace because it would be
inappropriate to require XPath 1.0 based processors to support the
<tt class="literal">fn:base-uri</tt> function; its semantics are
deeply rooted in the XPath 2.0 data model which differs from the
XPath 1.0 data model.</p>
</div>
</div>
<div class="section">
<h5><a name="f.resolve-uri" id=
"f.resolve-uri"></a>2.7.7&#160;Resolve URI</h5>
<p>Resolves a relative URI with respect to a particular base URI.
This function provides an interoperable way for XPath 1.0 based
processors to compose URI references. It is conceptually the same
as the XPath 2.0 <tt class="literal">fn:resolve-uri()</tt>
function.</p>
<div class="funcsynopsis"><span class=
"funcname">p:resolve-uri</span><span class=
"funcparen">(</span><span class="paramname">$relative</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span></div>
<div class="funcsynopsis"><span class=
"funcname">p:resolve-uri</span><span class=
"funcparen">(</span><span class="paramname">$relative</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funccomma">,</span>
<span class="paramname">$base</span> <span class="typeas">as</span>
<span class="type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span></div>
<p>If no base is specified, the base URI of the context node is
used.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>This function is defined in our namespace because it would be
inappropriate to require XPath 1.0 based processors to support the
<tt class="literal">fn:resolve-uri</tt> function; its semantics are
rooted in the XPath 2.0 data model which differs from the XPath 1.0
data model.</p>
</div>
</div>
<div class="section">
<h5><a name="f.version-available" id=
"f.version-available"></a>2.7.8&#160;Version Available</h5>
<p>Returns true if and only if the processor supports the version
specified.</p>
<div class="funcsynopsis"><span class=
"funcname">p:version-available</span><span class=
"funcparen">(</span><span class="paramname">$version</span>
<span class="typeas">as</span> <span class=
"type">xs:decimal</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>A version 1.0 processor will return <tt class=
"literal">true()</tt> when <tt class=
"code">p:version-available(1.0)</tt> is evaluated.</p>
</div>
<div class="section">
<h5><a name="f.xpath-version-available" id=
"f.xpath-version-available"></a>2.7.9&#160;XPath Version
Available</h5>
<p>Returns true if and only if the processor supports the XPath
version specified.</p>
<div class="funcsynopsis"><span class=
"funcname">p:xpath-version-available</span><span class=
"funcparen">(</span><span class="paramname">$version</span>
<span class="typeas">as</span> <span class=
"type">xs:decimal</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>A processor that supports XPath 2.0 will return <tt class=
"literal">true()</tt> when <tt class=
"code">p:xpath-version-available(2.0)</tt> is evaluated.</p>
</div>
<div class="section">
<h5><a name="other-xpath-extension-functions" id=
"other-xpath-extension-functions"></a>2.7.10&#160;Other XPath
Extension Functions</h5>
<p><a name="impl-20" id="impl-20"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> if the
processor supports any other XPath extension functions. Additional
extension functions, if any, <span class="rfc2119">must not</span>
use any of the XProc namespaces.</p>
</div>
</div>
<div class="section">
<h4><a name="psvi-support" id="psvi-support"></a>2.8&#160;PSVIs in
XProc</h4>
<p>XML documents flow between steps in an XProc pipeline. <a href=
"#infoset-conformance" title=
"Infoset Conformance">Section&#160;A.3, “Infoset Conformance”</a>
identifies the properties of those documents that <span class=
"rfc2119">must</span> be available. Implementations <span class=
"rfc2119">may</span> also have the ability to pass PSVI annotations
between steps.</p>
<p><a name="impl-21" id="impl-21"></a>Whether or not the pipeline
processor supports passing PSVI annotations between steps is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
<a name="impl-22" id="impl-22"></a>The exact PSVI properties that
are preserved when documents are passed between steps is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>A pipeline can use the <tt class="varname">p:psvi-supported</tt>
system property to determine whether or not PSVI properties can be
passed between steps.</p>
<p>A pipeline can assert that PSVI support is required with the
<tt class="tag-attribute">psvi-required</tt> attribute:</p>
<div class="itemizedlist">
<ul>
<li>
<p>On a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
<tt class="tag-attribute">psvi-required</tt> indicates whether or
not the declared step requires PSVI support. <a name=
"err.inline.D0022" id="err.inline.D0022"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0022"><code class=
"errqname">err:XD0022</code></a>) if a processor that does not
support PSVI annotations attempts to invoke a step which asserts
that they are required.</p>
</li>
<li>
<p>On a <a href="#p.library"><tt class=
"tag-element">p:library</tt></a>, the <tt class=
"tag-attribute">psvi-required</tt> attribute provides a default
value for all of its <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> and <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>
<em>children</em> that do not specify a value themselves.</p>
</li>
</ul>
</div>
<p>Many of the steps that an XProc pipeline can use are
transformative in nature. The <a href="#c.delete"><tt class=
"tag-element">p:delete</tt></a> step, for example, can remove
elements and attributes; the <a href="#c.label-elements"><tt class=
"tag-element">p:label-elements</tt></a> step can add attributes;
etc. If PSVI annotations were always preserved, the use of such
steps could result in documents that were inconsistent with their
schema annotations.</p>
<p>In order to avoid these inconsistencies, most steps <span class=
"rfc2119">must not</span> produce PSVI annotated results even when
PSVI passing is supported.</p>
<p>If PSVI passing is supported, the following constraints
apply:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>Implementations <span class="rfc2119">must</span> faithfully
transmit any PSVI properties produced on step outputs to the steps
to which they are connected.</p>
</li>
<li>
<p>When only a subset of the input is processed by a step (because
a <tt class="tag-attribute">select</tt> expression appears on an
input port or a <tt class="tag-attribute">match</tt> expression is
used to process only part of the input), any PSVI annotations that
appear on the selected input <span class="rfc2119">must</span> be
preserved in the resulting documents passed to the step.</p>
<p>Note that ID/IDREF constraints, and any other whole-document
constraints, may not be satisfied within the selected portion,
irrespective of what its PSVI properties claim.</p>
</li>
<li>
<p>If an output of a compound step is connected to an output which
includes PSVI properties, those properties <span class=
"rfc2119">must</span> be preserved on the output of the compound
step, <em>except</em> for the output of <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> which
<span class="rfc2119">must not</span> contain any PSVI
properties.</p>
</li>
<li>
<p>If an implementation supports XPath 2.0, the data model
constructed with which to evaluate XPath expressions and match
patterns <span class="rfc2119">should</span> take advantage of as
much PSVI information as possible.</p>
</li>
<li>
<p>Except as specified above, or in the descriptions of individual
steps, implementations <span class="rfc2119">must not</span>
include PSVI properties in the outputs of steps defined by this
specification. <a name="impl-23" id="impl-23"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
PSVI properties, if any, are produced by extension steps.</p>
<p>The exceptions in the standard XProc steps are the <a href=
"#c.validate-with-xml-schema"><tt class=
"tag-element">p:validate-with-xml-schema</tt></a>, <a href=
"#c.validate-with-relax-ng"><tt class=
"tag-element">p:validate-with-relax-ng</tt></a>, and <a href=
"#c.validate-with-schematron"><tt class=
"tag-element">p:validate-with-schematron</tt></a> steps, <a href=
"#c.xslt"><tt class="tag-element">p:xslt</tt></a> (when XSLT 2.0 is
used), <a href="#c.xquery"><tt class=
"tag-element">p:xquery</tt></a>, <a href="#c.identity"><tt class=
"tag-element">p:identity</tt></a>, and <a href=
"#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a>.</p>
</li>
</ol>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>A processor that supports passing PSVI properties between steps
is always free to do so. Even if <tt class=
"code">psvi-required="false"</tt> is explicitly specified, it is
not an error for a step to produce a result that includes
additional PSVI properties, provide it does not violate the
constraints above.</p>
</div>
</div>
<div class="section">
<h4><a name="variables" id="variables"></a>2.9&#160;Variables</h4>
<p>Variables are name/value pairs. Pipeline authors can create
variables to hold computed values.</p>
<p><span class="termdef" id="dt-variable">[Definition: A <em class=
"glossterm">variable</em> is a name/value pair where the name is an
<a href="http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded
name</a> and the value <span class="rfc2119">must</span> be a
string or <tt class="type">xs:untypedAtomic</tt>.]</span></p>
<p>Variables and options share the same scope and may shadow each
other.</p>
</div>
<div class="section">
<h4><a name="options" id="options"></a>2.10&#160;Options</h4>
<p>Some steps accept options. Options are name/value pairs, like
variables. Unlike variables, the value of an option can be changed
by the caller.</p>
<p><span class="termdef" id="dt-option">[Definition: An <em class=
"glossterm">option</em> is a name/value pair where the name is an
<a href="http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded
name</a> and the value <span class="rfc2119">must</span> be a
string or <tt class="type">xs:untypedAtomic</tt>.]</span></p>
<p><span class="termdef" id="dt-declared-options">[Definition: The
options declared on a step are its <em class="glossterm">declared
options</em>.]</span> Option names are always expressed as literal
values, pipelines cannot construct option names dynamically.</p>
<p><span class="termdef" id="dt-specified-options">[Definition: The
options on a step which have specified values, either because a
<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> element specifies a value or
because the declaration included a default value, are its
<em class="glossterm">specified options</em>.]</span></p>
<p><a name="impl-24" id="impl-24"></a>How outside values are
specified for pipeline options on the pipeline initially invoked by
the processor is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. In
other words, the command line options, APIs, or other mechanisms
available to specify such options values are outside the scope of
this specification.</p>
</div>
<div class="section">
<h4><a name="parameters" id=
"parameters"></a>2.11&#160;Parameters</h4>
<p>Some steps accept parameters. Parameters are name/value pairs,
like variables and options. Unlike variables and options, which
have names known in advance to the pipeline, parameters are not
declared and their names may be unknown to the pipeline author.
Pipelines can dynamically construct sets of parameters. Steps can
read dynamically constructed sets on <em class="glossterm"><a href=
"#dt-parameter-input-port">parameter input ports</a></em>.</p>
<p><span class="termdef" id="dt-parameter">[Definition: A
<em class="glossterm">parameter</em> is a name/value pair where the
name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.]</span></p>
<p><span class="termdef" id="dt-parameter-input-port">[Definition:
A <em class="glossterm">parameter input port</em> is a
distinguished kind of input port which accepts (only) dynamically
constructed parameter name/value pairs.]</span> See <a href=
"#parameter-inputs" title="Parameter Inputs">Section&#160;5.1.2,
“Parameter Inputs”</a>.</p>
<p>Analogous to <em class="glossterm"><a href=
"#dt-primary-input-port">primary input ports</a></em>, steps that
have parameter inputs may designate at most one parameter input
port as a primary parameter input port.</p>
<p><span class="termdef" id=
"dt-primary-parameter-input-port">[Definition: If a step has a
parameter input port which is explicitly marked “<tt class=
"code">primary='true'</tt>”, or if it has exactly one parameter
input port and that port is <em>not</em> explicitly marked
<tt class="code">primary='false'</tt>”, then that parameter input
port is the <em class="glossterm">primary parameter input port</em>
of the step.]</span> If a step has a single parameter input port
and that port is explicitly marked “<tt class=
"code">primary='false'</tt>”, or if a step has more than one
parameter input port and none is explicitly marked as the primary,
then the primary parameter input port of that step is
undefined.</p>
<p><a name="impl-25" id="impl-25"></a>How outside values are
specified for pipeline parameters on the pipeline initially invoked
by the processor is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. In
other words, the command line options, APIs, or other mechanisms
available to specify such parameter values are outside the scope of
this specification.</p>
</div>
<div class="section">
<h4><a name="security-considerations" id=
"security-considerations"></a>2.12&#160;Security
Considerations</h4>
<p>An XProc pipeline may attempt to access arbitrary network
resources: steps such as <a href="#c.load"><tt class=
"tag-element">p:load</tt></a> and <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
can attempt to read from an arbitrary URI; steps such as <a href=
"#c.store"><tt class="tag-element">p:store</tt></a> can attempt to
write to an arbitrary location; <a href="#c.exec"><tt class=
"tag-element">p:exec</tt></a> can attempt to execute an arbitrary
program. Note, also, that some steps, such as <a href=
"#c.xslt"><tt class="tag-element">p:xslt</tt></a> and <a href=
"#c.xquery"><tt class="tag-element">p:xquery</tt></a>, include
extension mechanisms which may attempt to execute arbitrary
code.</p>
<p>In some environments, it may be inappropriate to provide the
XProc pipeline with access to these resources. In a server
environment, for example, it may be impractical to allow pipelines
to store data. In environments where the pipeline cannot be
trusted, allowing the pipeline to access arbitrary resources or
execute arbitrary code may be a security risk.</p>
<p><a name="err.inline.D0021" id="err.inline.D0021"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0021"><code class=
"errqname">err:XD0021</code></a>) for a pipeline to attempt to
access a resource for which it has insufficient privileges or
perform a step which is forbidden. <a name="impl-26" id=
"impl-26"></a>Which steps are forbidden, what privileges are needed
to access resources, and under what circumstances these security
constraints apply is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>Steps in a pipeline may call themselves recursively which could
result in pipelines which will never terminate.</p>
<p>A conformant XProc processor may limit the resources available
to any or all steps in a pipeline. A conformant implementation may
raise dynamic errors, or take any other corrective action, for any
security problems that it detects.</p>
</div>
<div class="section">
<h4><a name="versioning-considerations" id=
"versioning-considerations"></a>2.13&#160;Versioning
Considerations</h4>
<p>A pipeline author <span class="rfc2119">may</span> identify the
version of XProc for which a particular pipeline was authored by
setting the <tt class="tag-attribute">version</tt> attribute. The
<tt class="tag-attribute">version</tt> attribute can be specified
on <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>, or
<a href="#p.library"><tt class="tag-element">p:library</tt></a>. If
specified, the value of the <tt class="tag-attribute">version</tt>
attribute <span class="rfc2119">must</span> be a <tt class=
"type">xs:decimal</tt>. <a name="err.inline.S0063" id=
"err.inline.S0063"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0063"><code class="errqname">err:XS0063</code></a>) if the
value of the <tt class="tag-attribute">version</tt> attribute is
not a <tt class="type">xs:decimal</tt>.</p>
<p>The version of XProc defined by this specification is
<tt class="literal">1.0</tt>”.</p>
<p>A pipeline author <span class="rfc2119">must</span> identify the
version of XProc on the document element of a pipeline document.
<a name="err.inline.S0062" id="err.inline.S0062"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0062"><code class=
"errqname">err:XS0062</code></a>) if a required <tt class=
"tag-attribute">version</tt> attribute is not present.</p>
<p>The version identified applies to the element on which the
<tt class="tag-attribute">version</tt> attribute appears and all of
its descendants, unless or until another version is explicitly
identified.</p>
<p>When a processor encounters an explicit version (other than a
version which it implements), it proceeds in backwards- or
forwards-compatible mode.</p>
<div class="section">
<h5><a name="vers-backcomp" id=
"vers-backcomp"></a>2.13.1&#160;Backwards-compatible Mode</h5>
<p>If the processor encounters a request for a previous version of
XProc (e.g, if a "2.0" processor encounters an explicit request for
the "1.0" language), it <span class="rfc2119">must</span> process
the pipeline as if it was a processor for the requested version: it
<span class="rfc2119">must</span> enforce the semantics of the
requested version, it <span class="rfc2119">must</span> report
steps not known in that version as errors, etc. <a name=
"err.inline.S0060" id="err.inline.S0060"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0060"><code class=
"errqname">err:XS0060</code></a>) if the processor encounters an
explicit request for a previous version of the language and it is
unable to process the pipeline using those semantics.</p>
</div>
<div class="section">
<h5><a name="vers-forwcomp" id=
"vers-forwcomp"></a>2.13.2&#160;Forwards-compatible Mode</h5>
<p>If the processor encounters an explicit version which it does
not recognize, it processes the pipeline in forwards-compatible
mode. Forwards-compatible mode relaxes several static errors,
turning them into dynamic errors so that a pipeline author can
write a pipeline which conditionally uses new language
features.</p>
<p>In forwards-compatible mode:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>On any element in the XProc namespace, unrecognized attributes
(other than extension attributes) are ignored.</p>
</li>
<li>
<p>On any step in the XProc namespace, unknown options are
ignored.</p>
</li>
<li>
<p>If a step in the XProc namespace includes an unknown input port
with an explicit connection, the connection is treated normally for
the purpose of computing the dependencies in the pipeline but it is
otherwise ignored. Unknown input ports <span class="rfc2119">must
not</span> be treated as <em class="glossterm"><a href=
"#dt-primary-input-port">primary input ports</a></em>; it will
always be an error if they are used but not explicitly
connected.</p>
</li>
<li>
<p>If a step in the pipeline includes an explicit connection to an
unknown output port on a step in the XProc namespace, the
connection is treated normally for the purpose of computing the
dependencies in the pipeline. An empty sequence of documents
<span class="rfc2119">must</span> appear on that connection.</p>
</li>
</ol>
</div>
<p>As a consequence of the rules above, future specifications
<span class="rfc2119">must not</span> change the semantics of
existing step types without changing their names. Although they may
add new input and output ports, such changes should be done with
care; they <span class="rfc2119">should</span> in some sense be
limited to ancillary inputs and outputs and they <span class=
"rfc2119">must not</span> be <em class="glossterm"><a href=
"#dt-primary-input-port">primary input ports</a></em>.</p>
<div class="section">
<h6><a name="vers-forwcomp-ex" id=
"vers-forwcomp-ex"></a>2.13.2.1&#160;Examples</h6>
<p>In forwards-compatible mode, it is not a static error to
encounter the following step:</p>
<div class="programlisting">
<pre>
&lt;p:string-replace match="div/@class" replace="newclass"&gt;
&lt;p:input port="ancillary"&gt;
&lt;p:document href="doc.xml"/&gt;
&lt;/p:input&gt;
&lt;/p:string-replace&gt;
</pre></div>
<p>The processor will simply ignore the “<tt class=
"port">ancillary</tt>” port.</p>
<p>Suppose that XProc version 2.0 changes the definition of the
<a href="#c.xslt"><tt class="tag-element">p:xslt</tt></a> step so
that it has an additional output port, <tt class=
"code">messages</tt>. Then consider the following pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
version="2.0"&gt;
&lt;p:xslt name="style"&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="style.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;p:sink/&gt;
&lt;p:count&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="style" port="messages"/&gt;
&lt;/p:input&gt;
&lt;/p:count&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>When run by a "2.0" or later processor, it will count the
documents that appear on the <tt class="code">messages</tt> port.
When run by a “1.0” processor in forwards-compatible mode, the
binding to the “<tt class="port">messages</tt>” port is not a
static error. Dynamically, the "1.0" processor will always produce
a count of zero, because an empty sequence of documents will always
appear on the <tt class="code">messages</tt> port.</p>
</div>
</div>
</div>
</div>
<div class="section">
<h3><a name="syntax" id="syntax"></a>3&#160;Syntax Overview</h3>
<p>This section describes the normative XML syntax of XProc. This
syntax is sufficient to represent all the aspects of a pipeline, as
set out in the preceding sections. <span class="termdef" id=
"dt-XML">[Definition: XProc is intended to work equally well with
[<a href="#xml10"><span class="abbrev">XML 1.0</span></a>] and
[<a href="#xml11"><span class="abbrev">XML 1.1</span></a>]. Unless
otherwise noted, the term “<em class="glossterm">XML</em>” refers
equally to both versions.]</span> <span class="termdef" id=
"dt-Namespaces-in-XML">[Definition: Unless otherwise noted, the
term <em class="glossterm">Namespaces in XML</em> refers equally to
[<a href="#xmlns10"><span class="abbrev">Namespaces 1.0</span></a>]
and [<a href="#xmlns11"><span class="abbrev">Namespaces
1.1</span></a>].]</span> <a name="impl-27" id="impl-27"></a>Support
for pipeline documents written in XML 1.1 and pipeline inputs and
outputs that use XML 1.1 is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Elements in a pipeline document represent the pipeline, the
steps it contains, the connections between those steps, the steps
and connections contained within them, and so on. Each step is
represented by an element; a combination of elements and attributes
specify how the inputs and outputs of each step are connected and
how options and parameters are passed.</p>
<p>Conceptually, we can speak of steps as objects that have inputs
and outputs, that are connected together and which may contain
additional steps. Syntactically, we need a mechanism for specifying
these relationships.</p>
<p><em class="glossterm"><a href=
"#dt-container">Containment</a></em> is represented naturally using
nesting of XML elements. If a particular element identifies a
<em class="glossterm"><a href="#dt-compound-step">compound
step</a></em> then the step elements that are its immediate
children form its <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
<p>The connections between steps are expressed using names and
references to those names.</p>
<p>Six kinds of things are named in XProc:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>Step types,</li>
<li>Steps,</li>
<li>Input ports (both parameter and document),</li>
<li>Output ports,</li>
<li>Options and variables, and</li>
<li>Parameters</li>
</ol>
</div>
<div class="section">
<h4><a name="namespaces" id="namespaces"></a>3.1&#160;XProc
Namespaces</h4>
<p>There are three namespaces associated with XProc:</p>
<div class="variablelist">
<dl>
<dt><tt class="uri">http://www.w3.org/ns/xproc</tt></dt>
<dd>
<p>The namespace of the XProc XML vocabulary described by this
specification; by convention, the namespace prefix “<tt class=
"literal">p:</tt>” is used for this namespace.</p>
</dd>
<dt><tt class="uri">http://www.w3.org/ns/xproc-step</tt></dt>
<dd>
<p>The namespace used for documents that are inputs to and outputs
from several standard and optional steps described in this
specification. Some steps, such as <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
and <a href="#c.store"><tt class="tag-element">p:store</tt></a>,
have defined input or output vocabularies. We use this namespace
for all of those documents. The conventional prefix “<tt class=
"literal">c:</tt>” is used for this namespace.</p>
</dd>
<dt><tt class="uri">http://www.w3.org/ns/xproc-error</tt></dt>
<dd>
<p>The namespace used for errors. The conventional prefix
<tt class="literal">err:</tt>” is used for this namespace.</p>
</dd>
</dl>
</div>
<p>This specification also makes use of the prefix “<tt class=
"literal">xs:</tt>” to refer to the [<a href=
"#xmlschema-1"><span class="abbrev">W3C XML Schema: Part
1</span></a>] namespace <tt class=
"uri">http://www.w3.org/2001/XMLSchema</tt>.</p>
</div>
<div class="section">
<h4><a name="scoping" id="scoping"></a>3.2&#160;Scoping of
Names</h4>
<p>Names are used to identify step types, steps, ports, options and
variables, and parameters. Step types, options, variables, and
parameters are named with QNames. Steps and ports are named with
NCNames. The scope of a name is a measure of where it is available
in a pipeline. <span class="termdef" id="dt-visible">[Definition:
If two names are in the same scope, we say that they are <em class=
"glossterm">visible</em> to each other. ]</span></p>
<p>The scope of the names of the step types is the pipeline in
which they are declared, including any declarations imported from
libraries via <a href="#p.import"><tt class=
"tag-element">p:import</tt></a>. Nested pipelines inherit the step
types in scope for their parent.</p>
<p>In other words, the step types that are in scope in a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> or
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> are:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The standard, built-in types (<a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>, <a href="#p.choose"><tt class=
"tag-element">p:choose</tt></a>, etc.).</p>
</li>
<li>
<p>Any implementation-provided types.</p>
</li>
<li>
<p>Any step types declared in the pipeline (the <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> and
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> children of the pipeline
element).</p>
</li>
<li>
<p>The types of any <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>s or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>s
that are imported.</p>
</li>
<li>
<p>Any types that are in the scope of any <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> that is
imported.</p>
</li>
<li>
<p>Any step types that are in scope for the pipeline's parent
<a href="#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>
or <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, if it has one.</p>
</li>
<li>
<p>The type of the pipeline itself, if it has one.</p>
</li>
</ul>
</div>
<p>The step types that are in scope in a <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> are:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The standard, built-in types (<a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>, <a href="#p.choose"><tt class=
"tag-element">p:choose</tt></a>, etc.).</p>
</li>
<li>
<p>Any implementation-provided types.</p>
</li>
<li>
<p>Any step types declared in the library (the <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> and
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> children of the <a href=
"#p.library"><tt class="tag-element">p:library</tt></a>
element).</p>
</li>
<li>
<p>The types of <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>s or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>s
that are imported into the library.</p>
</li>
<li>
<p>Any types that are in the scope of any <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> that is
imported.</p>
</li>
</ul>
</div>
<p><a name="err.inline.S0036" id="err.inline.S0036"></a>All the
step types in a pipeline or library <span class=
"rfc2119">must</span> have unique names: it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0036"><code class=
"errqname">err:XS0036</code></a>) if any step type name is built-in
and/or declared or defined more than once in the same scope.</p>
<p>The scope of the names of the steps themselves is determined by
the <em class="glossterm"><a href=
"#dt-environment">environment</a></em> of each step. In general,
the name of a step, the names of its sibling steps, the names of
any steps that it contains directly, the names of its ancestors,
and the names of the siblings of its ancestors are all in a common
scope. <a name="err.inline.S0002" id="err.inline.S0002"></a>All
steps in the same scope <span class="rfc2119">must</span> have
unique names: it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0002"><code class="errqname">err:XS0002</code></a>) if two
steps with the same name appear in the same scope.</p>
<p>The scope of an input or output port name is the step on which
it is defined. The names of all the ports on any step <span class=
"rfc2119">must</span> be unique.</p>
<p>Taken together, these uniqueness constraints guarantee that the
combination of a step name and a port name uniquely identifies
exactly one port on exactly one in-scope step.</p>
<p>The scope of option and variable names is determined by where
they are declared. When an option is declared with <a href=
"#p.option"><tt class="tag-element">p:option</tt></a> (or a
variable with <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a>), unless otherwise specified, its
scope consists of the sibling elements that follow its declaration
and the descendants of those siblings. <a name="err.inline.S0004"
id="err.inline.S0004"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0004"><code class="errqname">err:XS0004</code></a>) if an
option or variable declaration duplicates the name of any other
option or variable in the same <em class="glossterm"><a href=
"#dt-environment">environment</a></em>. That is, no option or
variable may lexically shadow another option or variable with the
same name.</p>
<p>Parameter names are not scoped; they are distinct on each
step.</p>
</div>
<div class="section">
<h4><a name="xml-base-attribute" id=
"xml-base-attribute"></a>3.3&#160;Base URIs and xml:base</h4>
<p>When a relative URI appears in an option value, the base URI
against which it <span class="rfc2119">must</span> be made absolute
is the base URI of the <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> element. If an option value is
specified using a <a href="#option-shortcut">syntactic
shortcut</a>, the base URI of the step on which the shortcut
attribute appears <span class="rfc2119">must</span> be used. In
general, whenever a relative URI appears, its base URI is the base
URI of the nearest ancestor element.</p>
<p>The pipeline author can control the base URIs of elements within
the pipeline document with the <tt class=
"tag-attribute">xml:base</tt> attribute. The <tt class=
"tag-attribute">xml:base</tt> attribute <span class=
"rfc2119">may</span> appear on any element in a pipeline and has
the semantics outlined in [<a href="#xml-base"><span class=
"abbrev">XML Base</span></a>].</p>
</div>
<div class="section">
<h4><a name="xml-id-attribute" id=
"xml-id-attribute"></a>3.4&#160;Unique identifiers</h4>
<p>A pipeline author can provide a globally unique identifier for
any element in a pipeline with the <tt class=
"tag-attribute">xml:id</tt> attribute.</p>
<p>The <tt class="tag-attribute">xml:id</tt> attribute <span class=
"rfc2119">may</span> appear on any element in a pipeline and has
the semantics outlined in [<a href="#xml-id"><span class=
"abbrev">xml:id</span></a>].</p>
</div>
<div class="section">
<h4><a name="syntax-docs-ports" id=
"syntax-docs-ports"></a>3.5&#160;Associating Documents with
Ports</h4>
<p><span class="termdef" id="dt-connection">[Definition: A
<em class="glossterm">connection</em> associates an input or output
port with some data source.]</span> A document or a sequence of
documents can be connected to a port in four ways: <em class=
"glossterm"><a href="#dt-by-source">by source</a></em>, <em class=
"glossterm"><a href="#dt-by-URI">by URI</a></em>, by providing an
<em class="glossterm"><a href="#dt-inline-document">inline
document</a></em>, or by making it <em class="glossterm"><a href=
"#dt-empty-sequence">explicitly empty</a></em>. Each of these
mechanisms is allowed on the <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>, <a href="#p.output"><tt class=
"tag-element">p:output</tt></a>, <a href=
"#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a>, <a href=
"#p.iteration-source"><tt class=
"tag-element">p:iteration-source</tt></a>, and <a href=
"#p.viewport-source"><tt class=
"tag-element">p:viewport-source</tt></a> elements.</p>
<div class="variablelist">
<dl>
<dt>Specified by URI</dt>
<dd>
<p><span class="termdef" id="dt-by-URI">[Definition: A document is
specified <em class="glossterm">by URI</em> if it is referenced
with a URI.]</span> The <tt class="tag-attribute">href</tt>
attribute on the <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> or <a href="#p.data"><tt class=
"tag-element">p:data</tt></a> element is used to refer to documents
by URI.</p>
<p>In this example, the input to the <a href=
"#c.identity"><tt class="tag-element">p:identity</tt></a> step
named “<tt class="literal">otherstep</tt>” comes from “<tt class=
"uri">http://example.com/input.xml</tt>”.</p>
<div class="programlisting">
<pre>
&lt;p:output port="result"/&gt;
&lt;p:identity name="otherstep"&gt;
&lt;p:input port="source"&gt;
&lt;p:document href="http://example.com/input.xml"/&gt;
&lt;/p:input&gt;
&lt;/p:identity&gt;
</pre></div>
</dd>
<dt>Specified by source</dt>
<dd>
<p><span class="termdef" id="dt-by-source">[Definition: A document
is specified <em class="glossterm">by source</em> if it references
a specific port on another step.]</span> The <tt class=
"tag-attribute">step</tt> and <tt class="tag-attribute">port</tt>
attributes on the <a href="#p.pipe"><tt class=
"tag-element">p:pipe</tt></a> element are used for this
purpose.</p>
<p>In this example, the “<tt class="literal">source</tt>” input to
the <a href="#c.xinclude"><tt class=
"tag-element">p:xinclude</tt></a> step named “<tt class=
"literal">expand</tt>” comes from the “<tt class=
"literal">result</tt>” port of the step named “<tt class=
"literal">otherstep</tt>”.</p>
<div class="programlisting">
<pre>
&lt;p:xinclude name="expand"&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="otherstep" port="result"/&gt;
&lt;/p:input&gt;
&lt;/p:xinclude&gt;
</pre></div>
<p>See the description of <a href="#p.pipe"><tt class=
"tag-element">p:pipe</tt></a> for a complete description of the
ports that can be connected.</p>
</dd>
<dt>Specified inline</dt>
<dd>
<p><span class="termdef" id="dt-inline-document">[Definition: An
<em class="glossterm">inline document</em> is specified directly in
the body of the element to which it connects.]</span> The content
of the <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a> element is used for this
purpose.</p>
<p>In this example, the “<tt class="literal">stylesheet</tt>” input
to the XSLT step named “<tt class="literal">xform</tt>” comes from
the content of the <a href="#p.input"><tt class=
"tag-element">p:input</tt></a> element itself.</p>
<div class="programlisting">
<pre>
&lt;p:xslt name="xform"&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:inline&gt;
&lt;xsl:stylesheet version="1.0"&gt;
...
&lt;/xsl:stylesheet&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
</pre></div>
<p>Inline documents are considered “quoted”. The pipeline processor
passes them literally to the port, even if they contain elements
from the XProc namespace or other namespaces that would have other
semantics outside of the <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a>.</p>
</dd>
<dt>Specified explicitly empty</dt>
<dd>
<p><span class="termdef" id="dt-empty-sequence">[Definition: An
<em class="glossterm">empty sequence</em> of documents is specified
with the <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a> element.]</span></p>
<p>In this example, the “<tt class="literal">source</tt>” input to
the XSLT 2.0 step named “<tt class="literal">generate</tt>” is
explicitly empty:</p>
<div class="programlisting">
<pre>
&lt;p:xslt name="generate" version="2.0"&gt;
&lt;p:input port="source"&gt;
&lt;p:empty/&gt;
&lt;/p:input&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:inline&gt;
&lt;xsl:stylesheet version="2.0"&gt;
...
&lt;/xsl:stylesheet&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;p:with-option name="template-name" select="'someName'"/&gt;
&lt;/p:xslt&gt;
</pre></div>
<p>If you omit the connection on a primary input port, a connection
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> will be
assumed. Making the connection explicitly empty guarantees that the
connection will be to an empty sequence of documents.</p>
<p id="empty-xpath-context">It is inconsistent with the [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] specification
to specify an empty connection as the context for evaluating an
XPath expression. When an empty connection is specified for an
XPath 1.0 expression, an empty document node <span class=
"rfc2119">must</span> be used instead as the context node.</p>
</dd>
</dl>
</div>
<p>Note that a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a> or <a href="#p.output"><tt class=
"tag-element">p:output</tt></a> element may contain more than one
<a href="#p.pipe"><tt class="tag-element">p:pipe</tt></a>, <a href=
"#p.document"><tt class="tag-element">p:document</tt></a>, <a href=
"#p.data"><tt class="tag-element">p:data</tt></a>, or <a href=
"#p.inline"><tt class="tag-element">p:inline</tt></a> element. If
more than one <em class="glossterm"><a href=
"#dt-connection">connection</a></em> is provided, then the
specified sequence of documents is made available on that port in
the same order as the connections.</p>
</div>
<div class="section">
<h4><a name="documentation" id=
"documentation"></a>3.6&#160;Documentation</h4>
<p>Pipeline authors may add documentation to their pipeline
documents with the <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> element. Except when it
appears as a descendant of <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a>, the <a href=
"#p.documentation"><tt class="tag-element">p:documentation</tt></a>
element is completely ignored by pipeline processors, it exists
simply for documentation purposes. If a <a href=
"#p.documentation"><tt class="tag-element">p:documentation</tt></a>
is provided as a descendant of <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a>, it has no special semantics, it is
treated literally as part of the document to be provided on that
port. The <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> element has no special
semantics when it appears in documents that flow through the
pipeline.</p>
<p>Pipeline processors that inspect the contents of <a href=
"#p.documentation"><tt class="tag-element">p:documentation</tt></a>
elements and behave differently on the basis of what they find are
<em>not conformant</em>. Processor extensions <span class=
"rfc2119">must</span> be specified with <a href=
"#p.pipeinfo"><tt class="tag-element">p:pipeinfo</tt></a>.</p>
</div>
<div class="section">
<h4><a name="annotations" id="annotations"></a>3.7&#160;Processor
annotations</h4>
<p>Pipeline authors may add annotations to their pipeline documents
with the <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> element. <a name="impl-28" id=
"impl-28"></a>The semantics of <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> elements are <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
Processors <span class="rfc2119">should</span> specify a way for
their annotations to be identified, perhaps with <a href=
"#extension-attributes">extension attributes</a>.</p>
<p>Where <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> is intended for human
consumption, <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> elements are intended for
processor consumption. A processor might, for example, use
annotations to identify some particular aspect of an
implementation, to request additional, perhaps non-standard
features, to describe parallelism constraints, etc.</p>
<p>When a <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> appears as a descendant of
<a href="#p.inline"><tt class="tag-element">p:inline</tt></a>, it
has no special semantics; in that context it <span class=
"rfc2119">must</span> be treated literally as part of the document
to be provided on that port. The <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> element has no special semantics
when it appears in documents that flow through the pipeline.</p>
</div>
<div class="section">
<h4><a name="extension-attributes" id=
"extension-attributes"></a>3.8&#160;Extension attributes</h4>
<p><span class="termdef" id="dt-extension-attribute">[Definition:
An element from the XProc namespace <span class=
"rfc2119">may</span> have any attribute not from the XProc
namespace, provided that the expanded-QName of the attribute has a
non-null namespace URI. Such an attribute is called an <em class=
"glossterm">extension attribute</em>.]</span></p>
<p>The presence of an extension attribute must not cause the
connections between steps to differ from the connections that would
arise in the absence of the attribute. They must not cause the
processor to fail to signal an error that would be signaled in the
absence of the attribute.</p>
<p>A processor which encounters an extension attribute that it does
not implement <span class="rfc2119">must</span> behave as if the
attribute was not present.</p>
</div>
<div class="section">
<h4><a name="use-when" id="use-when"></a>3.9&#160;Conditional
Element Exclusion</h4>
<p>Any element in the XProc namespace may have a <tt class=
"tag-attribute">use-when</tt> attribute which <span class=
"rfc2119">must</span> contain an XPath expression that can be
evaluated statically. If the attribute is present and the effective
boolean value of the expression is false, then the element and all
of its descendants are effectively excluded from the pipeline
document. If a node is effectively excluded, the processor
<span class="rfc2119">must</span> behave as if the element was not
present in the document.</p>
<p>Elements that are not in the XProc namespace <span class=
"rfc2119">may</span> also have a <tt class=
"tag-attribute">use-when</tt> attribute, but the attribute must be
in the XProc namespace. The semantics of a <tt class=
"tag-attribute">p:use-when</tt> attribute on an element not in the
XProc namespace are the same as the semantics of a <tt class=
"tag-attribute">use-when</tt> attribute on an element in the XProc
namespace.</p>
<p>Conditional element exclusion occurs before any static analysis
of the pipeline.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The effective exclusion of <tt class=
"tag-attribute">use-when</tt> processing occurs after XML parsing
and has no effect on well-formedness or validation errors which
will be reported in the usual way. Note also that <tt class=
"tag-attribute">use-when</tt> is not performed when it occurs on
the descendant of a <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a> element.</p>
</div>
<p>For the purposes of evaluating a <tt class=
"tag-attribute">use-when</tt> expression, the context node,
position, and size are all undefined. No <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em> are available. There are no readable ports. There
are no available documents or available collections.</p>
<p>There are some additional restrictions on the XPath extension
functions that are available in a <tt class=
"tag-attribute">use-when</tt> expression:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The <tt class="literal">p:episode</tt> system property
<span class="rfc2119">should not</span> be used. <a name="impl-29"
id="impl-29"></a>The value of the <tt class=
"literal">p:episode</tt> system property in a <tt class=
"tag-attribute">use-when</tt> expression is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</li>
<li>
<p>The <a href="#f.step-available"><tt class=
"function">p:step-available</tt></a> function cannot be used to
test for the availability of extension steps (because the libraries
that declare them may not have been imported). <a name="impl-30"
id="impl-30"></a>The results of testing for steps not in the XProc
namespace in a <tt class="tag-attribute">use-when</tt> expression
are <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</li>
<li>
<p>The steps available and possibly other aspects of the expression
may depend on the version specified for a pipeline, see <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>. For example, in a “1.0” pipeline, the
processor <span class="rfc2119">should not</span> report that “2.0”
steps are available.</p>
</li>
</ul>
</div>
<p><a name="err.inline.S0061" id="err.inline.S0061"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0061"><code class=
"errqname">err:XS0061</code></a>) if a <tt class=
"tag-attribute">use-when</tt> expression refers to the context or
attempts to refer to any documents or collections.</p>
</div>
<div class="section">
<h4><a name="syntax-summaries" id=
"syntax-summaries"></a>3.10&#160;Syntax Summaries</h4>
<p>The description of each element in the pipeline namespace is
accompanied by a syntactic summary that provides a quick overview
of the element's syntax:</p>
<p class="element-syntax element-syntax-language-example">
<code>&lt;p:some-element<br />
&#160;&#160;some-attribute? = <var>some-type</var>&gt;<br />
&#160;&#160;&#160;&#160;(<var>some</var> |<br />
&#160;&#160;&#160;&#160;&#160;<var>elements</var> |<br />
&#160;&#160;&#160;&#160;&#160;<var>allowed</var>)*,<br />
&#160;&#160;&#160;&#160;<var>other-elements?</var><br />
&lt;/p:some-element&gt;</code></p>
<p>The content model fragments in these tableaux are presented in a
simple, compact notation. In brief:</p>
<div class="itemizedlist">
<ul>
<li>
<p>A name represent exactly one occurrence of an element with that
name.</p>
</li>
<li>
<p>Parentheses are used for grouping.</p>
</li>
<li>
<p>Elements or groups separated by a comma (“,”) represent an
ordered sequence: a followed by b followed by c: (a,b,c).</p>
</li>
<li>
<p>Elements or groups separated by a vertical bar (“|”) represent a
choice: a or b or c: (a | b | c).</p>
</li>
<li>
<p>Elements or groups separated by an ampersand (“&amp;”) represent
an unordered sequence: a and b and c, in any order: (a &amp; b
&amp; c).</p>
</li>
<li>
<p>An element or group followed by a question mark (“?”) is
optional; it may or may not occur but if it occurs it can occur
only once.</p>
</li>
<li>
<p>An element or group followed by an asterisk (“*”) is optional
and may be repeated; it may or may not occur and if it occurs it
can occur any number of times.</p>
</li>
<li>
<p>An element or group followed by a plus (“+”) is required and may
be repeated; it must occur at least once, and it can occur any
number of times.</p>
</li>
</ul>
</div>
<p>For clarity of exposition, some attributes and elements are
elided from the summaries:</p>
<div class="itemizedlist">
<ul>
<li>
<p>An <tt class="tag-attribute">xml:id</tt> attribute is allowed on
any element. It has the semantics of [<a href=
"#xml-id"><span class="abbrev">xml:id</span></a>].</p>
</li>
<li>
<p>An <tt class="tag-attribute">xml:base</tt> attribute is allowed
on any element. It has the semantics of [<a href=
"#xml-base"><span class="abbrev">XML Base</span></a>].</p>
</li>
<li>
<p>A <tt class="tag-attribute">use-when</tt> attribute is allowed
on any element, see <a href="#use-when" title=
"Conditional Element Exclusion">Section&#160;3.9, “Conditional
Element Exclusion”</a>.</p>
</li>
<li>
<p>The <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> and <a href=
"#p.pipeinfo"><tt class="tag-element">p:pipeinfo</tt></a> elements
are not shown, but they are allowed anywhere.</p>
</li>
<li>
<p>The <a href="#p.log"><tt class="tag-element">p:log</tt></a>
element is allowed on any step that has a <a href=
"#p.output"><tt class="tag-element">p:output</tt></a>.</p>
</li>
<li>
<p>Attributes that are <a href="#option-shortcut">syntactic
shortcuts for option values</a> are not shown.</p>
</li>
</ul>
</div>
<p>The types given for attributes should be understood as
follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p><tt class="type">ID</tt>, <tt class="type">NCName</tt>,
<tt class="type">NMTOKEN</tt>, <tt class="type">NMTOKENS</tt>,
<tt class="type">anyURI</tt>, <tt class="type">boolean</tt>,
<tt class="type">integer</tt>, <tt class="type">string</tt>: As per
[<a href="#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>] including whitespace normalization as
appropriate.</p>
</li>
<li>
<p><tt class="type">QName</tt>: With whitespace normalization as
per [<a href="#xmlschema-2"><span class="abbrev">W3C XML Schema:
Part 2</span></a>] and according to the following definition: In
the context of XProc, a <tt class="type">QName</tt> is almost
always a QName in the <em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em> sense. Note,
however, that <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> and <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a>
values can get their namespace declarations in a non-standard way
(with <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a>) and QNames that have no prefix
are always in no-namespace, irrespective of the default
namespace.</p>
</li>
<li>
<p><tt class="type">PrefixList</tt>: As a list with <tt class=
"literal">[item type]</tt> <tt class="type">NMTOKEN</tt>, per
[<a href="#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>], including whitespace normalization.</p>
</li>
<li>
<p><tt class="type">XPathExpression</tt>, <tt class=
"type">XSLTMatchPattern</tt>: As a string per [<a href=
"#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>], including whitespace normalization, and the further
requirement to be a conformant Expression per [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] or [<a href=
"#xpath2"><span class="abbrev">XPath 2.0</span></a>], as
appropriate, or Match pattern per [<a href="#xslt10"><span class=
"abbrev">XSLT 1.0</span></a>] or [<a href="#xslt20"><span class=
"abbrev">XSLT 2.0</span></a>], as appropriate.</p>
</li>
</ul>
</div>
</div>
<div class="section">
<h4><a name="common-errors" id="common-errors"></a>3.11&#160;Common
errors</h4>
<p>A number of errors apply generally:</p>
<div class="itemizedlist">
<ul>
<li>
<p><a name="err.inline.S0059" id="err.inline.S0059"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0059"><code class=
"errqname">err:XS0059</code></a>) if the pipeline element is not
<a href="#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>,
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, or <a href=
"#p.library"><tt class="tag-element">p:library</tt></a>.</p>
</li>
<li>
<p><a name="err.inline.S0008" id="err.inline.S0008"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0008"><code class=
"errqname">err:XS0008</code></a>) if any element in the XProc
namespace has attributes not defined by this specification unless
they are <em class="glossterm"><a href=
"#dt-extension-attribute">extension attributes</a></em>.</p>
</li>
<li>
<p><a name="err.inline.S0038" id="err.inline.S0038"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0038"><code class=
"errqname">err:XS0038</code></a>) if any required attribute is not
provided.</p>
</li>
<li>
<p><a name="err.inline.D0028" id="err.inline.D0028"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0028"><code class=
"errqname">err:XD0028</code></a>) if any attribute value does not
satisfy the type required for that attribute.</p>
</li>
<li>
<p><a name="err.inline.S0044" id="err.inline.S0044"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0044"><code class=
"errqname">err:XS0044</code></a>) if any element in the XProc
namespace or any step has element children other than those
specified for it by this specification. In particular, the presence
of atomic steps for which there is no visible declaration may raise
this error.</p>
</li>
<li>
<p><a name="err.inline.S0037" id="err.inline.S0037"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0037"><code class=
"errqname">err:XS0037</code></a>) if any step directly contains
text nodes that do not consist entirely of whitespace.</p>
</li>
<li>
<p><a name="err.inline.D0019" id="err.inline.D0019"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0019"><code class=
"errqname">err:XD0019</code></a>) if any option value does not
satisfy the type required for that option.</p>
</li>
<li>
<p><a name="err.inline.S0015" id="err.inline.S0015"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0015"><code class=
"errqname">err:XS0015</code></a>) if a compound step has no
<em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em>.</p>
</li>
<li>
<p><a name="err.inline.D0012" id="err.inline.D0012"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0012"><code class=
"errqname">err:XD0012</code></a>) if any attempt is made to
dereference a URI where the scheme of the URI reference is not
supported. Implementations are encouraged to support as many
schemes as is practical and, in particular, they <span class=
"rfc2119">should</span> support both the <tt class=
"literal">file:</tt> and <tt class="literal">http(s):</tt> schemes.
<a name="impl-31" id="impl-31"></a>The set of URI schemes actually
supported is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</li>
<li>
<p><a name="err.inline.D0030" id="err.inline.D0030"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0030"><code class=
"errqname">err:XD0030</code></a>) if a step is unable or incapable
of performing its function. This is a general error code for “step
failed” (e.g., if the input isn't of the expected type or if
attempting to process the input causes the implementation to
abort). Users and implementors who create extension steps are
encouraged to use this code for general failures.</p>
</li>
<li>
<p>In most steps which use a select expression or match pattern,
any kind of node can be identified by the expression or pattern.
However, some expressions and patterns on some steps are only
applicable to some kinds of nodes (e.g., it doesn't make sense to
speak of adding attributes to a comment!).</p>
<p><a name="err.inline.C0023" id="err.inline.C0023"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if a select expression or match
pattern returns a node type that is not allowed by the step.</p>
</li>
</ul>
</div>
<p>If an XProc processor can determine statically that a dynamic
error will <em>always</em> occur, it <span class=
"rfc2119">may</span> report that error statically provided that the
error <em>does not</em> occur among the descendants of a <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>. Dynamic errors
inside a <a href="#p.try"><tt class="tag-element">p:try</tt></a>
<span class="rfc2119">must not</span> be reported statically. They
must be raised dynamically so that <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> processing can be performed on
them.</p>
</div>
</div>
<div class="section">
<h3><a name="steps" id="steps"></a>4&#160;Steps</h3>
<p>This section describes the core steps of XProc.</p>
<p>Several of the steps defined in this specification refer to
other, evolving XML technologies (XSLT, XQuery, XSL-FO, etc.).
Where this specification identifies a specific version of a
technology, implementors <span class="rfc2119">must</span>
implement the specified version or any subsequent edition or
version that is backwards compatible. At user option, they may
support other, incompatible versions or extensions.</p>
<div class="section">
<h4><a name="p.pipeline" id=
"p.pipeline"></a>4.1&#160;p:pipeline</h4>
<p>A <tt class="tag-element">p:pipeline</tt> declares a pipeline
that can be evaluated by an XProc processor. It encapsulates the
behavior of a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>. Its children declare
inputs, outputs, and options that the pipeline exposes and identify
the steps in its subpipeline. (A <tt class=
"tag-element">p:pipeline</tt> is a simplified form of <a href=
"#p.declare-step">step declaration</a>.)</p>
<p>All <tt class="tag-element">p:pipeline</tt> pipelines have an
implicit <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em> named
<tt class="port">source</tt>”, an implicit <em class=
"glossterm"><a href="#dt-primary-parameter-input-port">primary
parameter input port</a></em> named “<tt class=
"port">parameters</tt>”, and an implicit <em class=
"glossterm"><a href="#dt-primary-output-port">primary output
port</a></em> named “<tt class="port">result</tt>”. Any input or
output ports that the <tt class="tag-element">p:pipeline</tt>
declares explicitly are <em>in addition</em> to those ports and may
not be declared primary.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeline<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.pipeline">p:pipeline</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;<var>subpipeline</var><br />
&lt;/p:pipeline&gt;</code></p>
<p>Viewed from the outside, a <tt class=
"tag-element">p:pipeline</tt> is a black box which performs some
calculation on its inputs and produces its outputs. From the
pipeline author's perspective, the computation performed by the
pipeline is described in terms of <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> which read the
pipeline's inputs and produce the pipeline's outputs.</p>
<p>The <tt class="tag-attribute">version</tt> attribute identifies
the version of XProc for which this pipeline was authored. If the
<tt class="tag-element">p:pipeline</tt> has no ancestors in the
XProc namespace, then it <span class="rfc2119">must</span> have a
<tt class="tag-attribute">version</tt> attribute. See <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>.</p>
<p>If a pipeline does not have a <tt class=
"tag-attribute">type</tt> then that pipeline cannot be invoked as a
step.</p>
<p>The <tt class="tag-element">p:pipeline</tt> element is just a
simplified form of step declaration. A document that reads:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline <em class="replaceable"><tt class=
"replaceable">some-attributes</tt></em>&gt;
<em class="replaceable"><tt class=
"replaceable">some-content</tt></em>
&lt;/p:pipeline&gt;
</pre></div>
<p>can be interpreted as if it read:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step <em class="replaceable"><tt class=
"replaceable">some-attributes</tt></em>&gt;
&lt;p:input port='source' primary='true'/&gt;
&lt;p:input port='parameters' kind='parameter' primary='true'/&gt;
&lt;p:output port='result' primary='true'/&gt;
<em class="replaceable"><tt class=
"replaceable">some-content</tt></em>
&lt;/p:declare-step&gt;
</pre></div>
<p>See <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> for more details.</p>
<div class="section">
<h5><a name="example-pipeline" id=
"example-pipeline"></a>4.1.1&#160;Example</h5>
<p>A pipeline might accept a document as input; perform XInclude,
validation, and transformation; and produce the transformed
document as its output.</p>
<div class="example-wrapper" id="ex.p.pipeline">
<div class="title">Example&#160;4.&#160;A Sample Pipeline
Document</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:xinclude/&gt;
&lt;p:validate-with-xml-schema&gt;
&lt;p:input port="schema"&gt;
&lt;p:document href="http://example.com/path/to/schema.xsd"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;p:xslt&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="http://example.com/path/to/stylesheet.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.for-each" id=
"p.for-each"></a>4.2&#160;p:for-each</h4>
<p>A for-each is specified by the <tt class=
"tag-element">p:for-each</tt> element. It is a <em class=
"glossterm"><a href="#dt-compound-step">compound step</a></em> that
processes a sequence of documents, applying its <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> to each
document in turn.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:for-each<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.iteration-source">p:iteration-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:for-each&gt;</code></p>
<p>When a pipeline needs to process a sequence of documents using a
subpipeline that only processes a single document, the <tt class=
"tag-element">p:for-each</tt> construct can be used as a wrapper
around that subpipeline. The <tt class=
"tag-element">p:for-each</tt> will apply that subpipeline to each
document in the sequence in turn.</p>
<p>The result of the <tt class="tag-element">p:for-each</tt> is a
sequence of documents produced by processing each individual
document in the input sequence. If the <tt class=
"tag-element">p:for-each</tt> has one or more output ports, what
appears on each of those ports is the sequence of documents that is
the concatenation of the sequence produced by each iteration of the
loop on the port to which it is connected. If the iteration source
for a <tt class="tag-element">p:for-each</tt> is an empty sequence,
then the subpipeline is never run and an empty sequence is produced
on all of the outputs.</p>
<p>The <a href="#p.iteration-source"><tt class=
"tag-element">p:iteration-source</tt></a> is an anonymous input:
its <em class="glossterm"><a href=
"#dt-connection">connection</a></em> provides a sequence of
documents to the <tt class="tag-element">p:for-each</tt> step. If
no iteration sequence is explicitly provided, then the iteration
source is read from the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>.</p>
<p>The processor provides each document, one at a time, to the
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> represented by the children
of the <tt class="tag-element">p:for-each</tt> on a port named
<tt class="port">current</tt>.</p>
<p>For each declared output, the processor collects all the
documents that are produced for that output from all the
iterations, in order, into a sequence. The result of the <tt class=
"tag-element">p:for-each</tt> on that output is that sequence of
documents.</p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> of a <tt class=
"tag-element">p:for-each</tt> is the <em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em> with
these modifications:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:for-each</tt> is added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
</li>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:for-each</tt> is made the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>.</p>
</li>
</ul>
</div>
<p>If the <tt class="tag-element">p:for-each</tt> has a <em class=
"glossterm"><a href="#dt-primary-output-port">primary output
port</a></em> (explicit or <a href="#primary-input-output">supplied
by default</a>) and that port has no <em class="glossterm"><a href=
"#dt-connection">connection</a></em>, then it is connected to the
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em> of the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>.
<a name="err.inline.S0006" id="err.inline.S0006"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0006"><code class=
"errqname">err:XS0006</code></a>) if the primary output port has no
explicit connection and the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the subpipeline does not have
a primary output port.</p>
<p>Note that outputs declared for a <tt class=
"tag-element">p:for-each</tt> serve a dual role. Inside the
<tt class="tag-element">p:for-each</tt>, they are used to read
results from the subpipeline. Outside the <tt class=
"tag-element">p:for-each</tt>, they provide the aggregated
results.</p>
<p>The <tt class="tag-attribute">sequence</tt> attribute on a
<a href="#p.output"><tt class="tag-element">p:output</tt></a>
inside a <tt class="tag-element">p:for-each</tt> only applies
inside the step. From the outside, all of the outputs produce
sequences.</p>
<div class="section">
<h5><a name="for-each-xpath-context" id=
"for-each-xpath-context"></a>4.2.1&#160;XPath Context</h5>
<p>Within a <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a>, the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> and <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
are taken from the sequence of documents that will be processed by
the <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a>. The total number of documents is
the <a href="#f.iteration-size"><tt class=
"function">p:iteration-size</tt></a>; the ordinal value of the
current document (the document appearing on the <tt class=
"port">current</tt> port) is the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a>.</p>
<div class="admonition" id="impl1">
<div class="admon-title">Note to implementers</div>
<p>In the case where no XPath expression that must be evaluated by
the processor makes any reference to <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>,
its value does not actually have to be calculated (and the entire
input sequence does not, therefore, need to be buffered so that its
size can be calculated before processing begins).</p>
</div>
</div>
<div class="section">
<h5><a name="example-for-each" id=
"example-for-each"></a>4.2.2&#160;Example</h5>
<p>A <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> might accept a sequence of
chapters as its input, process each chapter in turn with XSLT, a
step that accepts only a single input document, and produce a
sequence of formatted chapters as its output.</p>
<div class="example-wrapper" id="ex.p.for-each">
<div class="title">Example&#160;5.&#160;A Sample For-Each</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:for-each name="chapters"&gt;
&lt;p:iteration-source select="//chapter"/&gt;
&lt;p:output port="html-results"&gt;
&lt;p:pipe step="make-html" port="result"/&gt;
&lt;/p:output&gt;
&lt;p:output port="fo-results"&gt;
&lt;p:pipe step="make-fo" port="result"/&gt;
&lt;/p:output&gt;
&lt;p:xslt name="make-html"&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="http://example.com/xsl/html.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;p:xslt name="make-fo"&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="chapters" port="current"/&gt;
&lt;/p:input&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="http://example.com/xsl/fo.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:for-each&gt;
</pre></div>
</div>
</div>
<p>The <tt class="code">//chapter</tt> elements of the document are
selected. Each chapter is transformed into HTML and XSL Formatting
Objects using an XSLT step. The resulting HTML and FO documents are
aggregated together and appear on the <tt class=
"literal">html-results</tt> and <tt class="literal">fo-results</tt>
ports, respectively, of the <tt class="literal">chapters</tt> step
itself.</p>
</div>
</div>
<div class="section">
<h4><a name="p.viewport" id=
"p.viewport"></a>4.3&#160;p:viewport</h4>
<p>A viewport is specified by the <tt class=
"tag-element">p:viewport</tt> element. It is a <em class=
"glossterm"><a href="#dt-compound-step">compound step</a></em> that
processes a single document, applying its <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> to one
or more subtrees of the document.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;<strong>match</strong> =
<var>XSLTMatchPattern</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.viewport-source">p:viewport-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.output">p:output</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>?),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:viewport&gt;</code></p>
<p>The result of the <tt class="tag-element">p:viewport</tt> is a
copy of the original document where the selected subtrees have been
replaced by the results of applying the subpipeline to them.</p>
<p>The <a href="#p.viewport-source"><tt class=
"tag-element">p:viewport-source</tt></a> is an anonymous input: its
<em class="glossterm"><a href="#dt-connection">connection</a></em>
provides a single document to the <tt class=
"tag-element">p:viewport</tt> step. If no document is explicitly
provided, then the viewport source is read from the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>. <a name="err.inline.D0003" id=
"err.inline.D0003"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0003"><code class="errqname">err:XD0003</code></a>) if the
viewport source does not provide exactly one document.</p>
<p>The <tt class="tag-attribute">match</tt> attribute specifies an
XSLT match pattern. Each matching node in the source document is
wrapped in a document node, as necessary, and provided, one at a
time, to the viewport's <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> on a port named <tt class=
"port">current</tt>. The base URI of the resulting document that is
passed to the subpipeline is the base URI of the matched element or
document. <a name="err.inline.D0010" id="err.inline.D0010"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0010"><code class=
"errqname">err:XD0010</code></a>) if the <tt class=
"tag-attribute">match</tt> expression on <tt class=
"tag-element">p:viewport</tt> does not match an element or
document.</p>
<p>After a match is found, the entire subtree rooted at that match
is processed as a unit. No further attempts are made to match nodes
among the descendants of any matched node.</p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> of a <tt class=
"tag-element">p:viewport</tt> is the <em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em> with
these modifications:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:viewport</tt> is added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
</li>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:viewport</tt> is made the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>.</p>
</li>
</ul>
</div>
<p>The <tt class="tag-element">p:viewport</tt> must contain a
single, <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em> declared
explicitly or <a href="#primary-input-output">supplied by
default</a>. If that port has no <em class="glossterm"><a href=
"#dt-connection">connection</a></em>, then it is connected to the
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em> of the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>.
<a name="err.inline.S0006.1" id="err.inline.S0006.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0006"><code class=
"errqname">err:XS0006</code></a>) if the primary output port is
unconnected and the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the subpipeline does not have
a primary output port.</p>
<p>What appears on the output from the <tt class=
"tag-element">p:viewport</tt> will be a copy of the input document
where each matching node is replaced by the result of applying the
subpipeline to the subtree rooted at that node. In other words, if
the match pattern matches a particular element then that element is
wrapped in a document node and provided on the <tt class=
"port">current</tt> port, the subpipeline in the <tt class=
"tag-element">p:viewport</tt> is evaluated, and the result that
appears on the <tt class="port">output</tt> port replaces the
matched element.</p>
<p>If no documents appear on the <tt class="port">output</tt> port,
the matched element will effectively be deleted. If exactly one
document appears, the contents of that document will replace the
matched element. If a sequence of documents appears, then the
contents of each document in that sequence (in the order it appears
in the sequence) will replace the matched element.</p>
<p>The output of the <tt class="tag-element">p:viewport</tt> itself
is a single document that appears on a port named “<tt class=
"literal">result</tt>”. Note that the semantics of <tt class=
"tag-element">p:viewport</tt> are special. The <tt class=
"port">output</tt> port in the <tt class=
"tag-element">p:viewport</tt> is used only to access the results of
the subpipeline. The output of the step itself appears on a port
with the fixed name “<tt class="literal">result</tt>” that is never
explicitly declared.</p>
<div class="section">
<h5><a name="viewport-xpath-context" id=
"viewport-xpath-context"></a>4.3.1&#160;XPath Context</h5>
<p>Within a <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>, the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> and <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
are taken from the sequence of documents that will be processed by
the <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>. The total number of documents is
the <a href="#f.iteration-size"><tt class=
"function">p:iteration-size</tt></a>; the ordinal value of the
current document (the document appearing on the <tt class=
"port">current</tt> port) is the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a>.</p>
<div class="admonition" id="impl2">
<div class="admon-title">Note to implementers</div>
<p>In the case where no XPath expression that must be evaluated by
the processor makes any reference to <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>,
its value does not actually have to be calculated (and the entire
input sequence does not, therefore, need to be buffered so that its
size can be calculated before processing begins).</p>
</div>
</div>
<div class="section">
<h5><a name="example-viewport" id=
"example-viewport"></a>4.3.2&#160;Example</h5>
<p>A <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a> might accept an XHTML document as
its input, add an <tt class="tag-element">hr</tt> element at the
beginning of all <tt class="tag-element">div</tt> elements that
have the class value “chapter”, and return an XHTML document that
is the same as the original except for that change.</p>
<div class="example-wrapper" id="ex.p.viewport">
<div class="title">Example&#160;6.&#160;A Sample Viewport</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:viewport match="h:div[@class='chapter']"
xmlns:h="http://www.w3.org/1999/xhtml"&gt;
&lt;p:insert position="first-child"&gt;
&lt;p:input port="insertion"&gt;
&lt;p:inline&gt;
&lt;hr xmlns="http://www.w3.org/1999/xhtml"/&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:insert&gt;
&lt;/p:viewport&gt;
</pre></div>
</div>
</div>
<p>The nodes which match <tt class=
"code">h:div[@class='chapter']</tt> in the input document are
selected. An <tt class="code">hr</tt> is inserted as the first
child of each <tt class="code">h:div</tt> and the resulting version
replaces the original <tt class="code">h:div</tt>. The result of
the whole step is a copy of the input document with a horizontal
rule as the first child of each selected <tt class=
"code">h:div</tt>.</p>
</div>
</div>
<div class="section">
<h4><a name="p.choose" id="p.choose"></a>4.4&#160;p:choose</h4>
<p>A choose is specified by the <tt class=
"tag-element">p:choose</tt> element. It is a <em class=
"glossterm"><a href="#dt-multi-container-step">multi-container
step</a></em> that selects exactly one of a list of alternative
<em class="glossterm"><a href=
"#dt-subpipeline">subpipelines</a></em> based on the evaluation of
XPath expressions.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:choose<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.when">p:when</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.otherwise">p:otherwise</a>?)<br />
&lt;/p:choose&gt;</code></p>
<p>A <tt class="tag-element">p:choose</tt> has no inputs. It
contains an arbitrary number of alternative <em class=
"glossterm"><a href="#dt-subpipeline">subpipelines</a></em>,
exactly one of which will be evaluated.</p>
<p>The list of alternative subpipelines consists of zero or more
subpipelines guarded by an XPath expression, followed optionally by
a single default subpipeline.</p>
<p>The <tt class="tag-element">p:choose</tt> considers each
subpipeline in turn and selects the first (and only the first)
subpipeline for which the guard expression evaluates to true in its
context. If there are no subpipelines for which the expression
evaluates to true, the default subpipeline, if it was specified, is
selected.</p>
<p>After a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> is selected, it is evaluated
as if only it had been present.</p>
<p>The outputs of the <tt class="tag-element">p:choose</tt> are
taken from the outputs of the selected <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>. The
<tt class="tag-element">p:choose</tt> has the same number of
outputs as the selected subpipeline with the same names. If the
selected subpipeline has a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, the port
with the same name on the <tt class="tag-element">p:choose</tt> is
also a primary output port.</p>
<p>In order to ensure that the output of the <tt class=
"tag-element">p:choose</tt> is consistent irrespective of the
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> chosen, each <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> must
declare the same number of outputs with the same names. If any of
the subpipelines specifies a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, each
subpipeline must specify exactly the same output as primary.
<a name="err.inline.S0007" id="err.inline.S0007"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0007"><code class=
"errqname">err:XS0007</code></a>) if two <em class=
"glossterm"><a href="#dt-subpipeline">subpipelines</a></em> in a
<tt class="tag-element">p:choose</tt> declare different
outputs.</p>
<p>As a convenience to authors, it is not an error if some
subpipelines declare outputs that can produce sequences and some do
not. Each output of the <tt class="tag-element">p:choose</tt> is
declared to produce a sequence if that output is declared to
produce a sequence in any of its subpipelines.</p>
<p><a name="err.inline.D0004" id="err.inline.D0004"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0004"><code class=
"errqname">err:XD0004</code></a>) if no <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> is
selected by the <tt class="tag-element">p:choose</tt> and no
default is provided.</p>
<p>The <tt class="tag-element">p:choose</tt> can specify the
context node against which the XPath expressions that occur on each
branch are evaluated. The context node is specified as a <em class=
"glossterm"><a href="#dt-connection">connection</a></em> in the
<a href="#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a>. If no explicit connection
is provided, the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is used.
In an XPath 1.0 implementation, if the context node is connected to
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a>, or is
unconnected and the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined, an <a href="#empty-xpath-context">empty document
node</a> is used instead as the context. In an XPath 2.0
implementation, the context item is undefined.</p>
<p>Each conditional <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> is represented by a <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> element. The
default branch is represented by a <a href=
"#p.otherwise"><tt class="tag-element">p:otherwise</tt></a>
element.</p>
<div class="section">
<h5><a name="p.xpath-context" id=
"p.xpath-context"></a>4.4.1&#160;p:xpath-context</h5>
<p>A <tt class="tag-element">p:xpath-context</tt> element specifies
the context node against which an XPath expression will be
evaluated. When it appears in a <a href="#p.when"><tt class=
"tag-element">p:when</tt></a>, it specifies the context for that
<a href="#p.when"><tt class="tag-element">p:when</tt></a>’s
<tt class="tag-attribute">test</tt> attribute. When it appears in
<a href="#p.choose"><tt class="tag-element">p:choose</tt></a>, it
specifies the default context for all of the <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> elements in that
<a href="#p.choose"><tt class="tag-element">p:choose</tt></a>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:xpath-context&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)<br />
&lt;/p:xpath-context&gt;</code></p>
<p>Only one <em class="glossterm"><a href=
"#dt-connection">connection</a></em> is allowed and it works the
same way that connections work on a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>. No <tt class=
"tag-attribute">select</tt> expression is allowed. <a name=
"err.inline.D0005" id="err.inline.D0005"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0005"><code class=
"errqname">err:XD0005</code></a>) if more than one document appears
on the connection for the <tt class=
"tag-element">xpath-context</tt>.</p>
<p>The <tt class="tag-element">p:xpath-context</tt> element only
provides the context node. The namespace bindings, in-scope
variables, and other aspects of the context come from the element
on which the XPath expression occurs.</p>
<p>In an XPath 1.0 implementation, if the context node is connected
to <a href="#p.empty"><tt class="tag-element">p:empty</tt></a>, or
is unconnected and the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined, an <a href="#empty-xpath-context">empty document
node</a> is used instead as the context. In an XPath 2.0
implementation, the context item is undefined.</p>
</div>
<div class="section">
<h5><a name="p.when" id="p.when"></a>4.4.2&#160;p:when</h5>
<p>A when specifies one subpipeline guarded by a test
expression.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:when<br />
&#160;&#160;<strong>test</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;(<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:when&gt;</code></p>
<p>Each <tt class="tag-element">p:when</tt> branch of the <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> has a
<tt class="tag-attribute">test</tt> attribute which <span class=
"rfc2119">must</span> contain an XPath expression. That XPath
expression's effective boolean value is the guard for the
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> contained within that
<tt class="tag-element">p:when</tt>.</p>
<p>The <tt class="tag-element">p:when</tt> can specify a context
node against which its <tt class="tag-attribute">test</tt>
expression is to be evaluated. That context node is specified as a
<em class="glossterm"><a href="#dt-connection">connection</a></em>
for the <a href="#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a>. If no context is specified
on the <tt class="tag-element">p:when</tt>, the context of the
<a href="#p.choose"><tt class="tag-element">p:choose</tt></a> is
used.</p>
</div>
<div class="section">
<h5><a name="p.otherwise" id=
"p.otherwise"></a>4.4.3&#160;p:otherwise</h5>
<p>An otherwise specifies the default branch; the subpipeline
selected if no test expression on any preceding <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> evaluates to
true.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:otherwise&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:otherwise&gt;</code></p>
</div>
<div class="section">
<h5><a name="example-choose" id=
"example-choose"></a>4.4.4&#160;Example</h5>
<p>A <a href="#p.choose"><tt class="tag-element">p:choose</tt></a>
might test the version attribute of the document element and
validate with an appropriate schema.</p>
<div class="example-wrapper" id="ex.p.choose">
<div class="title">Example&#160;7.&#160;A Sample Choose</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:choose name="version"&gt;
&lt;p:when test="/*[@version = 2]"&gt;
&lt;p:validate-with-xml-schema&gt;
&lt;p:input port="schema"&gt;
&lt;p:document href="v2schema.xsd"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;/p:when&gt;
&lt;p:when test="/*[@version = 1]"&gt;
&lt;p:validate-with-xml-schema&gt;
&lt;p:input port="schema"&gt;
&lt;p:document href="v1schema.xsd"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;/p:when&gt;
&lt;p:when test="/*[@version]"&gt;
&lt;p:identity/&gt;
&lt;/p:when&gt;
&lt;p:otherwise&gt;
&lt;p:error code="NOVERSION"&gt;
&lt;p:input port="source"&gt;
&lt;p:inline&gt;
&lt;message&gt;Required version attribute missing.&lt;/message&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:error&gt;
&lt;/p:otherwise&gt;
&lt;/p:choose&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.group" id="p.group"></a>4.5&#160;p:group</h4>
<p>A group is specified by the <tt class="tag-element">p:group</tt>
element. In a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>, it is a non-step wrapper, everywhere
else, it is a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>. A group encapsulates
the behavior of its <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:group<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:group&gt;</code></p>
<p>A <tt class="tag-element">p:group</tt> is a convenience wrapper
for a collection of steps.</p>
<div class="section">
<h5><a name="example-group" id=
"example-group"></a>4.5.1&#160;Example</h5>
<div class="example-wrapper" id="ex.p.group">
<div class="title">Example&#160;8.&#160;An Example Group</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:group&gt;
&lt;p:variable name="db-key"
select="'some-long-string-of-nearly-random-characters'"/&gt;
&lt;p:choose&gt;
&lt;p:when test="/config/output = 'fo'"&gt;
&lt;p:xslt&gt;
&lt;p:with-param name="key" select="$db-key"/&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="fo.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:when&gt;
&lt;p:when test="/config/output = 'svg'"&gt;
&lt;p:xslt&gt;
&lt;p:with-param name="key" select="$db-key"/&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="svg.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:when&gt;
&lt;p:otherwise&gt;
&lt;p:xslt&gt;
&lt;p:with-param name="key" select="$db-key"/&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="html.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:otherwise&gt;
&lt;/p:choose&gt;
&lt;/p:group&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.try" id="p.try"></a>4.6&#160;p:try</h4>
<p>A try/catch is specified by the <tt class=
"tag-element">p:try</tt> element. It is a <em class=
"glossterm"><a href="#dt-multi-container-step">multi-container
step</a></em> that isolates a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>, preventing any dynamic
errors that arise within it from being exposed to the rest of the
pipeline.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:try<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.group">p:group</a>,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.catch">p:catch</a>)<br />
&lt;/p:try&gt;</code></p>
<p>The <a href="#p.group"><tt class="tag-element">p:group</tt></a>
represents the initial subpipeline and the recovery (or “catch”)
pipeline is identified with a <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> element.</p>
<p>The <tt class="tag-element">p:try</tt> step evaluates the
initial subpipeline and, if no errors occur, the outputs of that
pipeline are the outputs of the <tt class="tag-element">p:try</tt>
step. However, if any errors occur, the <tt class=
"tag-element">p:try</tt> abandons the first subpipeline, discarding
any output that it might have generated, and evaluates the recovery
subpipeline.</p>
<p>If the recovery subpipeline is evaluated, the outputs of the
recovery subpipeline are the outputs of the <tt class=
"tag-element">p:try</tt> step. If the recovery subpipeline is
evaluated and a step within that subpipeline fails, the <tt class=
"tag-element">p:try</tt> fails.</p>
<p>The outputs of the <tt class="tag-element">p:try</tt> are taken
from the outputs of the initial subpipeline or the recovery
subpipeline if an error occurred in the initial subpipeline. The
<tt class="tag-element">p:try</tt> has the same number of outputs
as the selected subpipeline with the same names. If the selected
subpipeline has a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, the port
with the same name on the <tt class="tag-element">p:try</tt> is
also a primary output port.</p>
<p>In order to ensure that the output of the <tt class=
"tag-element">p:try</tt> 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. If either of the subpipelines specifies a
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em>, both subpipelines must specify exactly the
same output as primary. <a name="err.inline.S0009" id=
"err.inline.S0009"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0009"><code class="errqname">err:XS0009</code></a>) if the
<a href="#p.group"><tt class="tag-element">p:group</tt></a> and
<a href="#p.catch"><tt class="tag-element">p:catch</tt></a>
subpipelines declare different outputs.</p>
<p>As a convenience to authors, it is not an error if an output
port can produce a sequence in the initial subpipeline but not in
the recovery subpipeline, or vice versa. Each output of the
<tt class="tag-element">p:try</tt> is declared to produce a
sequence if that output is declared to produce a sequence in either
of its subpipelines.</p>
<p>A pipeline author can cause an error to occur with the <a href=
"#c.error"><tt class="tag-element">p:error</tt></a> step.</p>
<p>The recovery subpipeline of a <tt class="tag-element">p:try</tt>
is identified with a <a href="#p.catch"><tt class="tag-element" id=
"p.catch">p:catch</tt></a>:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:catch<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:catch&gt;</code></p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> of the <a href=
"#p.catch"><tt class="tag-element">p:catch</tt></a> is the
<em class="glossterm"><a href="#dt-inherited-environment">inherited
environment</a></em> with this modification:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The port named “<tt class="port">error</tt>” on the <a href=
"#p.catch"><tt class="tag-element">p:catch</tt></a> is added to the
<em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
</li>
</ul>
</div>
<p>What appears on the <tt class="port">error</tt> output port is
an <a href="#err-vocab">error document</a>. The error document may
contain messages generated by steps that were part of the initial
subpipeline. Not all messages that appear are indicative of errors;
for example, it is common for all <tt class=
"tag-element">xsl:message</tt> output from the XSLT component to
appear on the <tt class="port">error</tt> output port. It is
possible that the component which fails may not produce any
messages at all. It is also possible that the failure of one
component may cause others to fail so that there may be multiple
failure messages in the document.</p>
<div class="section">
<h5><a name="err-vocab" id="err-vocab"></a>4.6.1&#160;The Error
Vocabulary</h5>
<p>In general, it is very difficult to predict error behavior. Step
failure may be catastrophic (programmer error), or it may be be the
result of user error, resource failures, etc. Steps may detect more
than one error, and the failure of one step may cause other steps
to fail as well.</p>
<p>The <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>/<a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> mechanism gives pipeline authors the
opportunity to process the errors that caused the <a href=
"#p.try"><tt class="tag-element">p:try</tt></a> to fail. In order
to facilitate some modicum of interoperability among processors,
errors that are reported on the <tt class="literal">error</tt>
output port of a <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> <span class="rfc2119">should</span>
conform to the format described here.</p>
<div class="section">
<h6><a name="cv.errors" id=
"cv.errors"></a>4.6.1.1&#160;c:errors</h6>
<p>The error vocabulary consists of a root element, <tt class=
"tag-element">c:errors</tt> which contains zero or more <a href=
"#cv.error"><tt class="tag-element">c:error</tt></a> elements.</p>
<p class="element-syntax element-syntax-error-vocabulary">
<code>&lt;c:errors&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.error">c:error</a>*<br />
&lt;/c:errors&gt;</code></p>
</div>
<div class="section">
<h6><a name="cv.error" id="cv.error"></a>4.6.1.2&#160;c:error</h6>
<p>Each specific error is represented by an <tt class=
"tag-element">c:error</tt> element:</p>
<p class="element-syntax element-syntax-error-vocabulary">
<code>&lt;c:error<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;code? = <var>QName</var><br />
&#160;&#160;href? = <var>anyURI</var><br />
&#160;&#160;line? = <var>integer</var><br />
&#160;&#160;column? = <var>integer</var><br />
&#160;&#160;offset? = <var>integer</var>&gt;<br />
&#160;&#160;&#160;&#160;(<var>string</var> |<br />
&#160;&#160;&#160;&#160;&#160;<var>anyElement</var>)*<br />
&lt;/c:error&gt;</code></p>
<p>The <tt class="tag-attribute">name</tt> and <tt class=
"tag-attribute">type</tt> attributes identify the name and type,
respectively, of the step which failed.</p>
<p>The <tt class="tag-attribute">code</tt> is a QName which
identifies the error. For steps which have defined error codes,
this is an opportunity for the step to identify the error in a
machine-processable fashion. Many steps omit this because they do
not include the concept of errors identified by QNames.</p>
<p>If the error was caused by a specific document, or by the
location of some erroneous construction in a specific document, the
<tt class="tag-attribute">href</tt>, <tt class=
"tag-attribute">line</tt>, <tt class="tag-attribute">column</tt>,
and <tt class="tag-attribute">offset</tt> attributes identify this
location. Generally, the error location is identified either with
line and column numbers or with an offset from the beginning of the
document, but not usually both.</p>
<p>The content of the <tt class="tag-element">c:error</tt> element
is any well-formed XML. Specific steps, or specific
implementations, may provide more detail about the format of the
content of an error message.</p>
</div>
<div class="section">
<h6><a name="error-example" id=
"error-example"></a>4.6.1.3&#160;Error Example</h6>
<p>Consider the following XSLT stylesheet:</p>
<div class="programlisting">
<pre>
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"&gt;
&lt;xsl:template match="/"&gt;
&lt;xsl:message terminate="yes"&gt;
&lt;xsl:text&gt;This stylesheet is &lt;/xsl:text&gt;
&lt;emph&gt;pointless&lt;/emph&gt;
&lt;xsl:text&gt;.&lt;/xsl:text&gt;
&lt;/xsl:message&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre></div>
<p>If it was used in a step named “xform” in a <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>, the following
error document might be produced:</p>
<div class="programlisting">
<pre>
&lt;c:errors xmlns:c="http://www.w3.org/ns/xproc-step"&gt;
&lt;c:error name="xform" type="p:xslt"
href="style.xsl" line="6"&gt;This stylesheet is &lt;emph&gt;pointless&lt;/emph&gt;.&lt;/c:error&gt;
&lt;/c:errors&gt;
</pre></div>
<p>It is not an error for steps to generate non-standard error
output as long as it is well-formed.</p>
</div>
</div>
<div class="section">
<h5><a name="example-try" id=
"example-try"></a>4.6.2&#160;Example</h5>
<p>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 <a href=
"#p.catch"><tt class="tag-element">p:catch</tt></a> step can
provide some sort of default for the rest of the pipeline.</p>
<div class="example-wrapper" id="ex.p.trycatch">
<div class="title">Example&#160;9.&#160;An Example Try/Catch</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:try&gt;
&lt;p:group&gt;
&lt;p:http-request&gt;
&lt;p:input port="source"&gt;
&lt;p:inline&gt;
&lt;c:request method="post" href="http://example.com/form-action"&gt;
&lt;c:body content-type="application/x-www-form-urlencoded"&gt;name=W3C&amp;amp;spec=XProc&lt;/c:body&gt;
&lt;/c:request&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:http-request&gt;
&lt;/p:group&gt;
&lt;p:catch&gt;
&lt;p:identity&gt;
&lt;p:input port="source"&gt;
&lt;p:inline&gt;
&lt;c:error&gt;HTTP Request Failed&lt;/c:error&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:identity&gt;
&lt;/p:catch&gt;
&lt;/p:try&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.atomic" id="p.atomic"></a>4.7&#160;Atomic Steps</h4>
<p>In addition to the six step types described in the preceding
sections, XProc provides a standard library of atomic step types.
The full vocabulary of standards steps is described in <a href=
"#std-components" title="Standard Step Library">Section&#160;7,
“Standard Step Library”</a>.</p>
<p>All of the standard, atomic steps are invoked in the same
way:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>p:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>p:atomic-step</var>&gt;</code></p>
<p>Where “<em class="replaceable"><tt class=
"replaceable">p:atomic-step</tt></em><span class=
"rfc2119">must</span> be in the XProc namespace and <span class=
"rfc2119">must</span> be declared in either the standard library
for the XProc version supported by the processor or explicitly
imported by the surrounding pipeline (see <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>).</p>
</div>
<div class="section">
<h4><a name="p.extension" id="p.extension"></a>4.8&#160;Extension
Steps</h4>
<p>Pipeline authors may also have access to additional steps not
defined or described by this specification. Atomic extension steps
are invoked just like standard steps:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>pfx:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>pfx:atomic-step</var>&gt;</code></p>
<p>Extension steps <span class="rfc2119">must not</span> be in the
XProc namespace and there <span class="rfc2119">must</span> be a
<em class="glossterm"><a href="#dt-visible">visible</a></em> step
declaration at the point of use (see <a href="#scoping" title=
"Scoping of Names">Section&#160;3.2, “Scoping of Names”</a>).</p>
<p>If the relevant step declaration has no <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>, then
that step invokes the declared atomic step, which the processor
must know how to perform. These steps are implementation-defined
extensions.</p>
<p>If the relevant step declaration has a <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>, then
that step runs the declared subpipeline. These steps are user- or
implementation-defined extensions. Pipelines can refer to
themselves (recursion is allowed), to pipelines defined in imported
libraries, and to other pipelines in the same library if they are
in a library.</p>
<p><a name="err.inline.S0010" id="err.inline.S0010"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0010"><code class=
"errqname">err:XS0010</code></a>) if a pipeline contains a step
whose specified inputs, outputs, and options do not <em class=
"glossterm"><a href="#dt-matches">match</a></em> the <em class=
"glossterm"><a href="#dt-signature">signature</a></em> for steps of
that type.</p>
<p><a name="err.inline.D0017" id="err.inline.D0017"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0017"><code class=
"errqname">err:XD0017</code></a>) if the running pipeline attempts
to invoke a step which the processor does not know how to
perform.</p>
<p><a name="impl-32" id="impl-32"></a>The presence of other
<em class="glossterm"><a href="#dt-compound-step">compound
steps</a></em> is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>; XProc
provides no standard mechanism for defining them or describing what
they can contain. <a name="err.inline.S0048" id=
"err.inline.S0048"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0048"><code class="errqname">err:XS0048</code></a>) to use a
declared step as a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>.</p>
<div class="section">
<h5><a name="option-shortcut" id=
"option-shortcut"></a>4.8.1&#160;Syntactic Shortcut for Option
Values</h5>
<p>Namespace qualified attributes on a step are <em class=
"glossterm"><a href="#dt-extension-attribute">extension
attributes</a></em>. Attributes, other than <tt class=
"tag-attribute">name</tt>, that are not namespace qualified are
treated as a syntactic shortcut for specifying the value of an
option. In other words, the following two steps are equivalent:</p>
<p>The first step uses the standard <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a>
syntax:</p>
<div class="programlisting">
<pre>
&lt;ex:stepType&gt;
&lt;p:with-option name="option-name" select="'some value'"/&gt;
&lt;/ex:stepType&gt;
</pre></div>
<p>The second step uses the syntactic shortcut:</p>
<div class="programlisting">
<pre>
&lt;ex:stepType option-name="some value"/&gt;
</pre></div>
<p>Note that there are significant limitations to this shortcut
syntax:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>It only applies to option names that are not in a namespace.</p>
</li>
<li>
<p>It only applies to option names that are not otherwise used on
the step, such as “<tt class="literal">name</tt>”.</p>
</li>
<li>
<p>It can only be used to specify a constant value. Options that
are computed at runtime must be written using the longer form.</p>
</li>
</ol>
</div>
<p><a name="err.inline.S0027" id="err.inline.S0027"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0027"><code class=
"errqname">err:XS0027</code></a>) if an option is specified with
both the shortcut form and the long form. <a name=
"err.inline.S0031" id="err.inline.S0031"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0031"><code class=
"errqname">err:XS0031</code></a>) to use an option on an <em class=
"glossterm"><a href="#dt-atomic-step">atomic step</a></em> that is
not declared on steps of that type.</p>
<p>The syntactic shortcuts apply equally to standard atomic steps
and extension atomic steps.</p>
</div>
</div>
</div>
<div class="section">
<h3><a name="other-elements" id="other-elements"></a>5&#160;Other
pipeline elements</h3>
<div class="section">
<h4><a name="p.input" id="p.input"></a>5.1&#160;p:input</h4>
<p>A <tt class="tag-element">p:input</tt> identifies an input port
for a step. In some contexts, <tt class="tag-element">p:input</tt>
declares that a port with the specified name exists and identifies
the properties of that port. In other contexts, it provides a
connection for a port declared elsewhere. And in some contexts, it
does both. The semantics of <tt class="tag-element">p:input</tt>
are complicated further by the fact that there are two kinds of
inputs, ordinary “document” inputs and “parameter” inputs.</p>
<div class="section">
<h5><a name="document-inputs" id=
"document-inputs"></a>5.1.1&#160;Document Inputs</h5>
<p>The declaration of a document input identifies the name of the
port, whether or not the port accepts a sequence, whether or not
the port is a <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>, and may
provide a default connection for the port.</p>
<p>An input <em>declaration</em> has the following form:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;kind? = "document"<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p>The <tt class="tag-attribute">port</tt> attribute defines the
name of the port. <a name="err.inline.S0011" id=
"err.inline.S0011"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0011"><code class="errqname">err:XS0011</code></a>) to
identify two ports with the same name on the same step.</p>
<p>The <tt class="tag-attribute">sequence</tt> attribute determines
whether or not a sequence of documents is allowed on the port.
<a name="err.inline.D0006" id="err.inline.D0006"></a>If <tt class=
"tag-attribute">sequence</tt> is not specified, or has the value
false, then it is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0006"><code class="errqname">err:XD0006</code></a>) unless
exactly one document appears on the declared port.</p>
<p>The <tt class="tag-attribute">primary</tt> attribute is used to
identify the <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>. An input port
is a <em class="glossterm"><a href="#dt-primary-input-port">primary
input port</a></em> if <tt class="tag-attribute">primary</tt> is
specified with the value <tt class="literal">true</tt> or if the
step has only a single input port and <tt class=
"tag-attribute">primary</tt> is not specified. <a name=
"err.inline.S0030" id="err.inline.S0030"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0030"><code class=
"errqname">err:XS0030</code></a>) to specify that more than one
input port is the primary.</p>
<p>The <tt class="tag-attribute">kind</tt> attribute distinguishes
between the two kinds of inputs: document inputs and parameter
inputs. An input port is a document input port if <tt class=
"tag-attribute">kind</tt> is specified with the value “<tt class=
"literal">document</tt>” or if <tt class="tag-attribute">kind</tt>
is not specified.</p>
<p>If a connection is provided in the declaration, then <tt class=
"tag-attribute">select</tt> may be used to select a portion of the
input identified by the <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a>, <a href="#p.document"><tt class=
"tag-element">p:document</tt></a>, <a href="#p.data"><tt class=
"tag-element">p:data</tt></a>, or <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a> elements in the <a href=
"#p.input"><tt class="tag-element">p:input</tt></a>. This select
expression applies <em>only</em> if the default connection is used.
If an explicit connection is provided by the caller, then the
default select expression is ignored.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The <a href="#p.pipe"><tt class="tag-element">p:pipe</tt></a>
element is explicitly excluded from a declaration because it would
make the default value of an input dependent on the execution of
some part of the pipeline. Default values are designed so that they
can be computed statically.</p>
</div>
<p>On a <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> for an atomic step, the
<a href="#p.input"><tt class="tag-element">p:input</tt></a> simply
declares the input port. <a name="err.inline.S0042" id=
"err.inline.S0042"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0042"><code class="errqname">err:XS0042</code></a>) to
attempt to provide a connection for an input port on the
declaration of an atomic step.</p>
<p>An input <em>connection</em> has the following form:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p>If no connection is provided for a <em class=
"glossterm"><a href="#dt-primary-input-port">primary input
port</a></em>, the input will be connected to the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>. <a name="err.inline.S0032" id=
"err.inline.S0032"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0032"><code class="errqname">err:XS0032</code></a>) if no
connection is provided and the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined.</p>
<p>A <tt class="tag-attribute">select</tt> expression <span class=
"rfc2119">may</span> also be provided with a connection. The
<tt class="tag-attribute">select</tt> expression, if specified,
applies the specified XPath select expression to the document(s)
that are read. Each selected node is wrapped in a document (unless
it is a document) and provided to the input port. In other
words,</p>
<div class="programlisting">
<pre>
&lt;p:input port="source"&gt;
&lt;p:document href="http://example.org/input.html"/&gt;
&lt;/p:input&gt;
</pre></div>
<p>provides a single document, but</p>
<div class="programlisting">
<pre>
&lt;p:input port="source" select="//html:div" xmlns:html="http://www.w3.org/1999/xhtml"&gt;
&lt;p:document href="http://example.org/input.html"/&gt;
&lt;/p:input&gt;
</pre></div>
<p>provides a sequence of zero or more documents, one for each
<tt class="code">html:div</tt> in <tt class=
"uri">http://example.org/input.html</tt>. (Note that in the case of
nested <tt class="code">html:div</tt> elements, this may result in
the same content being returned in several documents.)</p>
<p>A select expression can equally be applied to input read from
another step. This input:</p>
<div class="programlisting">
<pre>
&lt;p:input port="source" select="//html:div" xmlns:html="http://www.w3.org/1999/xhtml"&gt;
&lt;p:pipe step="origin" port="result"/&gt;
&lt;/p:input&gt;
</pre></div>
<p>provides a sequence of zero or more documents, one for each
<tt class="code">html:div</tt> in the document (or each of the
documents) that is read from the <tt class="literal">result</tt>
port of the step named <tt class="literal">origin</tt>.</p>
<p>The base URI of the document that results from a select
expression is the base URI of the matched element or document.
<a name="err.inline.D0016" id="err.inline.D0016"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0016"><code class=
"errqname">err:XD0016</code></a>) if the <tt class=
"tag-attribute">select</tt> expression on a <a href=
"#p.input"><tt class="tag-element">p:input</tt></a> returns atomic
values or anything other than element or document nodes (or an
empty sequence).</p>
<p>An input declaration may include a default connection. If no
connection is provided for an input port which has a default
connection, then the input is treated as if the default connection
appeared.</p>
<p>A default connection does not satisfy the requirement that a
primary input port is automatically connected by the processor, nor
is it used when no default readable port is defined. In other
words, a <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> or a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> can
define defaults for all of its inputs, whether they are primary or
not, but defining a default for a primary input usually has no
effect. It's never used by an atomic step since the step, when it's
called, will always connect the primary input port to the default
readable port (or cause a static error). The only case where it has
value is on a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> when that pipeline is invoked
directly by the processor. In that case, the processor <span class=
"rfc2119">must</span> use the default connection if no external
connection is provided for the port.</p>
</div>
<div class="section">
<h5><a name="parameter-inputs" id=
"parameter-inputs"></a>5.1.2&#160;Parameter Inputs</h5>
<p>The declaration of a parameter input identifies the name of the
port and that the port is a parameter input.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;<strong>kind</strong> = "parameter"&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p>The <tt class="tag-attribute">port</tt> attribute defines the
name of the port. <a name="err.inline.S0011.1" id=
"err.inline.S0011.1"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0011"><code class="errqname">err:XS0011</code></a>) to
identify two ports with the same name on the same step.</p>
<p>The <tt class="tag-attribute">sequence</tt> attribute determines
whether or not a sequence of documents is allowed on the port. A
sequence of documents is always allowed on a parameter input port.
<a name="err.inline.S0040" id="err.inline.S0040"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0040"><code class=
"errqname">err:XS0040</code></a>) to specify any value other than
<tt class="literal">true</tt>.</p>
<p>The <tt class="tag-attribute">primary</tt> attribute is used to
identify the <em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em>. An input port is a <em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em> if it is a <em class="glossterm"><a href=
"#dt-parameter-input-port">parameter input port</a></em> and
<tt class="tag-attribute">primary</tt> is specified with the value
<tt class="literal">true</tt> or if the step has only a single
parameter input port and <tt class="tag-attribute">primary</tt> is
not specified. <a name="err.inline.S0030.1" id=
"err.inline.S0030.1"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0030"><code class="errqname">err:XS0030</code></a>) to
specify that more than one parameter input port is the primary.</p>
<p>The <tt class="tag-attribute">kind</tt> attribute distinguishes
between the two kinds of inputs: document inputs and parameter
inputs. An input port is a parameter input port only if the
<tt class="tag-attribute">kind</tt> attribute is specified with the
value “parameter”. <a name="err.inline.S0033" id=
"err.inline.S0033"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0033"><code class="errqname">err:XS0033</code></a>) to
specify any kind of input other than “document” or “parameter”.</p>
<p>A parameter input port is a distinguished kind of input port. It
exists only to receive computed parameters; if a step does not have
a parameter input port then it cannot receive parameters. A
parameter input port must satisfy all the constraints of a normal,
document input port.</p>
<p><a name="err.inline.S0035" id="err.inline.S0035"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0035"><code class=
"errqname">err:XS0035</code></a>) if the declaration of a parameter
input port contains a connection; parameter input port declarations
must be empty.</p>
<p>When used on a step, parameter input ports are connected just
like ordinary document ports. Parameter input ports always accept a
sequence of documents. If no explicit connection is provided for a
<em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em>, then the port will be connected to the primary
parameter input port of the pipeline which contains the step. If no
connection is provided for a parameter input port other than the
primary parameter input port, then the port will be connected to an
<em class="glossterm"><a href="#dt-empty-sequence">empty
sequence</a></em> of documents.</p>
<p><a name="err.inline.S0055" id="err.inline.S0055"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0055"><code class=
"errqname">err:XS0055</code></a>) if a primary parameter input port
is unconnected and the pipeline that contains the step has no
primary parameter input port unless at least one explicit <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a> is
provided for that port.</p>
<p>In other words, it is an error to leave a parameter input port
unconnected, but any parameter passed explicitly to that port
satisfies the connection requirement.</p>
<p>This is an error:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:input port="source"/&gt;
&lt;p:output port="result"/&gt;
&lt;p:xslt&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:declare-step&gt;
</pre></div>
<p>The parameter input port on the <a href="#c.xslt"><tt class=
"tag-element">p:xslt</tt></a> step has no connection and the
pipeline that contains the step has no primary parameter input
port.</p>
<p>This is not an error:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:input port="source"/&gt;
&lt;p:output port="result"/&gt;
&lt;p:xslt&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
&lt;/p:input&gt;
&lt;p:with-param name="mode" select="'debug'"/&gt;
&lt;/p:xslt&gt;
&lt;/p:declare-step&gt;
</pre></div>
<p>Explicitly setting the “<tt class="literal">mode</tt>” parameter
satisfies the binding requirement. No other parameters can be
passed to the <a href="#c.xslt"><tt class=
"tag-element">p:xslt</tt></a> step.</p>
<p>This, also, is not an error:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:xslt&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
&lt;/p:input&gt;
&lt;p:with-param name="mode" select="'debug'"/&gt;
&lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>The parameter input port on the <a href="#c.xslt"><tt class=
"tag-element">p:xslt</tt></a> step is bound to the primary
parameter input port of the pipeline. The <a href=
"#c.xslt"><tt class="tag-element">p:xslt</tt></a> step will receive
the “<tt class="literal">mode</tt>” parameter and any other
parameters passed to the pipeline.</p>
<p>If a parameter input port on a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> is not connected, it is treated
as if it was connected to an automatically created <a href=
"#c.sink"><tt class="tag-element">p:sink</tt></a> step. In other
words, if a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> does not contain any steps that
have parameter input ports, or if those ports are all explicitly
connected elsewhere, the parameter input port is ignored. In this
one case, it is not an error for an input port to be
unconnected.</p>
<p>A step which accepts a parameter input reads all of the
documents presented on that port, using each <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> (either at the
root or inside the <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a>) to establish the value of the
named parameter. If the same name appears more than once, the last
value specified is used. If the step also has literal <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a>
elements, they are also considered in document order. In other
words, <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> elements that appear before the
parameter input may be overridden by the computed parameters;
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> elements that appear after may
override the computed values.</p>
<p>If a connection is manufactured for a primary parameter input
port, that connection occurs logically last among the other
parameters, options, and connections passed to the step. In other
words, the parameter values that appear on that port will be used
even if other values were specified with <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a>
elements. Users can change this priority by making the connection
explicit and placing any <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> elements that they wish to
function as overrides after the connection.</p>
<p>All of the documents that appear on a parameter input must
either be <a href="#cv.param"><tt class=
"tag-element">c:param</tt></a> documents or <a href=
"#cv.param-set"><tt class="tag-element">c:param-set</tt></a>
documents.</p>
<p>Consider the example in <a href="#ex.parameter" title=
"A Parameter Example">Example&#160;10, “A Parameter
Example”</a>.</p>
<div class="example-wrapper" id="ex.parameter">
<div class="title">Example&#160;10.&#160;A Parameter Example</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
version="1.0"
name="main"&gt;
&lt;p:xslt&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="main" port="source"/&gt;
&lt;/p:input&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
&lt;/p:input&gt;
&lt;p:with-param name="output-type" select="'html'"/&gt;
&lt;p:input port="parameters"&gt;
&lt;p:pipe step="main" port="parameters"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p>This <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> declares that it accepts
parameters. Suppose that (through some <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
mechanism) I have passed the parameters “<tt class=
"varname">output-type</tt>=<tt class="literal">fo</tt>” and
<tt class="varname">profile</tt>=<tt class=
"literal">unclassified</tt>” to the pipeline. These parameters are
available on the <tt class="literal">parameters</tt> input
port.</p>
<p>When the XSLT step runs, it will read those parameters and
combine them with any parameters specified literally on the step.
Because the parameter input comes <em>after</em> the literal
declaration for <tt class="varname">output-type</tt> on the step,
the XSLT stylesheet will see both values that I passed in
(“<tt class="varname">output-type</tt>=<tt class="literal">fo</tt>
and “<tt class="varname">profile</tt>=<tt class=
"literal">unclassified</tt>”).</p>
<p>If the parameter input came <em>before</em> the literal
declaration, then the XSLT stylesheet would see “<tt class=
"varname">output-type</tt>=<tt class="literal">html</tt>” and
<tt class="varname">profile</tt>=<tt class=
"literal">unclassified</tt>”.</p>
<p>Most steps don't bother to declare parameter inputs, or provide
explicit connections for them, and “the right thing” usually
happens.</p>
<div class="section">
<h6><a name="cv.param" id="cv.param"></a>5.1.2.1&#160;The c:param
element</h6>
<p>A <tt class="tag-element">c:param</tt> represents a parameter on
a parameter input.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;namespace? = <var>anyURI</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p>The <tt class="tag-attribute">name</tt> attribute of the
<tt class="tag-element">c:param</tt> must have the lexical form of
a QName.</p>
<p>If the <tt class="tag-attribute">namespace</tt> attribute is
specified, then the expanded name of the parameter is constructed
from the specified namespace and the <tt class=
"tag-attribute">name</tt> value. <a name="err.inline.D0025" id=
"err.inline.D0025"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0025"><code class="errqname">err:XD0025</code></a>) if the
<tt class="tag-attribute">namespace</tt> attribute is specified,
the <tt class="tag-attribute">name</tt> contains a colon, and the
specified namespace is not the same as the in-scope namespace
binding for the specified prefix.</p>
<p>If the <tt class="tag-attribute">namespace</tt> attribute is not
specified, and the <tt class="tag-attribute">name</tt> contains a
colon, then the expanded name of the parameter is constructed using
the <tt class="tag-attribute">name</tt> value and the namespace
declarations in-scope on the <tt class="tag-element">c:param</tt>
element.</p>
<p>If the <tt class="tag-attribute">namespace</tt> attribute is not
specified, and the <tt class="tag-attribute">name</tt> does not
contain a colon, then the expanded name of the parameter is in no
namespace.</p>
<p>Any namespace-qualified attribute names that appear on the
<tt class="tag-element">c:param</tt> element are ignored. <a name=
"err.inline.D0014" id="err.inline.D0014"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0014"><code class=
"errqname">err:XD0014</code></a>) for any unqualified attribute
names other than “<tt class="literal">name</tt>”, “<tt class=
"literal">namespace</tt>”, or “<tt class="literal">value</tt>” to
appear on a <tt class="tag-element">c:param</tt> element.</p>
</div>
<div class="section">
<h6><a name="cv.param-set" id="cv.param-set"></a>5.1.2.2&#160;The
c:param-set element</h6>
<p>A <tt class="tag-element">c:param-set</tt> represents a set of
parameters on a parameter input.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param-set&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.param">c:param</a>*<br />
&lt;/c:param-set&gt;</code></p>
<p>The <tt class="tag-element">c:param-set</tt> contains zero or
more <a href="#cv.param"><tt class="tag-element">c:param</tt></a>
elements. <a name="err.inline.D0018" id="err.inline.D0018"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0018"><code class=
"errqname">err:XD0018</code></a>) if the parameter list contains
any elements other than <a href="#cv.param"><tt class=
"tag-element">c:param</tt></a>.</p>
<p>Any namespace-qualified attribute names that appear on the
<tt class="tag-element">c:param-set</tt> element are ignored.
<a name="err.inline.D0014.1" id="err.inline.D0014.1"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0014"><code class=
"errqname">err:XD0014</code></a>) for any unqualified attribute
names to appear on a <tt class="tag-element">c:param-set</tt>
element.</p>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.iteration-source" id=
"p.iteration-source"></a>5.2&#160;p:iteration-source</h4>
<p>A <tt class="tag-element">p:iteration-source</tt> identifies
input to a <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:iteration-source<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:iteration-source&gt;</code></p>
<p>The <tt class="tag-attribute">select</tt> attribute and
<em class="glossterm"><a href="#dt-connection">connection</a></em>
of a <tt class="tag-element">p:iteration-source</tt> work the same
way that they do in a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>.</p>
</div>
<div class="section">
<h4><a name="p.viewport-source" id=
"p.viewport-source"></a>5.3&#160;p:viewport-source</h4>
<p>A <tt class="tag-element">p:viewport-source</tt> identifies
input to a <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport-source&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)?<br />
&lt;/p:viewport-source&gt;</code></p>
<p>Only one <em class="glossterm"><a href=
"#dt-connection">connection</a></em> is allowed and it works the
same way that connections work on a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>. <a name="err.inline.D0003.1" id=
"err.inline.D0003.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0003"><code class="errqname">err:XD0003</code></a>) unless
exactly one document appears on the <tt class=
"tag-element">p:viewport-source</tt>. No <tt class=
"tag-attribute">select</tt> expression is allowed.</p>
</div>
<div class="section">
<h4><a name="p.output" id="p.output"></a>5.4&#160;p:output</h4>
<p>A <tt class="tag-element">p:output</tt> identifies an output
port, optionally connecting an input for it, if necessary.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&#160;/&gt;</code></p>
<p>The <tt class="tag-attribute">port</tt> attribute defines the
name of the port. <a name="err.inline.S0011.2" id=
"err.inline.S0011.2"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0011"><code class="errqname">err:XS0011</code></a>) to
identify two ports with the same name on the same step.</p>
<p>An output declaration can indicate if a sequence of documents is
allowed to appear on the declared port. If <tt class=
"tag-attribute">sequence</tt> is specified with the value
<tt class="literal">true</tt>, then a sequence is allowed. <a name=
"err.inline.D0007" id="err.inline.D0007"></a>If <tt class=
"tag-attribute">sequence</tt> is not specified on <tt class=
"tag-element">p:output</tt>, or has the value false, then it is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0007"><code class=
"errqname">err:XD0007</code></a>) if the step does not produce
exactly one document on the declared port.</p>
<p>The <tt class="tag-attribute">primary</tt> attribute is used to
identify the primary output port. An output port is a primary
output port if <tt class="tag-attribute">primary</tt> is specified
with the value <tt class="literal">true</tt> or if the step has
only a single output port and primary is not specified. <a name=
"err.inline.S0014" id="err.inline.S0014"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0014"><code class=
"errqname">err:XS0014</code></a>) to identify more than one output
port as primary.</p>
<p>On <em class="glossterm"><a href="#dt-compound-step">compound
steps</a></em>, the declaration <span class="rfc2119">may</span> be
accompanied by a <em class="glossterm"><a href=
"#dt-connection">connection</a></em> for the output.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:output&gt;</code></p>
<p><a name="err.inline.S0029" id="err.inline.S0029"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0029"><code class=
"errqname">err:XS0029</code></a>) to specify a connection for a
<tt class="tag-element">p:output</tt> inside a <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>
for an atomic step.</p>
<p>If a connection is provided for a <tt class=
"tag-element">p:output</tt>, documents are <em>read from</em> that
connection and those documents form the output that <em>is
written</em> to the output port. In other words, placing a <a href=
"#p.document"><tt class="tag-element">p:document</tt></a> inside a
<tt class="tag-element">p:output</tt> causes the processor to
<em>read that document</em> and provide it on the output port. It
<em>does not</em> cause the processor to <em>write</em> the output
to that document.</p>
</div>
<div class="section">
<h4><a name="p.log" id="p.log"></a>5.5&#160;p:log</h4>
<p>A <tt class="tag-element">p:log</tt> element is a debugging aid.
It associates a URI with a specific output port on a step:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:log<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var>&#160;/&gt;</code></p>
<p>The semantics of <tt class="tag-element">p:log</tt> are that it
writes to the specified IRI whatever document or documents appear
on the specified port. <a name="impl-33" id="impl-33"></a>If the
<tt class="tag-attribute">href</tt> attribute is not specified, the
location of the log file or files is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><a name="impl-34" id="impl-34"></a>How each document or sequence
of documents is represented in a <tt class="tag-element">p:log</tt>
is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
Pipelines are not expected to be able to consume their own logging
output. <a name="impl-35" id="impl-35"></a>The ability of a step to
read the <tt class="tag-element">p:log</tt> output of some former
step is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p><a name="err.inline.S0026" id="err.inline.S0026"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0026"><code class=
"errqname">err:XS0026</code></a>) if the port specified on the
<tt class="tag-element">p:log</tt> is not the name of an output
port on the step in which it appears or if more than one <tt class=
"tag-element">p:log</tt> element is applied to the same port.</p>
<p>Implementations may, at user option, ignore all <tt class=
"tag-element">p:log</tt> elements.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>This element represents a potential security risk: running
unexamined 3rd-party pipelines could result in vital system
resources being overwritten.</p>
</div>
</div>
<div class="section">
<h4><a name="p.serialization" id=
"p.serialization"></a>5.6&#160;p:serialization</h4>
<p>The <tt class="tag-element">p:serialization</tt> element allows
the user to request serialization properties on a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>
output.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:serialization<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;byte-order-mark? = <var>boolean</var><br />
&#160;&#160;cdata-section-elements? = <var>NMTOKENS</var><br />
&#160;&#160;doctype-public? = <var>string</var><br />
&#160;&#160;doctype-system? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;escape-uri-attributes? = <var>boolean</var><br />
&#160;&#160;include-content-type? = <var>boolean</var><br />
&#160;&#160;indent? = <var>boolean</var><br />
&#160;&#160;media-type? = <var>string</var><br />
&#160;&#160;method? = <var>QName</var><br />
&#160;&#160;normalization-form? =
<var>NFC|NFD|NFKC|NFKD|fully-normalized|none|xs:NMTOKEN</var><br />
&#160;&#160;omit-xml-declaration? = <var>boolean</var><br />
&#160;&#160;standalone? = <var>true|false|omit</var><br />
&#160;&#160;undeclare-prefixes? = <var>boolean</var><br />
&#160;&#160;version? = <var>string</var>&#160;/&gt;</code></p>
<p>If the pipeline processor serializes the output on the specified
port, it <span class="rfc2119">must</span> use the serialization
options specified. If the processor is not serializing (if, for
example, the pipeline has been called from another pipeline), then
the <tt class="tag-element">p:serialization</tt> <span class=
"rfc2119">must</span> be ignored. The processor <span class=
"rfc2119">may</span> reject statically a pipeline that requests
serialization options that it cannot provide.</p>
<p><a name="impl-36" id="impl-36"></a>The default value of any
serialization options not specified on a particular <tt class=
"tag-element">p:serialization</tt> element is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. The
allowed options are defined by [<a href=
"#xml-serialization"><span class=
"abbrev">Serialization</span></a>]. <a name="err.inline.D0020" id=
"err.inline.D0020"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0020"><code class="errqname">err:XD0020</code></a>) if the
combination of serialization options specified or defaulted is not
allowed. Implementations <span class="rfc2119">must</span> check
that all of the specified serialization options are allowed if they
serialize the specified output. If the specified output is not
being serialized (because it is being returned as the result of a
call from within another pipeline, for example) implementations
<span class="rfc2119">may</span> but are not required to check that
the specified options are allowed.</p>
<p>The semantics of the attributes on a <tt class=
"tag-element">p:serialization</tt> are described in <a href=
"#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>.</p>
<p><a name="err.inline.S0039" id="err.inline.S0039"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0039"><code class=
"errqname">err:XS0039</code></a>) if the port specified on the
<tt class="tag-element">p:serialization</tt> is not the name of an
output port on the pipeline in which it appears or if more than one
<tt class="tag-element">p:serialization</tt> element is applied to
the same port.</p>
</div>
<div class="section">
<h4><a name="variables-options-parameters" id=
"variables-options-parameters"></a>5.7&#160;Variables, Options, and
Parameters</h4>
<p>Variables, options, and parameters provide a mechanism for
pipeline authors to construct temporary results and hold onto them
for reuse.</p>
<p>Variables are created in compound steps and, like XSLT
variables, are single assignment, though they may be shadowed by
subsequent declarations of other variables with the same name.</p>
<p>Options can be declared on atomic or compound steps. The value
of an option can be specified by the caller invoking the step. Any
value specified by the caller takes precedence over any default
value specified in the declaration.</p>
<p>Parameters, unlike options and variables, have names that can be
computed at runtime. The most common use of parameters is to pass
parameter values to XSLT stylesheets.</p>
<div class="section">
<h5><a name="p.variable" id=
"p.variable"></a>5.7.1&#160;p:variable</h5>
<p>A <tt class="tag-element">p:variable</tt> declares a variable
and associates a value with it.</p>
<p>The name of the variable <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.S0028" id="err.inline.S0028"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0028"><code class=
"errqname">err:XS0028</code></a>) to declare an option or variable
in the XProc namespace.</p>
<p>The variable's value is specified with a <tt class=
"tag-attribute">select</tt> attribute. The <tt class=
"tag-attribute">select</tt> attribute <span class=
"rfc2119">must</span> be specified. The content of the <tt class=
"tag-attribute">select</tt> attribute is an XPath expression which
will be evaluated to provide the value of the variable.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:variable<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:variable&gt;</code></p>
<p>If a <tt class="tag-attribute">select</tt> expression is given,
it is evaluated as an XPath expression using the appropriate
context as described in <a href="#xpath-context" title=
"XPaths in XProc">Section&#160;2.6, “XPaths in XProc”</a>, for the
enclosing <em class="glossterm"><a href=
"#dt-container">container</a></em>, with the addition of bindings
for all preceding-sibling <tt class="tag-element">p:variable</tt>
and <a href="#p.option"><tt class="tag-element">p:option</tt></a>
elements. Regardless of the implicit type of the expression, when
XPath 1.0 is being used, the string value of the expression becomes
the value of the variable; when XPath 2.0 is being used, the type
is treated as an <tt class="type">xs:untypedAtomic</tt>.</p>
<p>Since all <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope bindings</a></em> are present in
the Processor XPath Context as variable bindings, <tt class=
"tag-attribute">select</tt> expressions may refer to the value of
<em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em> by variable reference. If a variable reference
uses a QName that is not the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em>, an XPath evaluation error will occur.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is given,
the <em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em> available for document connections are the
<em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em> in the environment inherited by the first step in
the surrounding <em class="glossterm"><a href=
"#dt-container">container</a></em>'s <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em>. However, in order
to avoid ordering paradoxes, <a name="err.inline.S0019" id=
"err.inline.S0019"></a>it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0019"><code class="errqname">err:XS0019</code></a>) for a
variable's document connection to refer to the output port of any
step in the surrounding <em class="glossterm"><a href=
"#dt-container">container</a></em>'s <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em>.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is given
but no document connection is provided, the implicit connection is
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> in the
environment inherited by the first step in the surrounding
<em class="glossterm"><a href="#dt-container">container</a></em>'s
<em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em>. If there is no default readable port, the
connection is treated as if <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a> was specified.</p>
<p><a name="err.inline.D0008.2" id="err.inline.D0008.2"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0008"><code class=
"errqname">err:XD0008</code></a>) if a sequence of more than one
document appears on the connection for a <tt class=
"tag-element">p:variable</tt>. In an XPath 1.0 implementation, if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> is
given or implied as the document connection, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context node. In an XPath 2.0 implementation, the context item is
undefined. <a name="err.inline.D0026" id="err.inline.D0026"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0026"><code class=
"errqname">err:XD0026</code></a>) if the <tt class=
"tag-attribute">select</tt> expression makes reference to the
context node, size, or position when the context item is
undefined.</p>
</div>
<div class="section">
<h5><a name="p.option" id="p.option"></a>5.7.2&#160;p:option</h5>
<p>A <tt class="tag-element">p:option</tt> declares an option and
may associate a default value with it. The <tt class=
"tag-element">p:option</tt> tag can only be used in a <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>
or a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> (which is a syntactic
abbreviation for a step declaration).</p>
<p>The name of the option <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.S0028.1" id="err.inline.S0028.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0028"><code class=
"errqname">err:XS0028</code></a>) to declare an option or variable
in the XProc namespace.</p>
<p><a name="err.inline.S0004.1" id="err.inline.S0004.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0004"><code class=
"errqname">err:XS0004</code></a>) to declare two or more options on
the same step with the same name.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var>&#160;/&gt;</code></p>
<p>An option may be declared as <tt class=
"tag-attribute">required</tt>. <a name="err.inline.S0018" id=
"err.inline.S0018"></a>If an option is required, it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0018"><code class=
"errqname">err:XS0018</code></a>) to invoke the step without
specifying a value for that option.</p>
<p>If an option is not declared to be required, it <span class=
"rfc2119">may</span> be given a default value. The value is
specified with a <tt class="tag-attribute">select</tt>
attribute.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&#160;/&gt;</code></p>
<p>If a <tt class="tag-attribute">select</tt> attribute is
specified, its content is an XPath expression which will be
evaluated to provide the value of the option, which may differ from
one instance of the step type to another.</p>
<p>The <tt class="tag-attribute">select</tt> expression is only
evaluated when its actual value is needed by an instance of the
step type being declared. In this case, it is evaluated as
described in <a href="#p.with-option" title=
"p:with-option">Section&#160;5.7.3, “p:with-option”</a> except
that</p>
<div class="itemizedlist">
<ul>
<li>
<p>In an XPath 1.0 implementation, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context. In an XPath 2.0 implementation, the context item is
undefined.</p>
</li>
<li>
<p>the variable bindings consist only of bindings for options whose
declaration precedes the <tt class="tag-element">p:option</tt>
itself in the surrounding step <em class="glossterm"><a href=
"#dt-signature">signature</a></em>;</p>
</li>
<li>
<p>the in-scope namespaces are the in-scope namespaces of the
<tt class="tag-element">p:option</tt> itself.</p>
</li>
</ul>
</div>
<p><a name="err.inline.S0017" id="err.inline.S0017"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0017"><code class=
"errqname">err:XS0017</code></a>) to specify that an option is both
<tt class="tag-attribute">required</tt> <em>and</em> has a default
value.</p>
<p><a name="err.inline.D0026.1" id="err.inline.D0026.1"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0026"><code class=
"errqname">err:XD0026</code></a>) if the <tt class=
"tag-attribute">select</tt> expression makes reference to the
context node, size, or position.</p>
<p>Regardless of the implicit type of the expression, when XPath
1.0 is being used, the string value of the expression becomes the
value of the option; when XPath 2.0 is being used, the value is an
<tt class="type">xs:untypedAtomic</tt>.</p>
</div>
<div class="section">
<h5><a name="p.with-option" id=
"p.with-option"></a>5.7.3&#160;p:with-option</h5>
<p>A <tt class="tag-element">p:with-option</tt> provides an actual
value for an option when a step is invoked.</p>
<p>The name of the option <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.S0031.1" id="err.inline.S0031.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0031"><code class=
"errqname">err:XS0031</code></a>) to use an option name in
<tt class="tag-element">p:with-option</tt> if the step type being
invoked has not declared an option with that name. (This error does
not apply for steps in the XProc namespace when the processor is
operating in <a href="#vers-forwcomp">forwards-compatible
mode</a>.)</p>
<p><a name="err.inline.S0004.2" id="err.inline.S0004.2"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0004"><code class=
"errqname">err:XS0004</code></a>) to include more than one
<tt class="tag-element">p:with-option</tt> with the same option
name as part of the same step invocation.</p>
<p>The actual value is specified with a <tt class=
"tag-attribute">select</tt> attribute. The <tt class=
"tag-attribute">select</tt> attribute <span class=
"rfc2119">must</span> be specified. The value of the <tt class=
"tag-attribute">select</tt> attribute is an XPath expression which
will be evaluated to provide the value of the variable.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-option&gt;</code></p>
<p>Regardless of the implicit type of the expression, when XPath
1.0 is being used, the string value of the expression becomes the
value of the option; when XPath 2.0 is being used, the value is an
<tt class="type">xs:untypedAtomic</tt>.</p>
<p>All <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope bindings</a></em> for the step
instance itself are present in the Processor XPath Context as
variable bindings, so <tt class="tag-attribute">select</tt>
expressions may refer to any option or variable bound in those
<em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em> by variable reference. If a variable reference
uses a QName that is not the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em> or preceding sibling option, an XPath evaluation
error will occur.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is used
but no document connection is provided, the implicit connection is
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>. If
there is no default readable port, the connection is treated as if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> was
specified.</p>
<p><a name="err.inline.D0008.3" id="err.inline.D0008.3"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0008"><code class=
"errqname">err:XD0008</code></a>) if a sequence of more than one
document appears on the connection for a <tt class=
"tag-element">p:with-option</tt>. In an XPath 1.0 implementation,
if <a href="#p.empty"><tt class="tag-element">p:empty</tt></a> is
given or implied as the document connection, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context node. In an XPath 2.0 implementation, the context item is
undefined. <a name="err.inline.D0026.2" id=
"err.inline.D0026.2"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0026"><code class="errqname">err:XD0026</code></a>) if the
<tt class="tag-attribute">select</tt> expression makes reference to
the context node, size, or position when the context item is
undefined.</p>
</div>
<div class="section">
<h5><a name="p.with-param" id=
"p.with-param"></a>5.7.4&#160;p:with-param</h5>
<p>The <tt class="tag-element">p:with-param</tt> element is used to
establish the value of a parameter. The parameter <span class=
"rfc2119">must</span> be given a value when it is used. (Parameter
names aren't known in advance; there's no provision for declaring
them.)</p>
<p>The name of the parameter <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.D0031" id="err.inline.D0031"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0031"><code class=
"errqname">err:XD0031</code></a>) to use the XProc namespace in the
name of a parameter.</p>
<p>The value is specified with a <tt class=
"tag-attribute">select</tt> attribute. The <tt class=
"tag-attribute">select</tt> attribute <span class=
"rfc2119">must</span> be specified. The content of the <tt class=
"tag-attribute">select</tt> attribute is an XPath expression which
will be evaluated to provide the value of the variable.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var><br />
&#160;&#160;port? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-param&gt;</code></p>
<p>The values of parameters for a step <span class=
"rfc2119">must</span> be computed after all the options in the
step's <em class="glossterm"><a href=
"#dt-signature">signature</a></em> have had their values computed.
If a <tt class="tag-attribute">select</tt> expression is given on a
<tt class="tag-element">p:with-param</tt>, it is evaluated as an
XPath expression using the appropriate context as described in
<a href="#xpath-context" title="XPaths in XProc">Section&#160;2.6,
“XPaths in XProc”</a>, for the containing step, with the addition
of variable bindings for all options declared in the containing
step's <em class="glossterm"><a href=
"#dt-signature">signature</a></em>.</p>
<p>Regardless of the implicit type of the expression, when XPath
1.0 is being used, the string value of the expression becomes the
value of the parameter; when XPath 2.0 is being used, the value is
an <tt class="type">xs:untypedAtomic</tt>.</p>
<p>All <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope bindings</a></em> for the step
instance itself are present in the Processor XPath Context as
variable bindings, so <tt class="tag-attribute">select</tt>
expressions may refer to any option or variable bound in those
<em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em>, as well as to any option declared in the step
signature, by variable reference. If a variable reference uses a
QName that is not the name of an <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope binding</a></em> or declared
option, an XPath evaluation error will occur.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is used
but no document connection is provided, the implicit connection is
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>. If
there is no default readable port, the connection is treated as if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> was
specified.</p>
<p><a name="err.inline.D0008.4" id="err.inline.D0008.4"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0008"><code class=
"errqname">err:XD0008</code></a>) if a sequence of more than one
document appears on the connection for a <tt class=
"tag-element">p:with-param</tt>. In an XPath 1.0 implementation, if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> is
given or implied as the document connection, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context node. In an XPath 2.0 implementation, the context item is
undefined. <a name="err.inline.D0026.3" id=
"err.inline.D0026.3"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0026"><code class="errqname">err:XD0026</code></a>) if the
<tt class="tag-attribute">select</tt> expression makes reference to
the context node, size, or position when the context item is
undefined.</p>
<p>If the optional <tt class="tag-attribute">port</tt> attribute is
specified, then the parameter appears on the named port, otherwise
the parameter appears on the step's <em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em>. <a name="err.inline.S0034" id=
"err.inline.S0034"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0034"><code class="errqname">err:XS0034</code></a>) if the
specified port is not a parameter input port or if no port is
specified and the step does not have a primary parameter input
port.</p>
</div>
<div class="section">
<h5><a name="opt-param-bindings" id=
"opt-param-bindings"></a>5.7.5&#160;Namespaces on variables,
options, and parameters</h5>
<p>Variable, option and parameter values carry with them not only
their literal or computed string value but also a set of
namespaces. To see why this is necessary, consider the following
step:</p>
<div class="programlisting">
<pre>
&lt;p:delete xmlns:p="http://www.w3.org/ns/xproc"&gt;
&lt;p:with-option name="match" select="'html:div'"
xmlns:html="http://www.w3.org/1999/xhtml"/&gt;
&lt;/p:delete&gt;
</pre></div>
<p>The <a href="#c.delete"><tt class=
"tag-element">p:delete</tt></a> step will delete elements that
match the expression “<tt class="literal">html:div</tt>”, but that
expression can only be correctly interpreted if there's a namespace
binding for the prefix “<tt class="literal">html</tt>” so that
binding has to travel with the option.</p>
<p>The default namespace bindings associated with a variable,
option or parameter value are computed as follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the <tt class="tag-attribute">select</tt> attribute was used
to specify the value and it consisted of a single <tt class=
"literal">VariableReference</tt> (per [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] or [<a href=
"#xpath2"><span class="abbrev">XPath 2.0</span></a>], as
appropriate), then the namespace bindings from the referenced
option or variable are used.</p>
</li>
<li>
<p>If the <tt class="tag-attribute">select</tt> attribute was used
to specify the value and it evaluated to a node-set, then the
in-scope namespaces from the first node in the selected node-set
(or, if it's not an element, its parent) are used.</p>
<p>The expression is evaluated in the appropriate context, See
<a href="#xpath-context" title="XPaths in XProc">Section&#160;2.6,
“XPaths in XProc”</a>.</p>
</li>
<li>
<p>Otherwise, the in-scope namespaces from the element providing
the value are used. (For options specified using <a href=
"#option-shortcut">syntactic shortcuts</a>, the step element itself
is providing the value.)</p>
</li>
</ol>
</div>
<p>The default namespace is never included in the namespace
bindings for a variable, option or parameter value. Unqualified
names are always in no-namespace.</p>
<p>Unfortunately, in more complex situations, there may be no
single variable, option or parameter that can reliably be expected
to have the correct set of namespace bindings. Consider this
pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline type="ex:delete-in-div"
version="1.0"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://example.org/ns/ex"
xmlns:h="http://www.w3.org/1999/xhtml"&gt;
&lt;p:option name="divchild" required="true"/&gt;
&lt;p:delete&gt;
&lt;p:with-option name="match" select="concat('h:div/',$divchild)"/&gt;
&lt;/p:delete&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>It defines an atomic step (“<tt class=
"literal">ex:delete-in-div</tt>”) that deletes elements that occur
inside of XHTML div elements. It might be used as follows:</p>
<div class="programlisting">
<pre>
&lt;ex:delete-in-div xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://example.org/ns/ex"
xmlns:html="http://www.w3.org/1999/xhtml"
divchild="html:p[@class='delete']"/&gt;
</pre></div>
<p>In this case, the <tt class="varname">match</tt> option passed
to the <a href="#c.delete"><tt class=
"tag-element">p:delete</tt></a> step needs <em>both</em> the
namespace binding of “<tt class="literal">h</tt>” specified in the
<tt class="tag-element">ex:delete-in-div</tt> pipeline definition
<em>and</em> the namespace binding of “<tt class=
"literal">html</tt>” specified in the <tt class=
"varname">divchild</tt> option on the call of that pipeline. It's
not sufficient to provide just one of the sets of bindings.</p>
<p id="p.namespaces">The <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element can be used as a child
of <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a>, <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> to provide explicit
bindings.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:namespaces<br />
&#160;&#160;binding? = <var>QName</var><br />
&#160;&#160;element? = <var>XPathExpression</var><br />
&#160;&#160;except-prefixes? = <var>prefix
list</var>&#160;/&gt;</code></p>
<p>The namespace bindings specified by a <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a>
element are determined as follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the <tt class="tag-attribute">binding</tt> attribute is
specified, it <span class="rfc2119">must</span> contain the name of
a single <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope binding</a></em>. The namespace
bindings associated with that binding are used. <a name=
"err.inline.S0020" id="err.inline.S0020"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0020"><code class=
"errqname">err:XS0020</code></a>) if the <tt class=
"tag-attribute">binding</tt> attribute on <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a> is
specified and its value is not the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em>.</p>
</li>
<li>
<p>If the <tt class="tag-attribute">element</tt> attribute is
specified, it <span class="rfc2119">must</span> contain an XPath
expression which identifies a single element node (the input
connection for this expression is the same as the connection for
the <a href="#p.option"><tt class="tag-element">p:option</tt></a>
or <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> which contains it). The
in-scope namespaces of that node are used.</p>
<p>The expression is evaluated in the appropriate context, See
<a href="#xpath-context" title="XPaths in XProc">Section&#160;2.6,
“XPaths in XProc”</a>.</p>
<p><a name="err.inline.D0009" id="err.inline.D0009"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0009"><code class=
"errqname">err:XD0009</code></a>) if the <tt class=
"tag-attribute">element</tt> attribute on <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a> is
specified and it does not identify a single element node.</p>
</li>
<li>
<p>If neither <tt class="tag-attribute">binding</tt> nor <tt class=
"tag-attribute">element</tt> is specified, the in-scope namespaces
on the <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element itself are used.</p>
</li>
</ol>
</div>
<p>Irrespective of how the set of namespaces are determined, the
<tt class="tag-attribute">except-prefixes</tt> attribute can be
used to exclude one or more namespaces. The value of the
except-prefixes attribute <span class="rfc2119">must</span> be a
sequence of tokens, each of which <span class="rfc2119">must</span>
be a prefix bound to a namespace in the in-scope namespaces of the
<a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element. All bindings of
prefixes to each of the namespaces thus identified are excluded.
<a name="err.inline.S0051" id="err.inline.S0051"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0051"><code class=
"errqname">err:XS0051</code></a>) if the <tt class=
"tag-attribute">except-prefixes</tt> attribute on <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a> does
not contain a list of tokens or if any of those tokens is not a
prefix bound to a namespace in the in-scope namespaces of the
<a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element.</p>
<p><a name="err.inline.S0041" id="err.inline.S0041"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0041"><code class=
"errqname">err:XS0041</code></a>) to specify both <tt class=
"tag-attribute">binding</tt> and <tt class=
"tag-attribute">element</tt> on the same <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a>
element.</p>
<p>If a <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a>, <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> includes one or more <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a>
elements, then the union of all the namespaces specified on those
elements are used as the bindings for the variable, option or
parameter value. In this case, the in-scope namespaces on the
<a href="#p.variable"><tt class="tag-element">p:variable</tt></a>,
<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a> are
ignored. <a name="err.inline.D0013" id="err.inline.D0013"></a>It is
a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0013"><code class=
"errqname">err:XD0013</code></a>) if the specified namespace
bindings are inconsistent; that is, if the same prefix is bound to
two different namespace names.</p>
<p>For example, this would allow the preceding example to work:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline type="ex:delete-in-div"
version="1.0"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://example.org/ns/ex"
xmlns:h="http://www.w3.org/1999/xhtml"&gt;
&lt;p:option name="divchild" required="true"/&gt;
&lt;p:delete&gt;
&lt;p:with-option name="match" select="concat('h:div/',$divchild)"&gt;
&lt;p:namespaces xmlns:html="http://www.w3.org/1999/xhtml"/&gt;
&lt;/p:with-option&gt;
&lt;/p:delete&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>The <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element provides namespace
bindings for both of the prefixes necessary to correctly interpret
the expression ultimately passed to the <a href=
"#c.delete"><tt class="tag-element">p:delete</tt></a> step (the
binding for <tt class="literal">html:</tt> is explicitly provided
and the binding for <tt class="literal">h:</tt> is in-scope).</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The use of <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> here, when all of the bindings
are provided with explicit namespace declarations, is unnecessary.
The bindings could simply be placed on the parent <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a>
element. We use <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> here only to make the example
parallel to the one which follows.</p>
</div>
<p>The preceding solution has the weakness that it depends on
knowing the bindings that will be used by the caller. A more
flexible solution would use the <tt class=
"tag-attribute">binding</tt> attribute to copy the bindings from
the caller's option value.</p>
<div class="programlisting">
<pre>
&lt;p:pipeline type="ex:delete-in-div"
version="1.0"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://example.org/ns/ex"
xmlns:h="http://www.w3.org/1999/xhtml"&gt;
&lt;p:option name="divchild" required="true"/&gt;
&lt;p:delete&gt;
&lt;p:with-option name="match" select="concat('h:div/',$divchild)"&gt;
&lt;p:namespaces binding="divchild"/&gt;
&lt;p:namespaces xmlns:h="http://www.w3.org/1999/xhtml"/&gt;
&lt;/p:with-option&gt;
&lt;/p:delete&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>This example will succeed as long as the caller-specified option
does not bind the “<tt class="literal">h</tt>” prefix to something
other than the XHTML namespace.</p>
</div>
</div>
<div class="section">
<h4><a name="p.declare-step" id=
"p.declare-step"></a>5.8&#160;p:declare-step</h4>
<p>A <tt class="tag-element">p:declare-step</tt> provides the type
and <em class="glossterm"><a href=
"#dt-signature">signature</a></em> of an <em class=
"glossterm"><a href="#dt-atomic-step">atomic step</a></em> or
pipeline. It declares the inputs, outputs, and options for all
steps of that type.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:declare-step<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)?<br />
&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="tag-attribute">type</tt> can be from
any namespace provided that the expanded-QName of the value has a
non-null namespace URI. <a name="err.inline.S0025" id=
"err.inline.S0025"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0025"><code class="errqname">err:XS0025</code></a>) if the
expanded-QName value of the <tt class="tag-attribute">type</tt>
attribute is in no namespace or in the XProc namespace. Except as
described in <a href="#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>, the XProc namespace <span class="rfc2119">must
not</span> be used in the type of steps. Neither users nor
implementers may define additional steps in the XProc
namespace.</p>
<p>Irrespective of the context in which the <tt class=
"tag-element">p:declare-step</tt> occurs, there are initially no
option or variable names in-scope inside a <tt class=
"tag-element">p:declare-step</tt>. That is, <a href=
"#p.option"><tt class="tag-element">p:option</tt></a> and <a href=
"#p.variable"><tt class="tag-element">p:variable</tt></a> elements
can refer to values declared by their preceding siblings, but not
by any of their ancestors.</p>
<p><a name="impl-37" id="impl-37"></a>When a declared step is
evaluated directly by the XProc processor (as opposed to occurring
as an atomic step in some <em class="glossterm"><a href=
"#dt-container">container</a></em>), how the input and output ports
are connected to documents is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>A step declaration is not a <a href="#step-concept">step</a> in
its own right. Sibling steps cannot refer to the inputs or outputs
of a <tt class="tag-element">p:declare-step</tt> using <a href=
"#p.pipe"><tt class="tag-element">p:pipe</tt></a>; only instances
of the type can be referenced.</p>
<p>The <tt class="tag-attribute">version</tt> attribute identifies
the version of XProc for which this step declaration was authored.
If the <tt class="tag-element">p:declare-step</tt> has no ancestors
in the XProc namespace, then it <span class="rfc2119">must</span>
have a <tt class="tag-attribute">version</tt> attribute. See
<a href="#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>.</p>
<p>For a description of <tt class=
"tag-attribute">psvi-required</tt>, see <a href="#psvi-support"
title="PSVIs in XProc">Section&#160;2.8, “PSVIs in XProc”</a>. For
<tt class="tag-attribute">xpath-version</tt>, see <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>. For <tt class=
"tag-attribute">exclude-inline-prefixes</tt>, see <a href=
"#p.inline"><tt class="tag-element">p:inline</tt></a>.</p>
<div class="section">
<h5><a name="declare-atomic-steps" id=
"declare-atomic-steps"></a>5.8.1&#160;Declaring atomic steps</h5>
<p>When declaring an atomic step, the subpipeline in the
declaration <span class="rfc2119">must</span> be empty. And,
conversely, if the subpipeline in a declaration is empty, the
declaration <span class="rfc2119">must</span> be for an atomic
step.</p>
<p><a name="impl-38" id="impl-38"></a>Implementations may use
<em class="glossterm"><a href="#dt-extension-attribute">extension
attributes</a></em> to provide <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>
information about a declared step. For example, such an attribute
might identify the code which implements steps of this type.</p>
<p>It is not an error for a pipeline to include declarations for
steps that a particular processor does not know how to implement.
It is, of course, an error to attempt to evaluate such steps.</p>
<p>If <a href="#p.log"><tt class="tag-element">p:log</tt></a> or
<a href="#p.serialization"><tt class=
"tag-element">p:serialization</tt></a> elements appear in the
declaration of an atomic step, they will only be used if the atomic
step is directly evaluated by the processor. They have no effect if
the step appears in a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>; only the serialization
options of the “top level” step or pipeline are used because that
is the only step which the processor is required to serialize.</p>
</div>
<div class="section">
<h5><a name="declare-pipelines" id=
"declare-pipelines"></a>5.8.2&#160;Declaring pipelines</h5>
<p>When a <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> declares a pipeline, that
pipeline encapsulates the behavior of the specified <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>. Its
children declare inputs, outputs, and options that the pipeline
exposes and identify the steps in its subpipeline.</p>
<p><a name="impl-39" id="impl-39"></a>The subpipeline may include
declarations of additional steps (e.g., other pipelines or other
step types that are provided by a particular implementation or in
some <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> way)
and import other pipelines. If a pipeline has been imported, it may
be invoked as a step within the subpipeline that imported it.</p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> is the <em class=
"glossterm"><a href="#dt-empty-environment">empty
environment</a></em> with these modifications:</p>
<div class="itemizedlist">
<ul>
<li>
<p>All of the declared inputs are added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable ports</a></em> in
the environment.</p>
</li>
<li>
<p>If a <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em> is declared,
that port is the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>,
otherwise the default readable port is undefined.</p>
</li>
</ul>
</div>
<p>If a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em> is declared
and that port has no <em class="glossterm"><a href=
"#dt-connection">connection</a></em>, then it is connected to the
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em> of the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>.
<a name="err.inline.S0006.2" id="err.inline.S0006.2"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0006"><code class=
"errqname">err:XS0006</code></a>) if the primary output port is
unconnected and the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the subpipeline does not have
a primary output port.</p>
<p>The requested <tt class="tag-attribute">xpath-version</tt>
<span class="rfc2119">must</span> be used to evaluate XPath
expressions subject to the constraints outlined in <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>.</p>
<p>The <tt class="tag-attribute">psvi-required</tt> attribute
allows the author to declare that a step relies on the processor's
ability to pass PSVI annotations between steps, see <a href=
"#psvi-support" title="PSVIs in XProc">Section&#160;2.8, “PSVIs in
XProc”</a>. If the attribute is not specified, the value
<tt class="literal">false</tt>” is assumed.</p>
</div>
</div>
<div class="section">
<h4><a name="p.library" id="p.library"></a>5.9&#160;p:library</h4>
<p>A <tt class="tag-element">p:library</tt> is a collection of step
declarations and/or pipeline definitions.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:library<br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.import">p:import</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a>)*<br />
&lt;/p:library&gt;</code></p>
<p>The <tt class="tag-attribute">version</tt> attribute identifies
the version of XProc for which this library was authored. If the
<tt class="tag-element">p:library</tt> has no ancestors in the
XProc namespace, then it <span class="rfc2119">must</span> have a
<tt class="tag-attribute">version</tt> attribute. See <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>.</p>
<p>For a description of <tt class=
"tag-attribute">psvi-required</tt>, see <a href="#psvi-support"
title="PSVIs in XProc">Section&#160;2.8, “PSVIs in XProc”</a>; for
<tt class="tag-attribute">xpath-version</tt>, see <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>; for <tt class=
"tag-attribute">exclude-inline-prefixes</tt>, see <a href=
"#p.inline"><tt class="tag-element">p:inline</tt></a>.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The steps declared in a pipeline library are referred to by
their type. It is not an error to put a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> or
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> without a <tt class=
"tag-attribute">type</tt> in a <tt class=
"tag-element">p:library</tt>, but there is no standard mechanism
for instantiating it or referring to it. It is effectively
invisible.</p>
</div>
<p>Libraries can import pipelines and/or other libraries. See also
<a href="#handling-imports" title=
"Handling Circular and Re-entrant Library Imports (Non-Normative)">Appendix&#160;G,
<i>Handling Circular and Re-entrant Library Imports
(Non-Normative)</i></a>.</p>
</div>
<div class="section">
<h4><a name="p.import" id="p.import"></a>5.10&#160;p:import</h4>
<p>An <tt class="tag-element">p:import</tt> loads a pipeline or
pipeline library, making it available in the pipeline or library
which contains the <tt class="tag-element">p:import</tt>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:import<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p>An import statement loads the specified IRI and makes any
pipelines declared within it available to the current pipeline.</p>
<p><a name="err.inline.S0052" id="err.inline.S0052"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0052"><code class=
"errqname">err:XS0052</code></a>) if the URI of a <tt class=
"tag-element">p:import</tt> cannot be retrieved or if, once
retrieved, it does not point to a <a href="#p.library"><tt class=
"tag-element">p:library</tt></a>, <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
or <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>. <a name="err.inline.S0053" id=
"err.inline.S0053"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0053"><code class="errqname">err:XS0053</code></a>) to
import a single pipeline if that pipeline does not have a
<tt class="tag-attribute">type</tt>.</p>
<p>Attempts to retrieve the library identified by the URI value may
be redirected at the parser level (for example, in an entity
resolver) or below (at the protocol level, for example, via an HTTP
Location: header). In the absence of additional information outside
the scope of this specification within the resource, the base URI
of the library is always the URI of the actual resource returned.
In other words, it is the URI of the resource retrieved after all
redirection has occurred.</p>
<p>As imports are processed, a processor may encounter new
<tt class="tag-element">p:import</tt> elements whose library URI is
the same as one it has already processed in some other context.
This may happen as a consequence of resolving the URI. If the
actual base URI is the same as one that has already been processed,
the implementation must recognize it as the same library and should
not need to process the resource. Also, a duplicate, circular chain
of imports, or a re-entrant import is not an error and
implementations must take the necessary steps to avoid infinite
loops and/or incorrect notification of duplicate step definitions.
It is not an error for a library to import itself. An example of
such steps is listed in <a href="#handling-imports" title=
"Handling Circular and Re-entrant Library Imports (Non-Normative)">Appendix&#160;G,
<i>Handling Circular and Re-entrant Library Imports
(Non-Normative)</i></a>.</p>
<p>A library is considered the same library if the URI of the
resource retrieved is the same. If a pipeline or library author
uses two different URI values that resolve to the same resource,
they must not be considered the same imported library.</p>
</div>
<div class="section">
<h4><a name="p.pipe" id="p.pipe"></a>5.11&#160;p:pipe</h4>
<p>A <tt class="tag-element">p:pipe</tt> connects an input to a
port on another step.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipe<br />
&#160;&#160;<strong>step</strong> = <var>NCName</var><br />
&#160;&#160;<strong>port</strong> =
<var>NCName</var>&#160;/&gt;</code></p>
<p>The <tt class="tag-element">p:pipe</tt> element connects to a
readable port of another step. It identifies the readable port to
which it connects with the name of the step in the <tt class=
"tag-attribute">step</tt> attribute and the name of the port on
that step in the <tt class="tag-attribute">port</tt> attribute.</p>
<p><a name="err.inline.S0022" id="err.inline.S0022"></a>In all
cases except the <a href="#p.output"><tt class=
"tag-element">p:output</tt></a> of a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>, it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0022"><code class=
"errqname">err:XS0022</code></a>) if the port identified by a
<tt class="tag-element">p:pipe</tt> is not in the <em class=
"glossterm"><a href="#dt-readable-ports">readable ports</a></em> of
the step that contains the <tt class="tag-element">p:pipe</tt>.</p>
<p>A <tt class="tag-element">p:pipe</tt> that is a <em class=
"glossterm"><a href="#dt-connection">connection</a></em> for an
<a href="#p.output"><tt class="tag-element">p:output</tt></a> of a
<em class="glossterm"><a href="#dt-compound-step">compound
step</a></em> may connect to one of the readable ports of the
compound step or to an output port on one of the compound step's
<em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em>. In other words, the output of a compound step can
simply be a copy of one of the available inputs or it can be the
output of one of its children.</p>
</div>
<div class="section">
<h4><a name="p.inline" id="p.inline"></a>5.12&#160;p:inline</h4>
<p>A <tt class="tag-element">p:inline</tt> provides a document
inline.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:inline<br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix
list</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var><br />
&lt;/p:inline&gt;</code></p>
<p>The content of the <tt class="tag-element">p:inline</tt> element
is wrapped in a document node and passed as input. The base URI of
the document is the base URI of the <tt class=
"tag-element">p:inline</tt> element. <a name="err.inline.S0024" id=
"err.inline.S0024"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0024"><code class="errqname">err:XS0024</code></a>) if the
content of the <tt class="tag-element">p:inline</tt> element does
not consist of exactly one element, optionally preceded and/or
followed by any number of processing instructions, comments or
whitespace characters.</p>
<p>The in-scope namespaces of the inline document differ from the
in-scope namespace of the content of the <tt class=
"tag-element">p:inline</tt> element in that bindings for all its
<em>excluded namespaces</em>, as defined below, are removed:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The XProc namespace itself (<tt class=
"uri">http://www.w3.org/ns/xproc</tt>) is excluded.</p>
</li>
<li>
<p>A namespace URI designated by using an <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute on the
enclosing <tt class="tag-element">p:inline</tt> is excluded.</p>
</li>
<li>
<p>A namespace URI designated by using an <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute on any
ancestor <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>, or
<a href="#p.library"><tt class="tag-element">p:library</tt></a> is
also excluded. (In other words, the effect of several <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attributes among the
ancestors of <tt class="tag-element">p:inline</tt> is
cumulative.)</p>
</li>
</ul>
</div>
<p>The value of each <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute is
interpreted as follows:</p>
<p>The value of the attribute is either <tt class=
"literal">#all</tt>, or a whitespace-separated list of tokens, each
of which is either a namespace prefix or <tt class=
"literal">#default</tt>. The namespace bound to each of the
prefixes is designated as an excluded namespace. <a name=
"err.inline.S0057" id="err.inline.S0057"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0057"><code class=
"errqname">err:XS0057</code></a>) if the <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute does not
contain a list of tokens or if any of those tokens (except
<tt class="literal">#all</tt> or <tt class="literal">#default</tt>)
is not a prefix bound to a namespace in the in-scope namespaces of
the element on which it occurs.</p>
<p>The default namespace of the element on which <tt class=
"tag-attribute">exclude-inline-prefixes</tt> occurs may be
designated as an excluded namespace by including <tt class=
"literal">#default</tt> in the list of namespace prefixes. <a name=
"err.inline.S0058" id="err.inline.S0058"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0058"><code class=
"errqname">err:XS0058</code></a>) if the value <tt class=
"literal">#default</tt> is used within the <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute and there is
no default namespace in scope.</p>
<p>The value <tt class="literal">#all</tt> indicates that all
namespaces that are in scope for the element on which <tt class=
"tag-attribute">exclude-inline-prefixes</tt> occurs are designated
as excluded namespaces.</p>
<p>The XProc processor <span class="rfc2119">must</span> include
all in-scope prefixes that are not explicitly excluded. If the
namespace associated with an excluded prefix is used in the
expanded-QName of a descendant element or attribute, the processor
<span class="rfc2119">may</span> include that prefix anyway, or it
may generate a new prefix.</p>
<p>Consider this example:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:output port="result"/&gt;
&lt;p:serialization port="result" indent="true"/&gt;
&lt;p:identity xmlns:a="http://example.com/a"
xmlns:b="http://example.com/b"
xmlns:c="http://example.com/c"&gt;
&lt;p:input port="source"&gt;
&lt;p:inline exclude-inline-prefixes="a b"&gt;
&lt;doc&gt;
&lt;b:part/&gt;
&lt;/doc&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:identity&gt;
&lt;/p:declare-step&gt;
</pre></div>
<p>which might produce a result like this:</p>
<div class="programlisting">
<pre>
&lt;doc xmlns:c="http://example.com/c"&gt;
&lt;b:part xmlns:b="http://example.com/b"/&gt;
&lt;/doc&gt;
</pre></div>
<p>The declaration for “<tt class="literal">c</tt>” must be present
because it was not excluded. The “<tt class="literal">part</tt>
element uses the namespace bound to “<tt class="literal">b</tt>”,
so <em>some</em> binding must be present. In this example, the
original prefix has been preserved, but it would be equally correct
if a different prefix had been used.</p>
</div>
<div class="section">
<h4><a name="p.document" id=
"p.document"></a>5.13&#160;p:document</h4>
<p>A <tt class="tag-element">p:document</tt> reads an XML document
from a URI.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:document<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p>The document identified by the URI in the <tt class=
"tag-attribute">href</tt> attribute is loaded and returned. If the
URI protocol supports redirection, then redirects <span class=
"rfc2119">must</span> be followed.</p>
<p><a name="err.inline.D0011" id="err.inline.D0011"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0011"><code class=
"errqname">err:XD0011</code></a>) if the resource referenced by a
<tt class="tag-element">p:document</tt> element does not exist,
cannot be accessed, or is not a well-formed XML document.</p>
<p>The parser which the <tt class="tag-element">p:document</tt>
element employs <span class="rfc2119">must</span> process the
external subset; all general and external parsed entities
<span class="rfc2119">must</span> be fully expanded. It
<span class="rfc2119">may</span> perform <tt class=
"tag-attribute">xml:id</tt> processing, but it <span class=
"rfc2119">must not</span> perform any other processing, such as
expanding XIncludes. The parser <span class="rfc2119">must</span>
be conformant to <em class="citetitle">Namespaces in XML</em>.
Loading the document <span class="rfc2119">must not</span> fail due
to validation errors.</p>
<p>Use the <a href="#c.load"><tt class=
"tag-element">p:load</tt></a> step if you need to perform DTD-based
validation.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>A <tt class="tag-element">p:document</tt> always <em>reads</em>
from the specified IRI. In the context of a <a href=
"#p.input"><tt class="tag-element">p:input</tt></a>, this seems
perfectly natural. In the context of a <a href=
"#p.output"><tt class="tag-element">p:output</tt></a>, this may
seem a little asymmetrical. Putting a <tt class=
"tag-element">p:document</tt> in a <a href="#p.output"><tt class=
"tag-element">p:output</tt></a> causes the pipeline to
<em>read</em> from the specified IRI and provide that document
<em>as an output</em> on that port.</p>
<p>Use <a href="#c.store"><tt class="tag-element">p:store</tt></a>
to store the results that appear on a <a href=
"#p.output"><tt class="tag-element">p:output</tt></a>.</p>
</div>
</div>
<div class="section">
<h4><a name="p.data" id="p.data"></a>5.14&#160;p:data</h4>
<p>A <tt class="tag-element">p:data</tt> reads an arbitrary
resource from a URI.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:data<br />
&#160;&#160;<strong>href</strong> = <var>anyURI</var><br />
&#160;&#160;wrapper? = <var>QName</var><br />
&#160;&#160;wrapper-prefix? = <var>string</var><br />
&#160;&#160;wrapper-namespace? = <var>string</var><br />
&#160;&#160;content-type? = <var>string</var>&#160;/&gt;</code></p>
<p>The resource identified by the URI in the <tt class=
"tag-attribute">href</tt> attribute is loaded, encoded, wrapped in
the wrapper element, and returned as a document. If the URI
protocol supports redirection, then redirects <span class=
"rfc2119">must</span> be followed.</p>
<p>The value of the <tt class="tag-attribute">wrapper</tt>
attribute <span class="rfc2119">must</span> be a <tt class=
"type">QName</tt>. If the lexical value does not contain a colon,
then the <tt class="tag-attribute">wrapper-namespace</tt> may be
used to specify the namespace of the wrapper. In that case, the
<tt class="tag-attribute">wrapper-prefix</tt> may be specified to
suggest a prefix for the wrapper element. <a name=
"err.inline.D0034" id="err.inline.D0034"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0034"><code class=
"errqname">err:XD0034</code></a>) to specify a new namespace or
prefix if the lexical value of the specified name contains a colon
(or if no <tt class="tag-attribute">wrapper</tt> is explicitly
specified).</p>
<p>In other words, these two <tt class="tag-element">p:data</tt>
elements produce equivalent wrappers:</p>
<div class="programlisting">
<pre>
&lt;p:data href="..."
xmlns:x="http://example.com/ns/"
wrapper="x:wrap"/&gt;
&lt;p:data href="..."
wrapper="wrap" wrapper-prefix="x"
wrapper-namespace="http://example.com/ns/"/&gt;
</pre></div>
<p>but this <tt class="tag-element">p:data</tt> element will raise
an error:</p>
<div class="programlisting">
<pre>
&lt;p:data href="..."
xmlns:x="http://example.com/ns/"
wrapper="x:wrap" wrapper-prefix="x"
wrapper-namespace="http://example.com/ns/"/&gt;
</pre></div>
<p>If no wrapper element is specified, the default is <tt class=
"tag-element">c:data</tt>:</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:data<br />
&#160;&#160;content-type? = <var>string</var><br />
&#160;&#160;charset? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:data&gt;</code></p>
<p><a name="err.inline.D0029" id="err.inline.D0029"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0029"><code class=
"errqname">err:XD0029</code></a>) if the document referenced by a
<tt class="tag-element">p:data</tt> element does not exist, cannot
be accessed, or cannot be encoded as specified.</p>
<p>Exactly how the data is encoded depends on the media type of the
resource. If the resource has a content type associated with it
(e.g., if the resource was retrieved with HTTP), then that content
type <span class="rfc2119">must</span> be used, otherwise, if the
user specified a <tt class="tag-attribute">content-type</tt> on the
<tt class="tag-element">p:data</tt>, then that content type should
be assumed. <a name="impl-40" id="impl-40"></a>If no content type
was specified or is associated with the resource, the inferred
content type is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the media type of the response is an XML media type or text
type with a <tt class="literal">charset</tt> parameter that is a
Unicode character encoding (per [<a href=
"#unicodetr17"><span class="abbrev">Unicode TR#17</span></a>]) or
is recognized as a non-XML media type whose contents are encoded as
a sequence of Unicode characters (e.g. it has a <tt class=
"literal">charset</tt> parameter or the definition of the media
type is such that it requires Unicode), the data <span class=
"rfc2119">must</span> be encoded as Unicode character sequence.</p>
</li>
<li>
<p>If the media type is not an appropriate text type, or if the
processor does not recognize the media type, the content is
base64-encoded.</p>
</li>
</ul>
</div>
<p>The resulting data is wrapped in an element with the name
specified in the <tt class="tag-attribute">wrapper</tt> attribute
(or <tt class="tag-element">c:data</tt> if no <tt class=
"tag-attribute">wrapper</tt> is specified).</p>
<p>Implementations <span class="rfc2119">should</span> add a
<tt class="tag-attribute">content-type</tt> attribute to the
wrapper element which indicates the specified or inferred media
type of the resource (including any parameters). If the content was
base64-encoded, the wrapper <span class="rfc2119">must</span> have
an <tt class="tag-attribute">encoding</tt> attribute which
specifies “<tt class="literal">base64</tt>”.</p>
<p>If an <tt class="tag-attribute">encoding</tt> is specified, a
<tt class="tag-attribute">charset</tt> may also be specified. The
character set may be specified as a parameter on the <tt class=
"tag-attribute">content-type</tt> or via the separate <tt class=
"tag-attribute">charset</tt> option. If it is specified in both
places, the values <span class="rfc2119">must</span> be
consistent.</p>
<p>If <tt class="tag-attribute">content-type</tt>, <tt class=
"tag-attribute">encoding</tt>, or <tt class=
"tag-attribute">charset</tt> attributes are specified on a
<tt class="tag-element">c:data</tt> wrapper, they <span class=
"rfc2119">must not</span> be in a namespace; if the user-specified
wrapper is not <tt class="tag-element">c:data</tt>, then the
attributes <span class="rfc2119">must</span> be in the <tt class=
"uri">http://www.w3.org/ns/xproc-step</tt> namespace.</p>
<p>Implementations may record additional details in <a href=
"#extension-attributes">extension attributes</a>.</p>
<p>For example, this <a href="#c.identity"><tt class=
"tag-element">p:identity</tt></a> step:</p>
<div class="programlisting">
<pre>
&lt;p:identity name="readcsv"&gt;
&lt;p:input port="source"&gt;
&lt;p:data href="stateabbr.csv"/&gt;
&lt;/p:input&gt;
&lt;/p:identity&gt;
</pre></div>
<p>might produce output like this:</p>
<div class="programlisting">
<pre>
&lt;c:data xmlns:c="http://www.w3.org/2007/03/xproc-step"
content-type="text/plain"&gt;
AL,Alabama
AK,Alaska
AZ,Arizona
&lt;/c:data&gt;
</pre></div>
<p>Whereas this pipeline fragment:</p>
<div class="programlisting">
<pre>
&lt;p:identity name="readpng"&gt;
&lt;p:input port="source"&gt;
&lt;p:data href="icon.png" content-type="image/png"/&gt;
&lt;/p:input&gt;
&lt;/p:identity&gt;
&lt;p:add-attribute name="makeimg" match="img" attribute-name="src"&gt;
&lt;p:input port="source"&gt;&lt;p:inline&gt;&lt;img/&gt;&lt;/p:inline&gt;&lt;/p:input&gt;
&lt;p:with-option name="attribute-value"
select="concat('data:image/png;base64,',/*/node())"&gt;
&lt;p:pipe step="readpng" port="result"/&gt;
&lt;/p:with-option&gt;
&lt;/p:add-attribute&gt;
</pre></div>
<p>produces a single <tt class="tag-element">img</tt> element with
an inline graphic (represented using a <tt class=
"literal">data:</tt> URI):</p>
<div class="programlisting">
<pre>
&lt;img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QsEDycHOWjhgQAAAB10RVh0Q29tbWVudABDcmVhdGVk
IHdpdGggVGhlIEdJTVDvZCVuAAABjklEQVQ4y42Tv0tbcRTFz3t5kuQFwUVFEYIGU6q4mU0RlCDR
qYO2g4gdghUyKSFDwD/AwS2IoIMSHOLgpOLg4CIOWdy76GBoqQUJLlr66aCW6LuoF+7wvefcc3/w
vZLgpbe0wOoqn/Ro5TKRVIpLi6tkkpoFpFJUj48JSVI2y4LnBTm+D1paYqa5OQiGw5DN8nV7m1hv
L99f4o4Dk5Mc6Pwcd2yMXauL/n5+FAqsWdXjca5LJbokSXt7fOzu5toSaWsLxpqaIJcjr0ZbXGQh
HDaWZPjQEGc7O3jPBC4u8EZHOXkruaODPxsbDMuylRWSra3cviYwO0upMcdtfNRqGq/X5esVu7nR
BxMol4knEtTfGsH3+bu8zLdnydUqXjrN/nsWKEEiwdXmJp3/BYpFctFokOi6EIsF444DU1McSZLW
1+nq6eGnVWlkhNrcHBXXNUe5z+f5rEyGA8cxD+pufp7BYtH+yhL09fFbkYjd4vQ0W08jFgp8se7l
wY3gwAC/KhXanwROTwlNTHBocf8BTQe7F9dc2bMAAAAASUVORK5CYII="/&gt;
</pre></div>
<p>Some steps, such as <a href="#c.xquery"><tt class=
"tag-element">p:xquery</tt></a> and <a href=
"#c.validate-with-relax-ng"><tt class=
"tag-element">p:validate-with-relax-ng</tt></a>, are designed to
process non-XML inputs. If a base64-encoded input occurs in such a
context, it <span class="rfc2119">should</span> be decoded before
processing. In this way, for example, an XQuery document can be
read with <tt class="tag-element">p:data</tt> and passed to the
<a href="#c.xquery"><tt class="tag-element">p:xquery</tt></a> step
without regard to how the data was encoded.</p>
</div>
<div class="section">
<h4><a name="p.empty" id="p.empty"></a>5.15&#160;p:empty</h4>
<p>A <tt class="tag-element">p:empty</tt> connects to an <em class=
"glossterm"><a href="#dt-empty-sequence">empty sequence</a></em> of
documents.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:empty&#160;/&gt;</code></p>
</div>
<div class="section">
<h4><a name="p.documentation" id=
"p.documentation"></a>5.16&#160;p:documentation</h4>
<p>A <tt class="tag-element">p:documentation</tt> contains
human-readable documentation.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:documentation&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:documentation&gt;</code></p>
<p>There are no constraints on the content of the <tt class=
"tag-element">p:documentation</tt> element. Documentation is
ignored by pipeline processors. See <a href="#documentation" title=
"Documentation">Section&#160;3.6, “Documentation”</a>.</p>
</div>
<div class="section">
<h4><a name="p.pipeinfo" id=
"p.pipeinfo"></a>5.17&#160;p:pipeinfo</h4>
<p>A <tt class="tag-element">p:pipeinfo</tt> contains ancillary
information for steps in the pipeline.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeinfo&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:pipeinfo&gt;</code></p>
<p>There are no constraints on the content of the <tt class=
"tag-element">p:pipeinfo</tt> element, see <a href="#annotations"
title="Processor annotations">Section&#160;3.7, “Processor
annotations”</a>.</p>
</div>
</div>
<div class="section">
<h3><a name="errors" id="errors"></a>6&#160;Errors</h3>
<p>Errors in a pipeline can be divided into two classes: static
errors and dynamic errors.</p>
<div class="section">
<h4><a name="static-errors" id="static-errors"></a>6.1&#160;Static
Errors</h4>
<p><span class="termdef" id="dt-static-error">[Definition: A
<em class="glossterm">static error</em> is one which can be
detected before pipeline evaluation is even attempted.]</span>
Examples of static errors include cycles and incorrect
specification of inputs and outputs.</p>
<p>Static errors are fatal and must be detected before any steps
are evaluated.</p>
<p>For a complete list of static errors, see <a href=
"#app.static-errors" title="Static Errors">Section&#160;E.1,
“Static Errors”</a>.</p>
</div>
<div class="section">
<h4><a name="dynamic-errors" id=
"dynamic-errors"></a>6.2&#160;Dynamic Errors</h4>
<p>A <span class="termdef" id="dt-dynamic-error">[Definition: A
<em class="glossterm">dynamic error</em> is one which occurs while
a pipeline is being evaluated.]</span> Examples of dynamic errors
include references to URIs that cannot be resolved, steps which
fail, and pipelines that exhaust the capacity of an implementation
(such as memory or disk space).</p>
<p>If a step fails due to a dynamic error, failure propagates
upwards until either a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a> is encountered or the entire pipeline
fails. In other words, outside of a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>, step failure causes the entire
pipeline to fail.</p>
<p>For a complete list of dynamic errors, see <a href=
"#app.dynamic-errors" title="Dynamic Errors">Section&#160;E.2,
“Dynamic Errors”</a>.</p>
</div>
<div class="section">
<h4><a name="step-errors" id="step-errors"></a>6.3&#160;Step
Errors</h4>
<p>Several of the steps in the standard and option step library can
generate dynamic errors.</p>
<p>For a complete list of the dynamic errors raised by builtin
pipeline steps, see <a href="#app.step-errors" title=
"Step Errors">Section&#160;E.3, “Step Errors”</a>.</p>
</div>
</div>
<div class="section">
<h3><a name="std-components" id=
"std-components"></a>7&#160;Standard Step Library</h3>
<p>This section describes the standard XProc steps. A
machine-readable description of these steps may be found in
<a href="http://www.w3.org/2008/xproc-1.0.xpl">xproc-1.0.xpl</a>.</p>
<p>When a step in this library produces an output document, the
base URI of the output is the base URI of the step's primary input
document unless the step's process explicitly sets an <tt class=
"tag-attribute">xml:base</tt> attribute or the step's description
explicitly states how the base URI is constructed.</p>
<p id="cv.result">Also, in this section, several steps use this
element for result information:</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:result&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:result&gt;</code></p>
<p>When a step uses an XPath to compute an option value, the XPath
context is as defined in <a href="#xpath-context" title=
"XPaths in XProc">Section&#160;2.6, “XPaths in XProc”</a>.</p>
<p>When a step specifies a particular version of a technology,
implementations <span class="rfc2119">must</span> implement that
version or a subsequent version that is backwards compatible with
that version. At user-option, they may implement other
non-backwards compatible versions.</p>
<div class="section">
<h4><a name="std-required" id="std-required"></a>7.1&#160;Required
Steps</h4>
<p>This section describes standard steps that must be supported by
any conforming processor.</p>
<div class="section">
<h5><a name="c.add-attribute" id=
"c.add-attribute"></a>7.1.1&#160;p:add-attribute</h5>
<p>The <tt class="code">p:add-attribute</tt> step adds a single
attribute to a set of matching elements. The input document
specified on the <tt class="code">source</tt> is processed for
matches specified by the match pattern in the <tt class=
"option">match</tt> option. For each of these matches, the
attribute whose name is specified by the <tt class=
"option">attribute-name</tt> option is set to the attribute value
specified by the <tt class="option">attribute-value</tt>
option.</p>
<p>The resulting document is produced on the <tt class=
"code">result</tt> output port and consists of a exact copy of the
input with the exception of the matched elements. Each of the
matched elements is copied to the output with the addition of the
specified attribute with the specified value.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-attribute</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-value</code><code>"</code>
<code class="attr required-attr">required</code><code>="</code><code class="value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.1" id="err.inline.C0023.1"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if the match pattern does not
match an element.</p>
<p>The value of the <tt class="option">attribute-name</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">attribute-namespace</tt> may be used to specify the
namespace of the attribute. In that case, the <tt class=
"tag-attribute">attribute-prefix</tt> may be specified to suggest a
prefix for the attribute name. <a name="err.inline.D0034.1" id=
"err.inline.D0034.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon. The corresponding expanded name is
used to construct the attribute.</p>
<p>The value of the <tt class="option">attribute-value</tt> option
<span class="rfc2119">must</span> be a legal attribute value
according to XML.</p>
<p>If an attribute with the same name as the expanded name from the
<tt class="option">attribute-name</tt> option exists on the matched
element, the value specified in the <tt class=
"option">attribute-value</tt> option is used to set the value of
that existing attribute. That is, the value of the existing
attribute is changed to the <tt class="option">attribute-value</tt>
value.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>If multiple attributes need to be set on the same element(s),
the <a href="#c.set-attributes"><tt class=
"tag-element">p:set-attributes</tt></a> step can be used to set
them all at once.</p>
</div>
<p>This step cannot be used to add namespace declarations. <a name=
"err.inline.C0059" id="err.inline.C0059"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0059"><code class=
"errqname">err:XC0059</code></a>) if the QName value in the
<tt class="option">attribute-name</tt> option uses the prefix
<tt class="literal">xmlns</tt>” or any other prefix that resolves
to the namespace name “<tt class=
"uri">http://www.w3.org/2000/xmlns/</tt>”. Note, however, that
while namespace declarations cannot be added explicitly by this
step, adding an attribute whose name is in a namespace for which
there is no namespace declaration in scope on the matched element
may result in a namespace binding being added by <a href=
"#namespace-fixup" title=
"Namespace Fixup on Outputs">Section&#160;2.4.1, “Namespace Fixup
on Outputs”</a>.</p>
<p>If an attribute named <tt class="tag-attribute">xml:base</tt> is
added or changed, the base URI of the element <span class=
"rfc2119">must</span> also be amended accordingly.</p>
</div>
<div class="section">
<h5><a name="c.add-xml-base" id=
"c.add-xml-base"></a>7.1.2&#160;p:add-xml-base</h5>
<p>The <tt class="code">p:add-xml-base</tt> step exposes the base
URI via explicit <tt class="code">xml:base</tt> attributes. The
input document from the <tt class="port">source</tt> port is
replicated to the <tt class="port">result</tt> port with <tt class=
"code">xml:base</tt> attributes added to or corrected on each
element as specified by the options on this step.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-xml-base</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">all</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">relative</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">all</tt> option <span class=
"rfc2119">must</span> be a boolean.</p>
<p>The value of the <tt class="option">relative</tt> option
<span class="rfc2119">must</span> be a boolean.</p>
<p><a name="err.inline.C0058" id="err.inline.C0058"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0058"><code class=
"errqname">err:XC0058</code></a>) if the <tt class=
"option">all</tt> and <tt class="option">relative</tt> options are
<em>both</em> <tt class="literal">true</tt>.</p>
<p>The <tt class="tag-element">p:add-xml-base</tt> step modifies
its input as follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p>For the document element: force the element to have an
<tt class="tag-attribute">xml:base</tt> attribute with the
document's [base URI] property's value as its value.</p>
</li>
<li>
<p>For other elements:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the <tt class="option">all</tt> option has the value
<tt class="literal">true</tt>, force the element to have an
<tt class="tag-attribute">xml:base</tt> attribute with the
element's [base URI] value as its value.</p>
</li>
<li>
<p>If the element's [base URI] is different from the its parent's
[base URI], force the element to have an <tt class=
"tag-attribute">xml:base</tt> attribute with the following value:
if the value of the <tt class="option">relative</tt> option is
<tt class="literal">true</tt>, a string which, when resolved
against the parent's [base URI], will give the element's [base
URI], otherwise the element's [base URI].</p>
</li>
<li>
<p>Otherwise, if there is an <tt class=
"tag-attribute">xml:base</tt> attribute present, remove it.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<div class="section">
<h5><a name="c.compare" id=
"c.compare"></a>7.1.3&#160;p:compare</h5>
<p>The <tt class="code">p:compare</tt> step compares two documents
for equality.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:compare</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fail-if-not-equal</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">fail-if-not-equal</tt>
option <span class="rfc2119">must</span> be a boolean.</p>
<p>This step takes single documents on each of two ports and
compares them using the <tt class="function">fn:deep-equal</tt> (as
defined in [<a href="#xpath-functions"><span class="abbrev">XPath
2.0 Functions and Operators</span></a>]). <a name=
"err.inline.C0019" id="err.inline.C0019"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0019"><code class=
"errqname">err:XC0019</code></a>) if the documents are not equal,
and the value of the <tt class="option">fail-if-not-equal</tt>
option is <tt class="literal">true</tt>. If the documents are
equal, or if the value of the <tt class=
"option">fail-if-not-equal</tt> option is <tt class=
"literal">false</tt>, a <a href="#cv.result"><tt class=
"tag-element">c:result</tt></a> document is produced with contents
<tt class="literal">true</tt> if the documents are equal, otherwise
<tt class="literal">false</tt>.</p>
</div>
<div class="section">
<h5><a name="c.count" id="c.count"></a>7.1.4&#160;p:count</h5>
<p>The <tt class="code">p:count</tt> step counts the number of
documents in the <tt class="code">source</tt> input sequence and
returns a single document on <tt class="code">result</tt>
containing that number. The generated document contains a single
<a href="#cv.result"><tt class="tag-element">c:result</tt></a>
element whose contents is the string representation of the number
of documents in the sequence.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:count</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">limit</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">0</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>If the <tt class="tag-attribute">limit</tt> option is specified
and is greater than zero, the <tt class="tag-element">p:count</tt>
step will count at most that many documents. This provides a
convenient mechanism to discover, for example, if a sequence
consists of more than 1 document, without requiring every single
document to be buffered before processing can continue.</p>
</div>
<div class="section">
<h5><a name="c.delete" id="c.delete"></a>7.1.5&#160;p:delete</h5>
<p>The <tt class="code">p:delete</tt> step deletes items specified
by a match pattern from the <tt class="code">source</tt> input
document and produces the resulting document, with the deleted
items removed, on the <tt class="port">result</tt> port.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:delete</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. A match
pattern may match multiple items to be deleted.</p>
<p>If an element is selected by the <tt class="option">match</tt>
option, the entire subtree rooted at that element is deleted.</p>
<p>This step cannot be used to remove namespaces. <a name=
"err.inline.C0062" id="err.inline.C0062"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0062"><code class=
"errqname">err:XC0062</code></a>) if the <tt class=
"option">match</tt> option matches a namespace node. Also, note
that deleting an attribute named <tt class=
"tag-attribute">xml:base</tt> does not change the base URI of the
element on which it occurred.</p>
</div>
<div class="section">
<h5><a name="c.directory-list" id=
"c.directory-list"></a>7.1.6&#160;p:directory-list</h5>
<p>The <tt class="code">p:directory-list</tt> step produces a list
of the contents of a specified directory.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:directory-list</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">exclude-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">path</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It is interpreted as an IRI reference. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:directory-list</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p><a name="err.inline.C0017" id="err.inline.C0017"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0017"><code class=
"errqname">err:XC0017</code></a>) if the absolute path does not
identify a directory. <a name="err.inline.C0012" id=
"err.inline.C0012"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0012"><code class="errqname">err:XC0012</code></a>) if the
contents of the directory path are not available to the step due to
access restrictions in the environment in which the pipeline is
run.</p>
<p><a name="impl-41" id="impl-41"></a>Conformant processors
<span class="rfc2119">must</span> support directory paths whose
scheme is <tt class="code">file</tt>. It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
other schemes are supported by <tt class=
"tag-element">p:directory-list</tt>, and what the interpretation of
'directory', 'file' and 'contents' is for those schemes.</p>
<p>If present, the value of the <tt class=
"option">include-filter</tt> or <tt class=
"option">exclude-filter</tt> option <span class=
"rfc2119">must</span> be a regular expression as specified in
[<a href="#xpath-functions"><span class="abbrev">XPath 2.0
Functions and Operators</span></a>], section 7.61 “<tt class=
"literal">Regular Expression Syntax</tt>”.</p>
<p>If the <tt class="option">include-filter</tt> pattern matches a
directory entry's name, the entry is included in the output. If the
<tt class="option">exclude-filter</tt> pattern matches a directory
entry's name, the entry is excluded in the output. If both options
are provided, the include filter is processed first, then the
exclude filter.</p>
<p id="cv.directory">The result document produced for the specified
directory path has a <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a> document element whose base URI
is the directory path and whose <tt class="tag-attribute">name</tt>
attribute is the last segment of the directory path (that is, the
directory's (local) name).</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:directory<br />
&#160;&#160;<strong>name</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.file">c:file</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.directory">c:directory</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.other">c:other</a>)*<br />
&lt;/c:directory&gt;</code></p>
<p>Its contents are determined as follows, based on the entries in
the directory identified by the directory path. For each entry in
the directory, if either no <tt class="option">filter</tt> was
specified, or the (local) name of the entry matches the filter
pattern, a <a href="#cv.file"><tt class=
"tag-element">c:file</tt></a>, a <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a>, or a <a href=
"#cv.other"><tt class="tag-element">c:other</tt></a> element is
produced, as follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p>A <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a> is produced for each
subdirectory not determined to be special.</p>
</li>
<li>
<p id="cv.file">A <a href="#cv.file"><tt class=
"tag-element">c:file</tt></a> is produced for each file not
determined to be special.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:file<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
</li>
<li>
<p id="cv.other"><a name="impl-42" id="impl-42"></a>Any file or
directory determined to be special by the <tt class=
"tag-element">p:directory-list</tt> step may be output using a
<a href="#cv.other"><tt class="tag-element">c:other</tt></a>
element but the criteria for marking a file as special are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:other<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
</li>
</ul>
</div>
<p>When a directory entry is a subdirectory, that directory's
entries are not output as part of that entry's <a href=
"#cv.directory"><tt class="tag-element">c:directory</tt></a>. A
user must apply this step again to the subdirectory to list
subdirectory contents.</p>
<p>Each of the elements <a href="#cv.file"><tt class=
"tag-element">c:file</tt></a>, <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a>, and <a href=
"#cv.other"><tt class="tag-element">c:other</tt></a> has a
<tt class="code">name</tt> attribute when it appears within the
top-level <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a> element, whose value is a
relative IRI reference, giving the (local) file or directory
name.</p>
<p><a name="impl-43" id="impl-43"></a>Any attributes other than
<tt class="tag-attribute">name</tt> on <a href=
"#cv.file"><tt class="tag-element">c:file</tt></a>, <a href=
"#cv.directory"><tt class="tag-element">c:directory</tt></a>, or
<a href="#cv.other"><tt class="tag-element">c:other</tt></a> are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.error" id="c.error"></a>7.1.7&#160;p:error</h5>
<p>The <tt class="code">p:error</tt> step generates a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic error</a></em>
using the input provided to the step.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:error</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">code</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">code-namespace</tt> may be used to specify the
namespace of the code. In that case, the <tt class=
"tag-attribute">code-prefix</tt> may be specified to suggest a
prefix for the code. <a name="err.inline.D0034.2" id=
"err.inline.D0034.2"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>This step uses the document provided on its input as the content
of the error raised. An instance of the <a href=
"#cv.errors"><tt class="tag-element">c:errors</tt></a> element will
be produced on the error output port, as is always the case for
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
errors</a></em>. The error generated can be caught by a <a href=
"#p.try"><tt class="tag-element">p:try</tt></a> just like any other
dynamic error.</p>
<p>For authoring convenience, the <tt class=
"tag-element">p:error</tt> step is declared with a single, primary
output port. With respect to <em class="glossterm"><a href=
"#dt-connection">connections</a></em>, this port behaves like any
other output port even though nothing can ever appear on it since
the step always fails.</p>
<p>For example, given the following invocation:</p>
<div class="programlisting">
<pre>
&lt;p:error xmlns:my="http://www.example.org/error"
name="bad-document" code="my:unk12"&gt;
&lt;p:input port="source"&gt;
&lt;p:inline&gt;
&lt;message&gt;The document element is unknown.&lt;/message&gt;
&lt;/p:inline&gt;
&lt;/p:input&gt;
&lt;/p:error&gt;
</pre></div>
<p>The error vocabulary element (and document) generated on the
error output port would be:</p>
<div class="programlisting">
<pre>
&lt;c:errors xmlns:c="http://www.w3.org/ns/xproc-step"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:my="http://www.example.org/error"&gt;
&lt;c:error name="bad-document" type="p:error"
code="my:unk12"&gt;&lt;message&gt;The document element is unknown.&lt;/message&gt;
&lt;/c:error&gt;
&lt;/c:errors&gt;
</pre></div>
<p>The <tt class="tag-attribute">href</tt>, <tt class=
"tag-attribute">line</tt> and <tt class=
"tag-attribute">column</tt>, or <tt class=
"tag-attribute">offset</tt>, might also be present on the <a href=
"#cv.error"><tt class="tag-element">c:error</tt></a> to identify
the location of the <tt class="tag-element">p:error</tt> element in
the pipeline.</p>
</div>
<div class="section">
<h5><a name="c.escape-markup" id=
"c.escape-markup"></a>7.1.8&#160;p:escape-markup</h5>
<p>The <tt class="code">p:escape-markup</tt> step applies XML
serialization to the children of the document element and replaces
those children with their serialization. The outcome is a single
element with text content that represents the "escaped" syntax of
the children as they were serialized.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:escape-markup</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>This step supports the standard serialization options as
specified in <a href="#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>. These options control how the output markup is
produced before it is escaped.</p>
<p>For example, the input:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;This is a chunk of XHTML.&lt;/p&gt;
&lt;/div&gt;
&lt;/description&gt;
</pre></div>
<p>produces:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&amp;lt;div xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;p&gt;This is a chunk of XHTML.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/description&gt;
</pre></div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The result of this step is an XML document that contains the
Unicode characters that are the characters that result from
escaping the input. It is not encoded characters in a serialized
octet stream, therefore, the serialization options related to
encoding characters (<tt class="option">byte-order-mark</tt>,
<tt class="option">encoding</tt>, and <tt class=
"option">normalization-form</tt>) do not apply. They are omitted
from the standard serialization options on this step.</p>
</div>
<p>By default, this step <span class="rfc2119">must not</span>
generate an XML declaration in the escaped result.</p>
</div>
<div class="section">
<h5><a name="c.filter" id="c.filter"></a>7.1.9&#160;p:filter</h5>
<p>The <tt class="code">p:filter</tt> step selects portions of the
source document based on a (possibly dynamically constructed) XPath
select expression.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:filter</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">select</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>This step behaves just like an <a href="#p.input"><tt class=
"tag-element">p:input</tt></a> with a <tt class=
"tag-attribute">select</tt> expression except that the select
expression is computed dynamically.</p>
</div>
<div class="section">
<h5><a name="c.http-request" id=
"c.http-request"></a>7.1.10&#160;p:http-request</h5>
<p>The <tt class="code">p:http-request</tt> step provides for
interaction with resources over HTTP or related protocols. The
input document provided on the <tt class="port">source</tt> port
specifies a request by a single <a href="#cv.request"><tt class=
"tag-element">c:request</tt></a> element. This element specifies
the method, resource, and other request properties as well as
possibly including an entity body (content) for the request.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:http-request</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The standard serialization options are provided to control the
serialization of any XML content which is sent as part of the
request. The effect of these options is as specified in <a href=
"#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>. See <a href="#c.request_body" title=
"Request Entity body conversion">Section&#160;7.1.10.2, “Request
Entity body conversion”</a> for a discussion of when serialization
occurs in constructing a request.</p>
<p><a name="err.inline.C0040" id="err.inline.C0040"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0040"><code class=
"errqname">err:XC0040</code></a>) if the document element of the
document that arrives on the <tt class="port">source</tt> port is
not <a href="#cv.request"><tt class=
"tag-element">c:request</tt></a>.</p>
<div class="section">
<h6><a name="cv.request" id=
"cv.request"></a>7.1.10.1&#160;Specifying a request</h6>
<p>An HTTP request is represented by a <tt class=
"tag-element">c:request</tt> element.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:request<br />
&#160;&#160;<strong>method</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var><br />
&#160;&#160;detailed? = <var>boolean</var><br />
&#160;&#160;status-only? = <var>boolean</var><br />
&#160;&#160;username? = <var>string</var><br />
&#160;&#160;password? = <var>string</var><br />
&#160;&#160;auth-method? = <var>string</var><br />
&#160;&#160;send-authorization? = <var>boolean</var><br />
&#160;&#160;override-content-type? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:request&gt;</code></p>
<p><a name="err.inline.C0006" id="err.inline.C0006"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0006"><code class=
"errqname">err:XC0006</code></a>) if the <tt class=
"tag-attribute">method</tt> is not specified on a <tt class=
"tag-element">c:request</tt>. <a name="err.inline.C0005" id=
"err.inline.C0005"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0005"><code class="errqname">err:XC0005</code></a>) if the
request contains a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> or <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> but the <tt class=
"tag-attribute">method</tt> does not allow for an entity body being
sent with the request.</p>
<p><a name="err.inline.C0004" id="err.inline.C0004"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0004"><code class=
"errqname">err:XC0004</code></a>) if the <tt class=
"code">status-only</tt> attribute has the value <tt class=
"literal">true</tt> and the <tt class="code">detailed</tt>
attribute does not have the value <tt class=
"literal">true</tt>.</p>
<p>The <tt class="code">method</tt> attribute specifies the method
to be used against the IRI specified by the <tt class=
"code">href</tt> attribute, e.g. <tt class="code">GET</tt> or
<tt class="code">POST</tt> (the value is not case-sensitive). If
the <tt class="code">href</tt> attribute is not absolute, it will
be resolved against the base URI of the element on which it is
occurs.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In the case of simple “GET” requests, implementors are
encouraged to support as many protocols as practical. In
particular, pipeline authors may attempt to use <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
to load documents with computed URIs using the <tt class=
"literal">file:</tt> scheme.</p>
</div>
<p>If the <tt class="code">username</tt> attribute is specified,
the <tt class="code">username</tt>, <tt class="code">password</tt>,
<tt class="code">auth-method</tt>, and <tt class=
"code">send-authorization</tt> attributes are used to handle
authentication according to the selected authentication method.</p>
<p>For the purposes of avoiding an authentication challenge, if the
<tt class="code">send-authorization</tt> attribute has the value
<tt class="literal">true</tt> and the authentication method
specified by the <tt class="code">auth-method</tt> supports
generation of an <tt class="code">Authorization</tt> header without
a challenge, then an <tt class="code">Authorization</tt> header is
generated and sent on the first request. If the <tt class=
"code">send-authorization</tt> attribute is absent or has the value
<tt class="literal">false</tt>, then the first request is sent
without an <tt class="code">Authorization</tt> header.</p>
<p>If the initial response to the request is an authentication
challenge, the <tt class="code">auth-method</tt>, <tt class=
"code">username</tt>, <tt class="code">password</tt> and any
relevant data from the challenge are used to generate an <tt class=
"code">Authorization</tt> header and the request is sent again. If
that authorization fails, the request is not retried.</p>
<p>Appropriate values for the <tt class="code">auth-method</tt>
attribute are “Basic” or “Digest” but other values are allowed. If
the authentication method is “Basic” or “Digest”, authentication is
handled as per [<a href="#rfc2617"><span class="abbrev">RFC
2617</span></a>]. <a name="impl-44" id="impl-44"></a>The
interpretation of <tt class="code">auth-method</tt> values on
<tt class="tag-element">c:request</tt> other than “Basic” or
“Digest” is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><a name="err.inline.C0003" id="err.inline.C0003"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0003"><code class=
"errqname">err:XC0003</code></a>) if a <tt class=
"option">username</tt> or <tt class="option">password</tt> is
specified without specifying an <tt class=
"option">auth-method</tt>, if the requested <tt class=
"option">auth-method</tt> isn't supported, or the authentication
challenge contains an authentication method that isn't supported.
All implementations are required to support "Basic" and "Digest"
authentication per [<a href="#rfc2617"><span class="abbrev">RFC
2617</span></a>].</p>
<p>The <tt class="code">c:header</tt> element specifies a header
name and value, either for inclusion in a request, or as received
in a response.</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"cv.header"><code>&lt;c:header<br />
&#160;&#160;<strong>name</strong> = <var>string</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p>The request is formulated from the attribute values on the
<tt class="tag-element">c:request</tt> element and its <a href=
"#cv.header"><tt class="tag-element">c:header</tt></a> and <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a> or
<a href="#cv.body"><tt class="tag-element">c:body</tt></a>
children, if present, and transmitted to the host (and port, if
present) specified by the <tt class="code">href</tt> attribute. The
details of how the request entity body, if any, is constructed are
given in <a href="#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</p>
<p>When the request is formulated, the step and/or protocol
implementation may add headers as necessary to either complete the
request or as appropriate for the content specified (e.g. transfer
encodings). A user of this step is guaranteed that their requested
headers and content will be sent with the exception of any
conflicts with protocol-related headers.</p>
<p>The <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step allows users to specify
independently values that are not always independent. For example,
some combinations of <a href="#cv.header"><tt class=
"tag-element">c:header</tt></a> values (e.g., <tt class=
"literal">Content-Type</tt>) may be inconsistent with values that
the step and/or protocol implementation must set. In a few cases,
the step provides more than one mechanism to specify what is
actually a single value (e.g., the boundary string in multipart
messages). <a name="err.inline.C0020" id="err.inline.C0020"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0020"><code class=
"errqname">err:XC0020</code></a>) if the the user specifies a value
or values that are inconsistent with each other or with the
requirements of the step or protocol.</p>
</div>
<div class="section">
<h6><a name="c.request_body" id=
"c.request_body"></a>7.1.10.2&#160;Request Entity body
conversion</h6>
<p>The <tt class="code">c:multipart</tt> element specifies a
multi-part body, per [<a href="#rfc1521"><span class="abbrev">RFC
1521</span></a>], either for inclusion in a request or as received
in a response.</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"cv.multipart"><code>&lt;c:multipart<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;<strong>boundary</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.body">c:body</a>+<br />
&lt;/c:multipart&gt;</code></p>
<p>In the context of a request, the media type of the <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a>
<span class="rfc2119">must</span> be a multipart media type (i.e.
have a main type of 'multipart'). If the <tt class=
"code">content-type</tt> attribute is not specified, a value of
"multipart/mixed" will be assumed.</p>
<p>The <tt class="code">boundary</tt> attribute is required and is
used to provide a multipart boundary marker. The implementation
must use this boundary marker and must prefix the value with the
string “<tt class="literal">--</tt>” when formulating the multipart
message. <a name="err.inline.C0002" id="err.inline.C0002"></a>It is
a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0002"><code class=
"errqname">err:XC0002</code></a>) if the value starts with the
string “<tt class="literal">--</tt>”.</p>
<p>If the boundary is also specified as a parameter in the
<tt class="option">content-type</tt> option, then the parameter
value specified and the <tt class="option">boundary</tt> value
specified <span class="rfc2119">must</span> be the same. If the
boundary is specified in both the <tt class="option">boundary</tt>
option and the <tt class="option">content-type</tt> option then the
two values <span class="rfc2119">must</span> be the same.</p>
<p>The <a href="#cv.body"><tt class="tag-element">c:body</tt></a>
element holds the body or body part of the message. Each of the
attributes holds controls some aspect of the encoding the request
body or decoding the body element's content when the request is
formulated. These are specified as follows:</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"cv.body"><code>&lt;c:body<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;id? = <var>string</var><br />
&#160;&#160;description? = <var>string</var><br />
&#160;&#160;disposition? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var>*<br />
&lt;/c:body&gt;</code></p>
<p>The <tt class="code">content-type</tt> attribute specifies the
media type of the body or body part, that is, the value of its
<tt class="code">Content-Type</tt> header. If the media type is not
an XML type or text, the content must already be
base64-encoded.</p>
<p>The <tt class="code">encoding</tt> attribute controls the
decoding of the element content for formulating the body. A value
of <tt class="literal">base64</tt> indicates the element's content
is a base64 encoded string whose byte stream should be sent as the
message body. <a name="impl-45" id="impl-45"></a>An implementation
may support encodings other than <tt class="literal">base64</tt>
but these encodings and their names are <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
<a name="err.inline.C0052" id="err.inline.C0052"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0052"><code class=
"errqname">err:XC0052</code></a>) if the encoding specified is not
supported by the implementation.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step provides only a single
set of serialization options for XML media types. There's no direct
support for sending a multipart message with two XML parts encoded
differently.</p>
</div>
<p>For each body or body part, the <tt class="code">id</tt>
attribute specifies the value of the <tt class=
"code">Content-ID</tt> header; the <tt class=
"code">description</tt> attribute specifies the value of the
<tt class="code">Content-Description</tt> header; and the
<tt class="code">disposition</tt> attribute specifies the value of
the <tt class="code">Content-Disposition</tt> header.</p>
<p>If an entity body is to be sent as part of a request (e.g. a
<tt class="code">POST</tt>), either a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element, specifying the request
entity body, or a <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element, specifying multiple
entity body parts, may be used. When <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a> is
used it may contain multiple <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> children. A <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> specifies the
construction of a body or body part as follows:</p>
<p>If the <tt class="code">content-type</tt> attribute does not
specify an XML media type, or the <tt class="code">encoding</tt>
attribute is “<tt class="literal">base64</tt>”, then <a name=
"err.inline.C0028" id="err.inline.C0028"></a>it is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0028"><code class=
"errqname">err:XC0028</code></a>) if the content of the <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> element does not
consist entirely of characters, and the entity body or body part
will consist of exactly those characters.</p>
<p>Otherwise (the <tt class="code">content-type</tt> attribute
<em>does</em> specify an XML media type and the <tt class=
"code">encoding</tt> attribute is <em>not</em> 'base64'), <a name=
"err.inline.C0022" id="err.inline.C0022"></a>it is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0022"><code class=
"errqname">err:XC0022</code></a>) if the content of the <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> element does not
consist of exactly one element, optionally preceded and/or followed
by any number of processing instructions, comments or whitespace
characters, and the entity body or body part will consist of the
serialization of a document node containing that content. The
serialization of that document is controlled by the serialization
options on the <tt class="code">p:http-request</tt> step
itself.</p>
<p>For example, the following input to a <tt class=
"code">p:http-request</tt> step will POST a small XML document:</p>
<div class="programlisting">
<pre>
&lt;c:request method="POST" href="http://example.com/someservice"&gt;
&lt;c:body xmlns:c="http://www.w3.org/ns/xproc-step" content-type="application/xml"&gt;
&lt;doc&gt;
&lt;title&gt;My document&lt;/title&gt;
&lt;/doc&gt;
&lt;/c:body&gt;
&lt;/c:request&gt;
</pre></div>
<p>The corresponding request should look something like this:</p>
<div class="programlisting">
<pre>
POST http://example.com/someservice HTTP/1.1
Host: example.com
Content-Type: application/xml; charset="utf-8"
&lt;?xml version='1.0'?&gt;
&lt;doc&gt;
&lt;title&gt;My document&lt;/title&gt;
&lt;/doc&gt;
</pre></div>
</div>
<div class="section">
<h6><a name="c.request_response" id=
"c.request_response"></a>7.1.10.3&#160;Managing the response</h6>
<p>The handling of the response to the request and the generation
of the step's result document is controlled by the <tt class=
"code">status-only</tt>, <tt class=
"code">override-content-type</tt> and <tt class=
"code">detailed</tt> attributes on the <a href=
"#cv.request"><tt class="tag-element">c:request</tt></a> input.</p>
<p>The <tt class="code">override-content-type</tt> attribute
controls interpretation of the response's <tt class=
"code">Content-Type</tt> header. If this attribute is present, the
response will be treated as if it returned the <tt class=
"code">Content-Type</tt> given by its value. This original
<tt class="code">Content-Type</tt> header will however be reflected
unchanged as a <a href="#cv.header"><tt class=
"tag-element">c:header</tt></a> in the result document. <a name=
"err.inline.C0030" id="err.inline.C0030"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0030"><code class=
"errqname">err:XC0030</code></a>) if the <tt class=
"code">override-content-type</tt> value cannot be used (e.g.
<tt class="code">text/plain</tt> to override <tt class=
"code">image/png</tt>).</p>
<p>If the <tt class="code">status-only</tt> attribute has the value
<tt class="literal">true</tt>, the result document will contain
only header information. The entity of the response will not be
processed to produce a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> or <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element.</p>
<p>The <a href="#c.response"><tt class=
"tag-element">c:response</tt></a> element represents an HTTP
response. The response's status code is encoded in the <tt class=
"code">status</tt> attribute and the headers and entity body are
processing into <a href="#cv.header"><tt class=
"tag-element">c:header</tt></a> and <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a> or
<a href="#cv.body"><tt class="tag-element">c:body</tt></a>
content.</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"c.response"><code>&lt;c:response<br />
&#160;&#160;status? = <var>integer</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:response&gt;</code></p>
<p>The value of the <tt class="code">detailed</tt> attribute
determines the content of the result document. If it is <tt class=
"literal">true</tt>, the response to the request is handled as
follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>A single <a href="#c.response"><tt class=
"tag-element">c:response</tt></a> element is produced with the
<tt class="code">status</tt> attribute containing the status of the
response received.</p>
</li>
<li>
<p>Each response header is translated into a <a href=
"#cv.header"><tt class="tag-element">c:header</tt></a> element.</p>
</li>
<li>
<p>Unless the <tt class="code">status-only</tt> attribute has a
value <tt class="literal">true</tt>, the entity body of the
response is converted into a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> or <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element via the rules given in
<a href="#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</p>
</li>
</ol>
</div>
<p>Otherwise (the <tt class="code">detailed</tt> attribute is not
specified or its value is <tt class="literal">false</tt>), the
response to the request is handled as follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the media type (as determined by the <tt class=
"code">override-content-type</tt> attribute or the <tt class=
"code">Content-Type</tt> response header) is an XML media type, the
entity is decoded if necessary, then parsed as an XML document and
produced on the <tt class="code">result</tt> output port as the
entire output of the step.</p>
</li>
<li>
<p>Otherwise, the entity body of the response is converted into a
<a href="#cv.body"><tt class="tag-element">c:body</tt></a> or
<a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element via the rules given in
<a href="#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</p>
</li>
</ol>
</div>
<p>In either case the base URI of the output document is the
resolved value of the <tt class="code">href</tt> attribute from the
input <a href="#cv.request"><tt class=
"tag-element">c:request</tt></a>.</p>
<div class="section">
<h6><a name="redirects" id=
"redirects"></a>7.1.10.3.1&#160;Redirects</h6>
<p>One possible response from an HTTP request is a redirect,
indicated by a status code in the three-hundred range. The precise
semantics of the 3xx return codes are laid out by section
<em class="citetitle">10.3 Redirection 3xx</em> in [<a href=
"#rfc2616"><span class="abbrev">RFC 2616</span></a>].</p>
<p>The <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step <span class=
"rfc2119">should</span> follow redirect requests (in a manner
consistent with [<a href="#rfc2616"><span class="abbrev">RFC
2616</span></a>]) if they are returned by the server.</p>
</div>
<div class="section">
<h6><a name="cookies" id="cookies"></a>7.1.10.3.2&#160;Cookies</h6>
<p>With one exception, in version 1.0 of XProc, the <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
step does not provide any standard mechanisms for managing cookies.
<a name="impl-46" id="impl-46"></a>Pipeline authors that need to
preserve cookies across several <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
calls in the same pipeline or across multiple invocations of the
same or different pipelines will have to rely on <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
mechanisms.</p>
<p>The exception arises in the case of redirection. If a redirect
response includes cookies, those cookies <span class=
"rfc2119">should</span> be forwarded as appropriate to the
redirected location when the redirection is followed.</p>
<p>This behavior will allow the <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
step to interoperate with web services that use cookies as part of
an authentication protocol.</p>
</div>
</div>
<div class="section">
<h6><a name="c.response_body" id=
"c.response_body"></a>7.1.10.4&#160;Converting Response Entity
Bodies</h6>
<p>The entity of a response may be multipart per [<a href=
"#rfc1521"><span class="abbrev">RFC 1521</span></a>]. In those
situations, the result document will be a <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a>
element that contains multiple <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> elements inside.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Although it is technically possible for any of the individual
parts of a multipart message to <em>also</em> be multipart, XProc
does not provide a standard representation for such messages.
<a name="impl-47" id="impl-47"></a>The interpretation of a
multipart message inside another multipart message is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</div>
<p>The result of the <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step is an XML document. For
media types (images, binaries, etc.) that can't be represented as a
sequence of Unicode characters, the response is encoded as
<tt class="literal">base64</tt> and then returned as text children
of the <a href="#cv.body"><tt class="tag-element">c:body</tt></a>
element. If the content is base64-encoded, the <tt class=
"tag-attribute">encoding</tt> attribute on <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> must be set to
<tt class="literal">base64</tt>”.</p>
<p>If the media type of the response is a text type with a
<tt class="code">charset</tt> parameter that is a Unicode character
encoding (per [<a href="#unicodetr17"><span class="abbrev">Unicode
TR#17</span></a>]) or is recognized as a non-XML media type whose
contents are encoded as a sequence of Unicode characters (e.g. it
has a character parameter or the definition of the media type is
such that it requires Unicode), the content of the constructed
<a href="#cv.body"><tt class="tag-element">c:body</tt></a> element
is the translation of the text into a sequence of Unicode
characters.</p>
<p>If the response is an XML media type, the content of the
constructed <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element is the result of decoding the
body as necessary, then parsing it with an XML parser. If the
content is not well-formed, the step fails.</p>
<p>In a <a href="#cv.body"><tt class="tag-element">c:body</tt></a>
in a response, the <tt class="tag-attribute">content-type</tt>
attribute <span class="rfc2119">must</span> be an exact copy of the
value returned in the <tt class="literal">Content-Type</tt> header.
That is, it must reflect the content type actually returned, not
any override value that may have been specified, and it must
include any parameters returned by the server.</p>
<p>In the case of a multipart response, the same rules apply when
constructing a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element for each body part
encountered.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Given the above description, any content identified as
<tt class="code">text/html</tt> will be encoded as (escaped) text
or base64-encoded in the <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element, as HTML isn't always
well-formed XML. A user can attempt to convert such content into
XML using the <a href="#c.unescape-markup"><tt class=
"tag-element">p:unescape-markup</tt></a> step.</p>
</div>
</div>
<div class="section">
<h6><a name="example-http-request" id=
"example-http-request"></a>7.1.10.5&#160;HTTP Request Example</h6>
<p>A simple form might be posted as follows:</p>
<div class="programlisting">
<pre>
&lt;c:request method="POST" href="http://www.example.com/form-action" xmlns:c="http://www.w3.org/ns/xproc-step"&gt;
&lt;c:body content-type="application/x-www-form-urlencoded"&gt;
name=W3C&amp;amp;spec=XProc
&lt;/c:body&gt;
&lt;/c:request&gt;
</pre></div>
<p>and if the response was an XHTML document, the result document
would be:</p>
<div class="programlisting">
<pre>
&lt;c:response status="200" xmlns:c="http://www.w3.org/ns/xproc-step"&gt;
&lt;c:header name="Date" value=" Wed, 09 May 2007 23:12:24 GMT"/&gt;
&lt;c:header name="Server" value="Apache/1.3.37 (Unix) PHP/4.4.5"/&gt;
&lt;c:header name="Vary" value="negotiate,accept"/&gt;
&lt;c:header name="TCN" value="choice"/&gt;
&lt;c:header name="P3P" value="policyref='http://www.w3.org/2001/05/P3P/p3p.xml'"/&gt;
&lt;c:header name="Cache-Control" value="max-age=600"/&gt;
&lt;c:header name="Expires" value="Wed, 09 May 2007 23:22:24 GMT"/&gt;
&lt;c:header name="Last-Modified" value="Tue, 08 May 2007 16:10:49 GMT"/&gt;
&lt;c:header name="ETag" value="'4640a109;42380ddc'"/&gt;
&lt;c:header name="Accept-Ranges" value="bytes"/&gt;
&lt;c:header name="Keep-Alive" value="timeout=2, max=100"/&gt;
&lt;c:header name="Connection" value="Keep-Alive"/&gt;
&lt;c:body content-type="application/xhtml+xml"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;&lt;title&gt;OK&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;&lt;p&gt;OK!&lt;/p&gt;&lt;/body&gt;
&lt;/html&gt;
&lt;/c:body&gt;
&lt;/c:response&gt;
</pre></div>
</div>
</div>
<div class="section">
<h5><a name="c.identity" id=
"c.identity"></a>7.1.11&#160;p:identity</h5>
<p>The <tt class="code">p:identity</tt> step makes a verbatim copy
of its input available on its output.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:identity</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>If the implementation supports passing PSVI annotations between
steps, the <tt class="tag-element">p:identity</tt> step
<span class="rfc2119">must</span> preserve any annotations that
appear in the input.</p>
</div>
<div class="section">
<h5><a name="c.insert" id="c.insert"></a>7.1.12&#160;p:insert</h5>
<p>The <tt class="code">p:insert</tt> step inserts the <tt class=
"code">insertion</tt> port's document into the <tt class=
"port">source</tt> port's document relative to the matching
elements in the <tt class="code">source</tt> port's document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:insert</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">insertion</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'/*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">position</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"first-child"
| "last-child" | "before" | "after"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.2" id="err.inline.C0023.2"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element, text, processing-instruction, or comment nodes.
Multiple matches are allowed, in which case multiple copies of the
<tt class="port">insertion</tt> documents will occur. If no
elements match, then the document is unchanged.</p>
<p>The value of the <tt class="option">position</tt> option
<span class="rfc2119">must</span> be an NMTOKEN in the following
list:</p>
<div class="itemizedlist">
<ul>
<li>
<p><tt class="literal">first-child</tt>” - the insertion is made
as the first child of the match;</p>
</li>
<li>
<p><tt class="literal">last-child</tt>” - the insertion is made as
the last child of the match;</p>
</li>
<li>
<p><tt class="literal">before</tt>” - the insertion is made as the
immediate preceding sibling of the match;</p>
</li>
<li>
<p><tt class="literal">after</tt>” - the insertion is made as the
immediate following sibling of the match.</p>
</li>
</ul>
</div>
<p><a name="err.inline.C0025" id="err.inline.C0025"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0025"><code class=
"errqname">err:XC0025</code></a>) if the match pattern matches
anything other than an element node and the value of the <tt class=
"option">position</tt> option is “<tt class=
"literal">first-child</tt>” or “<tt class=
"literal">last-child</tt>”.</p>
<p>As the inserted elements are part of the output of the step they
are not considered in determining matching elements. If an empty
sequence appears on the <tt class="port">insertion</tt> port, the
result will be the same as the source.</p>
</div>
<div class="section">
<h5><a name="c.label-elements" id=
"c.label-elements"></a>7.1.13&#160;p:label-elements</h5>
<p>The <tt class="code">p:label-elements</tt> step generates a
label for each matched element and stores that label in the
specified attribute.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:label-elements</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml:id'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">label</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'concat("_",$p:index)'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">attribute</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">attribute-namespace</tt> may be used to specify the
namespace of the attribute name. In that case, the <tt class=
"tag-attribute">attribute-prefix</tt> may be specified to suggest a
prefix for the attribute name. <a name="err.inline.D0034.3" id=
"err.inline.D0034.3"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The value of the <tt class="option">label</tt> option is an
XPath expression used to generate the value of the attribute
label.</p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.3" id="err.inline.C0023.3"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that expression matches
anything other than element nodes.</p>
<p>The value of the <tt class="option">replace</tt> <span class=
"rfc2119">must</span> be a boolean value and is used to indicate
whether existing attribute values are replaced.</p>
<p>This step operates by generating attribute labels for each
element matched. For every matched element, the expression is
evaluated with the context node set to the matched element. An
attribute is added to the matched element using the attribute name
is specified the <tt class="option">attribute</tt> option and the
string value of result of evaluating the expression. If the
attribute already exists on the matched element, the value is
replaced with the string value only if the <tt class=
"option">replace</tt> option has the value of <tt class=
"literal">true</tt>.</p>
<p>If this step is used to add or change the value of an attribute
named “<tt class="literal">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>An implementation must bind the variable “<tt class=
"literal">p:index</tt>” in the static context of each evaluation of
the XPath expression to the position of the element in the sequence
of matched elements. In other words, the first element (in document
order) matched gets the value “<tt class="literal">1</tt>”, the
second gets the value “<tt class="literal">2</tt>”, the third,
<tt class="literal">3</tt>”, etc.</p>
<p>The result of the p:label-elements step is the input document
with the attribute labels associated with matched elements. All
other non-matching content remains the same.</p>
</div>
<div class="section">
<h5><a name="c.load" id="c.load"></a>7.1.14&#160;p:load</h5>
<p>The <tt class="code">p:load</tt> step has no inputs but produces
as its result an XML resource specified by an IRI.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:load</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-validate</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">href</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It is interpreted as an IRI reference. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:load</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>The value of the <tt class="option">dtd-validate</tt> option
<span class="rfc2119">must</span> be a boolean.</p>
<p>The <tt class="tag-element">p:load</tt> step is the same as
<a href="#p.document"><tt class="tag-element">p:document</tt></a>
with two additions:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>The URI to be accessed can be constructed dynamically by the
pipeline.</p>
</li>
<li>
<p>The <tt class="tag-element">p:load</tt> step has an option to
invoke DTD validation.</p>
</li>
</ol>
</div>
<p>When <tt class="option">dtd-validate</tt> is <tt class=
"literal">false</tt>, <tt class="tag-element">p:load</tt>
processing is the same as <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> processing on the computed
<tt class="option">href</tt> value.</p>
<p>When <tt class="option">dtd-validate</tt> is <tt class=
"literal">true</tt>, <tt class="tag-element">p:load</tt> processing
is the same as <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> processing on the computed
<tt class="option">href</tt> value but <span class=
"rfc2119">must</span> use a validating parser. <a name=
"err.inline.C0027" id="err.inline.C0027"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0027"><code class=
"errqname">err:XC0027</code></a>) if the document is not valid or
the step doesn't support DTD validation.</p>
<p>The retrieved document is produced on the <tt class=
"port">result</tt> port. The base URI of the result is the
(absolute) IRI used to retrieve it.</p>
</div>
<div class="section">
<h5><a name="c.make-absolute-uris" id=
"c.make-absolute-uris"></a>7.1.15&#160;p:make-absolute-uris</h5>
<p>The <tt class="code">p:make-absolute-uris</tt> step makes an
element or attribute's value in the source document an absolute IRI
value in the result document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:make-absolute-uris</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.4" id="err.inline.C0023.4"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if the pattern matches anything
other than element or attribute nodes.</p>
<p>The value of the <tt class="option">base-uri</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It is interpreted as an IRI reference. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:make-absolute-uris</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>For every element or attribute in the input document which
matches the specified pattern, its XPath string-value is resolved
against the specified base URI and the resulting absolute IRI is
used as the matched node's entire contents in the output.</p>
<p>The base URI used for resolution defaults to the matched
attribute's element or the matched element's base URI unless the
<tt class="option">base-uri</tt> option is specified. When the
<tt class="option">base-uri</tt> option is specified, the option
value is used as the base URI regardless of any contextual base URI
value in the document. This option value is resolved against the
base URI of the <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> element used to set the option.</p>
<p><a name="impl-48" id="impl-48"></a>If the IRI reference
specified by the <tt class="option">base-uri</tt> option on
<tt class="tag-element">p:make-absolute-uris</tt> is not valid, or
if it is absent and the input document has no base URI, the results
are <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.namespace-rename" id=
"c.namespace-rename"></a>7.1.16&#160;p:namespace-rename</h5>
<p>The <tt class="code">p:namespace-rename</tt> step renames any
namespace declaration or use of a namespace in a document to a new
IRI value.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:namespace-rename</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">from</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">to</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">apply-to</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'all'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"all"
| "elements" | "attributes"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">from</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It <span class="rfc2119">should</span> be
either empty or absolute, but will not be resolved in any case.</p>
<p>The value of the <tt class="option">to</tt> option <span class=
"rfc2119">must</span> be an <tt class="type">anyURI</tt>. It
<span class="rfc2119">should</span> be empty or absolute, but will
not be resolved in any case.</p>
<p>The value of the <tt class="option">apply-to</tt> option
<span class="rfc2119">must</span> be one of “<tt class=
"literal">all</tt>”, “<tt class="literal">elements</tt>”, or
<tt class="literal">attributes</tt>”. If the value is “<tt class=
"literal">elements</tt>”, only elements will be renamed, if the
value is “<tt class="literal">attributes</tt>”, only attributes
will be renamed, if the value is “<tt class="literal">all</tt>”,
both elements and attributes will be renamed.</p>
<p><a name="err.inline.C0014" id="err.inline.C0014"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0014"><code class=
"errqname">err:XC0014</code></a>) if the XML namespace (<tt class=
"uri">http://www.w3.org/XML/1998/namespace</tt>) or the XMLNS
namespace (<tt class="uri">http://www.w3.org/2000/xmlns/</tt>) is
the value of either the <tt class="option">from</tt> option or the
<tt class="option">to</tt> option.</p>
<p>If the value of the <tt class="option">from</tt> option is the
same as the value of the <tt class="option">to</tt> option, the
input is reproduced unchanged on the output. Otherwise, namespace
bindings, namespace attributes and element and attribute names are
changed as follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p>Namespace bindings: If the <tt class="option">from</tt> option
is present and its value is not the empty string, then every
binding of a prefix (or the default namespace) in the input
document whose value is the same as the value of the <tt class=
"option">from</tt> option is</p>
<div class="itemizedlist">
<ul>
<li>
<p>replaced in the output with a binding to the value of the
<tt class="option">to</tt> option, provided it is present and not
the empty string;</p>
</li>
<li>
<p>otherwise (the <tt class="option">to</tt> option is not
specified or has an empty string as its value) absent from the
output.</p>
</li>
</ul>
</div>
<p>If the <tt class="option">from</tt> option is absent, or its
value is the empty string, then no bindings are changed or
removed.</p>
</li>
<li>
<p>Elements and attributes: If the <tt class="option">from</tt>
option is present and its value is not the empty string, for every
element and attribute, as appropriate, in the input whose namespace
name is the same as the value of the <tt class="option">from</tt>
option, in the output its namespace name is</p>
<div class="itemizedlist">
<ul>
<li>
<p>replaced with the value of the <tt class="option">to</tt>
option, provided it is present and not the empty string;</p>
</li>
<li>
<p>otherwise (the <tt class="option">to</tt> option is not
specified or has an empty string as its value) changed to have no
value.</p>
</li>
</ul>
</div>
<p>If the <tt class="option">from</tt> option is absent, or its
value is the empty string, then for every element and attribute, as
appropriate, whose namespace name has no value, in the output its
namespace name is set to the value of the <tt class=
"option">to</tt> option.</p>
</li>
<li>
<p>Namespace attributes: If the <tt class="option">from</tt> option
is present and its value is not the empty string, for every
namespace attribute in the input whose value is the same as the
value of the <tt class="option">from</tt> option, in the output</p>
<div class="itemizedlist">
<ul>
<li>
<p>the namespace attribute's value is replaced with the value of
the <tt class="option">to</tt> option, provided it is present and
not the empty string;</p>
</li>
<li>
<p>otherwise (the <tt class="option">to</tt> option is not
specified or has an empty string as its value) the namespace
attribute is absent.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The <tt class="option">apply-to</tt> option is primarily
intended to make it possible to avoid renaming attributes when the
<tt class="option">from</tt> option specifies no namespace, since
many attributes are in no namespace.</p>
<p>Care should be taken when specifying no namespace with the
<tt class="option">to</tt> option. Prefixed names in content, for
example QNames and XPath expressions, may end up with no
appropriate namespace binding.</p>
</div>
</div>
<div class="section">
<h5><a name="c.pack" id="c.pack"></a>7.1.17&#160;p:pack</h5>
<p>The <tt class="code">p:pack</tt> step merges two document
sequences in a pair-wise fashion.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:pack</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">wrapper</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">wrapper-namespace</tt> may be used to specify the
namespace of the wrapper. In that case, the <tt class=
"tag-attribute">wrapper-prefix</tt> may be specified to suggest a
prefix for the wrapper element. <a name="err.inline.D0034.4" id=
"err.inline.D0034.4"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The step takes each pair of documents, in order, one from the
<tt class="port">source</tt> port and one from the <tt class=
"port">alternate</tt> port, wraps them with a new element node
whose QName is the value specified in the <tt class=
"option">wrapper</tt> option, and writes that element to the
<tt class="port">result</tt> port as a document.</p>
<p>If the step reaches the end of one input sequence before the
other, then it simply wraps each of the remaining documents in the
longer sequence.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In the common case, where the document element of a document in
the <tt class="port">result</tt> sequence has two element children,
any comments, processing instructions, or white space text nodes
that occur between them may have come from either of the input
documents; this step does not attempt to distinguish which one.</p>
</div>
</div>
<div class="section">
<h5><a name="c.parameters" id=
"c.parameters"></a>7.1.18&#160;p:parameters</h5>
<p>The <tt class="code">p:parameters</tt> step exposes a set of
parameters as a <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a> document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:parameters</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>Each parameter passed to the step is converted into a <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> element. The
step resolves duplicate parameters in the normal way (see <a href=
"#parameter-inputs" title="Parameter Inputs">Section&#160;5.1.2,
“Parameter Inputs”</a>) so at most one parameter with any given
name will appear in the result. The resulting <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> elements are
wrapped in a <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a> and the parameter set document
is written to the <tt class="port">result</tt> port. <a name=
"impl-49" id="impl-49"></a>The order in which <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> elements occur
in the <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a> is <em class=
"glossterm"><a href="#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>For consistency and user convenience, if any of the parameters
have names that are in a namespace, the <tt class=
"tag-attribute">namespace</tt> attribute on the <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> element
<span class="rfc2119">must</span> be used. Each <tt class=
"tag-attribute">name</tt> <span class="rfc2119">must</span> be an
NCName.</p>
<p>The base URI of the output document is the URI of the pipeline
document that contains the step.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Since the <tt class="port">parameters</tt> port is <em>not</em>
primary, any explicit <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> settings <span class=
"rfc2119">must</span> include a <tt class="tag-attribute">port</tt>
attribute, per the last paragraph of <a href="#p.with-param" title=
"p:with-param">Section&#160;5.7.4, “p:with-param”</a>.</p>
</div>
</div>
<div class="section">
<h5><a name="c.rename" id="c.rename"></a>7.1.19&#160;p:rename</h5>
<p>The <tt class="code">p:rename</tt> step renames elements,
attributes, or processing-instruction targets in a document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:rename</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern. <a name="err.inline.C0023.5" id=
"err.inline.C0023.5"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0023"><code class="errqname">err:XC0023</code></a>) if the
pattern matches anything other than element, attribute or
processing instruction nodes.</p>
<p>The value of the <tt class="option">new-name</tt> option must be
a <tt class="type">QName</tt>. If the lexical value does not
contain a colon, then the <tt class=
"tag-attribute">new-namespace</tt> may be used to specify the
namespace of the new name. In that case, the <tt class=
"tag-attribute">new-prefix</tt> may be specified to suggest a
prefix for the new name. <a name="err.inline.D0034.5" id=
"err.inline.D0034.5"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>Each element, attribute, or processing-instruction in the input
matched by the match pattern specified in the <tt class=
"option">match</tt> option is renamed in the output to the name
specified by the <tt class="option">new-name</tt> option.</p>
<p>If the <tt class="option">match</tt> option matches an attribute
and if the element on which it occurs already has an attribute
whose expanded name is the same as the expanded name of the
specified <tt class="option">new-name</tt>, then the results is as
if the current attribute named “<em class="replaceable"><tt class=
"replaceable">new-name</tt></em>” was deleted before renaming the
matched attribute.</p>
<p>With respect to attributes named “<tt class=
"literal">xml:base</tt>”, the following semantics apply: renaming
an <em>from</em><tt class="literal">xml:base</tt><em>to</em>
something else has no effect on the underlying base URI of the
element; however, if an attribute is renamed <em>from</em>
something else <em>to</em><tt class="literal">xml:base</tt>”, the
base URI of the element <span class="rfc2119">must</span> also be
amended accordingly.</p>
<p>If the pattern matches processing instructions, then it is the
processing instruction target that is renamed. <a name=
"err.inline.C0013" id="err.inline.C0013"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0013"><code class=
"errqname">err:XC0013</code></a>) if the pattern matches a
processing instruction and the new name has a non-null
namespace.</p>
</div>
<div class="section">
<h5><a name="c.replace" id=
"c.replace"></a>7.1.20&#160;p:replace</h5>
<p>The <tt class="code">p:replace</tt> step replaces matching nodes
in its primary input with the document element of the <tt class=
"code">replacement</tt> port's document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:replace</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">replacement</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.6" id="err.inline.C0023.6"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element, text, processing-instruction, or comment nodes.
Multiple matches are allowed, in which case multiple copies of the
<tt class="port">replacement</tt> document will occur.</p>
<p>Every node in the primary input matching the specified pattern
is replaced in the output is replaced by the document element of
the <tt class="port">replacement</tt> document. Only non-nested
matches are replaced. That is, once a node is replaced, its
descendants cannot be matched.</p>
</div>
<div class="section">
<h5><a name="c.set-attributes" id=
"c.set-attributes"></a>7.1.21&#160;p:set-attributes</h5>
<p>The <tt class="tag-element">p:set-attributes</tt> step sets
attributes on matching elements.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:set-attributes</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">attributes</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.7" id="err.inline.C0023.7"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element nodes.</p>
<p>Each attribute on the document element of the document that
appears on the <tt class="port">attributes</tt> port is copied to
each element that matches the <tt class="option">match</tt>
expression.</p>
<p>If an attribute with the same name as one of the attributes to
be copied already exists, the value specified on the <tt class=
"port">attribute</tt> port's document is used. The result port of
this step produces a copy of the <tt class="port">source</tt>
port's document with the matching elements' attributes
modified.</p>
<p>The matching elements are specified by the match pattern in the
<tt class="option">match</tt> option. All matching elements are
processed. If no elements match, the step will not change any
elements.</p>
<p>This step must not copy namespace declarations. If the
attributes copied from the <tt class="port">attributes</tt> use
namespaces, prefixes, or prefixes bound to different namespaces,
the document produced on the <tt class="port">result</tt> output
port will require <a href="#namespace-fixup">namespace
fixup</a>.</p>
<p>If an attribute named <tt class="tag-attribute">xml:base</tt> is
added or changed, the base URI of the element <span class=
"rfc2119">must</span> also be amended accordingly.</p>
</div>
<div class="section">
<h5><a name="c.sink" id="c.sink"></a>7.1.22&#160;p:sink</h5>
<p>The <tt class="tag-element">p:sink</tt> step accepts a sequence
of documents and discards them. It has no output.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:sink</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
</div>
<div class="section">
<h5><a name="c.split-sequence" id=
"c.split-sequence"></a>7.1.23&#160;p:split-sequence</h5>
<p>The <tt class="tag-element">p:split-sequence</tt> step accepts a
sequence of documents and divides it into two sequences.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:split-sequence</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">not-matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-only</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">test</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">test</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>The XPath expression in the <tt class="option">test</tt> option
is applied to each document in the input sequence. If the effective
boolean value of the expression is true, the document is copied to
the <tt class="port">matched</tt> port; otherwise it is copied to
the <tt class="port">not-matched</tt> port.</p>
<p>If the <tt class="option">initial-only</tt> option is true, then
when the first document that does not satisfy the test expression
is encountered, it <em>and all the documents that follow it</em>
are written to the <tt class="port">not-matched</tt> port. In other
words, it only writes the initial series of matched documents
(which may be empty) to the <tt class="port">matched</tt> port. All
other documents are written to the <tt class=
"port">not-matched</tt> port, irrespective of whether or not they
match.</p>
<p>The <a href="#xpath-context">XPath context</a> for the
<tt class="option">test</tt> option changes over time. For each
document that appears on the <tt class="code">source</tt> port, the
expression is evaluated with that document as the context document.
The context position (<tt class="code">position()</tt>) is the
position of that document within the sequence and the context size
(<tt class="code">last()</tt>) is the total number of documents in
the sequence.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In principle, this component cannot stream because it must
buffer all of the input sequence in order to find the context size.
In practice, if the test expression does not use the <tt class=
"function">last()</tt> function, the implementation can stream and
ignore the context size.</p>
</div>
<p>If the implementation supports passing PSVI annotations between
steps, the <tt class="tag-element">p:split-sequence</tt> step
<span class="rfc2119">must</span> preserve any annotations that
appear in the input.</p>
</div>
<div class="section">
<h5><a name="c.store" id="c.store"></a>7.1.24&#160;p:store</h5>
<p>The <tt class="tag-element">p:store</tt> step stores a
serialized version of its input to a URI. This step outputs a
reference to the location of the stored document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:store</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">href</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. If it is relative, it is made absolute against
the base URI of the element on which it is specified (<a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<tt class="tag-element">p:store</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>The step attempts to store the XML document to the specified
URI. <a name="err.inline.C0050" id="err.inline.C0050"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0050"><code class=
"errqname">err:XC0050</code></a>) if the URI scheme is not
supported or the step cannot store to the specified location.</p>
<p>The output of this step is a document containing a single
<a href="#cv.result"><tt class="tag-element">c:result</tt></a>
element whose content is the absolute URI of the document stored by
the step.</p>
<p>The standard serialization options are provided to control the
serialization of the XML content when it is stored. These options
are as specified in <a href="#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>.</p>
</div>
<div class="section">
<h5><a name="c.string-replace" id=
"c.string-replace"></a>7.1.25&#160;p:string-replace</h5>
<p>The <tt class="tag-element">p:string-replace</tt> step matches
nodes in the document provided on the <tt class="port">source</tt>
port and replaces them with the string result of evaluating an
XPath expression.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:string-replace</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern.</p>
<p>The value of the <tt class="option">replace</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
XPath expression provided by the <tt class="option">replace</tt>
option is evaluated with the matching node as the XPath context
node. The string value of the result is used in the output. Nodes
that do not match are copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the string value of the
<tt class="option">replace</tt> expression is used as the new value
of the attribute in the output. If the attribute is named
<tt class="tag-attribute">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>If the expression matches any other kind of node, the entire
node (and <em>not</em> just its contents) is replaced by the string
value of the <tt class="option">replace</tt> expression.</p>
</div>
<div class="section">
<h5><a name="c.unescape-markup" id=
"c.unescape-markup"></a>7.1.26&#160;p:unescape-markup</h5>
<p>The <tt class="tag-element">p:unescape-markup</tt> step takes
the string value of the document element and parses the content as
if it was a Unicode character stream containing serialized XML. The
output consists of the same document element with children that
result from the parse. This is the reverse of the <a href=
"#c.escape-markup"><tt class="tag-element">p:escape-markup</tt></a>
step.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unescape-markup</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'application/xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">charset</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">namespace</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It <span class="rfc2119">should</span> be
absolute, but will not be resolved.</p>
<p>When the string value is parsed, the original document element
is preserved so that the result will be well-formed XML even if the
content consists of multiple, sibling elements.</p>
<p>The <tt class="option">namespace</tt> option specifies a default
namespace. Elements that are in no namespace in the unescaped
content will be placed into this namespace unless there is an
in-scope namespace declaration that specifies a different namespace
(or explicitly undeclares the default namespace).</p>
<p>The <tt class="option">content-type</tt> option <span class=
"rfc2119">may</span> be used to specify an alternate content type
for the string value. An implementation <span class=
"rfc2119">may</span> use a different parser to produce XML content
depending on the specified content-type. For example, an
implementation might provide an HTML to XHTML parser (e.g.
[<a href="#tidy"><span class="abbrev">HTML Tidy</span></a>] or
[<a href="#tagsoup"><span class="abbrev">TagSoup</span></a>]) for
the content type '<tt class="literal">text/html</tt>'.</p>
<p>All implementations <span class="rfc2119">must</span> support
the content type <tt class="literal">application/xml</tt>, and must
use a standard XML parser for it. <a name="err.inline.C0051" id=
"err.inline.C0051"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0051"><code class="errqname">err:XC0051</code></a>) if the
content-type specified is not supported by the implementation.
<a name="impl-50" id="impl-50"></a>Behavior of <tt class=
"tag-element">p:unescape-markup</tt> for <tt class=
"option">content-type</tt>s other than <tt class=
"literal">application/xml</tt> is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>The <tt class="option">encoding</tt> option specifies how the
data is encoded. All implementations <span class=
"rfc2119">must</span> support the <tt class="literal">base64</tt>
encoding (and the absence of an encoding option, which implies that
the content is plain Unicode text). <a name="err.inline.C0052.1"
id="err.inline.C0052.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0052"><code class="errqname">err:XC0052</code></a>) if the
encoding specified is not supported by the implementation.</p>
<p>If an <tt class="option">encoding</tt> is specified, a
<tt class="option">charset</tt> may also be specified. The
character set may be specified as a parameter on the <tt class=
"option">content-type</tt> or via the separate <tt class=
"option">charset</tt> option. If it is specified in both places,
the value of the <tt class="option">charset</tt> option
<span class="rfc2119">must</span> be used.</p>
<p>If the specified <tt class="option">encoding</tt> is <tt class=
"literal">base64</tt>, then the character set <span class=
"rfc2119">must</span> be specified. <a name="err.inline.C0010" id=
"err.inline.C0010"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0010"><code class="errqname">err:XC0010</code></a>) if an
encoding of <tt class="literal">base64</tt> is specified and the
character set is not specified or if the specified character set is
not supported by the implementation.</p>
<p>The octet-stream that results from decoding the text
<span class="rfc2119">must</span> be interpreted using the
character encoding named by the value of the <tt class=
"option">charset</tt> option to produce a sequence of Unicode
characters to parse.</p>
<p>If no <tt class="option">encoding</tt> is specified, the
character set is ignored, irrespective of where it was
specified.</p>
<p>For example, with the 'namespace' option set to the XHTML
namespace, the following input:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&amp;lt;p&gt;This is a chunk.&amp;lt;/p&gt;
&amp;lt;p&gt;This is a another chunk.&amp;lt;/p&gt;
&lt;/description&gt;
</pre></div>
<p>would produce:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&lt;p xmlns="http://www.w3.org/1999/xhtml"&gt;This is a chunk.&lt;/p&gt;
&lt;p xmlns="http://www.w3.org/1999/xhtml"&gt;This is a another chunk.&lt;/p&gt;
&lt;/description&gt;
</pre></div>
</div>
<div class="section">
<h5><a name="c.unwrap" id="c.unwrap"></a>7.1.27&#160;p:unwrap</h5>
<p>The <tt class="tag-element">p:unwrap</tt> step replaces matched
elements with their children.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unwrap</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.8" id="err.inline.C0023.8"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element nodes.</p>
<p>Every element in the <tt class="port">source</tt> document that
matches the specified <tt class="option">match</tt> pattern is
replaced by its children, effectively “unwrapping” the children
from their parent. Non-element nodes and unmatched elements are
passed through unchanged.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The matching applies to the entire document, not just the
“top-most” matches. A pattern of the form <tt class=
"literal">h:div</tt> will replace <em>all</em> <tt class=
"tag-element">h:div</tt> elements, not just the top-most ones.</p>
</div>
<p>This step produces a single document; if the document element is
unwrapped, the result might not be well-formed XML.</p>
</div>
<div class="section">
<h5><a name="c.wrap" id="c.wrap"></a>7.1.28&#160;p:wrap</h5>
<p>The <tt class="tag-element">p:wrap</tt> step wraps matching
nodes in the <tt class="port">source</tt> document with a new
parent element.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">wrapper</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">wrapper-namespace</tt> may be used to specify the
namespace of the wrapper. In that case, the <tt class=
"tag-attribute">wrapper-prefix</tt> may be specified to suggest a
prefix for the wrapper element. <a name="err.inline.D0034.6" id=
"err.inline.D0034.6"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.9" id="err.inline.C0023.9"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if the pattern matches anything
other than document, element, text, processing instruction, and
comment nodes.</p>
<p>The value of the <tt class="option">group-adjacent</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>If the node matched is the document node (<tt class=
"code">match="/"</tt>), the result is a new document where the
document element is a new element node whose QName is the value
specified in the <tt class="option">wrapper</tt> option. That new
element contains copies of all of the children of the original
document node.</p>
<p>When the match pattern does not match the document node, every
node that matches the specified <tt class="option">match</tt>
pattern is replaced with a new element node whose QName is the
value specified in the <tt class="option">wrapper</tt> option. The
content of that new element is a copy of the original, matching
node. The <tt class="tag-element">p:wrap</tt> step performs a
"deep" wrapping, the children of the matching node and their
descendants are processed and wrappers are added to all matching
nodes.</p>
<p>The <tt class="option">group-adjacent</tt> option can be used to
group adjacent matching nodes in a single wrapper element. The
specified XPath expression is evaluated for each matching node with
that node as the XPath context node. Whenever two or more adjacent
matching nodes have the same “group adjacent” value, they are
wrapped together in a single wrapper element.</p>
<p>Two matching nodes are considered adjacent if and only if they
are siblings and either there are no nodes between them or all
intervening, non-matching nodes are whitespace text, comment, or
processing instruction nodes.</p>
</div>
<div class="section">
<h5><a name="c.wrap-sequence" id=
"c.wrap-sequence"></a>7.1.29&#160;p:wrap-sequence</h5>
<p>The <tt class="tag-element">p:wrap-sequence</tt> step accepts a
sequence of documents and produces either a single document or a
new sequence of documents.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap-sequence</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">wrapper</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">wrapper-namespace</tt> may be used to specify the
namespace of the wrapper. In that case, the <tt class=
"tag-attribute">wrapper-prefix</tt> may be specified to suggest a
prefix for the wrapper element. <a name="err.inline.D0034.7" id=
"err.inline.D0034.7"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The value of the <tt class="option">group-adjacent</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>In its simplest form, <tt class=
"tag-element">p:wrap-sequence</tt> takes a sequence of documents
and produces a single, new document by placing each document in the
<tt class="port">source</tt> sequence inside a new document element
as sequential siblings. The name of the document element is the
value specified in the <tt class="option">wrapper</tt> option.</p>
<p>The <tt class="option">group-adjacent</tt> option can be used to
group adjacent documents. The <a href="#xpath-context">XPath
context</a> for the <tt class="option">group-adjacent</tt> option
changes over time. For each document that appears on the <tt class=
"code">source</tt> port, the expression is evaluated with that
document as the context document. The context position (<tt class=
"code">position()</tt>) is the position of that document within the
sequence and the context size (<tt class="code">last()</tt>) is the
total number of documents in the sequence. Whenever two or more
sequentially adjacent documents have the same “group adjacent”
value, they are wrapped together in a single wrapper element.</p>
</div>
<div class="section">
<h5><a name="c.xinclude" id=
"c.xinclude"></a>7.1.30&#160;p:xinclude</h5>
<p>The <tt class="tag-element">p:xinclude</tt> step applies
[<a href="#xinclude"><span class="abbrev">XInclude</span></a>]
processing to the <tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xinclude</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-base</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-lang</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">fixup-xml-base</tt> option
<span class="rfc2119">must</span> be a boolean. If it is true, base
URI fixup will be performed as per [<a href=
"#xinclude"><span class="abbrev">XInclude</span></a>].</p>
<p>The value of the <tt class="option">fixup-xml-lang</tt> option
<span class="rfc2119">must</span> be a boolean. If it is true,
language fixup will be performed as per [<a href=
"#xinclude"><span class="abbrev">XInclude</span></a>].</p>
<p>The included documents are located with the base URI of the
input document and are not provided as input to the step.</p>
<p><a name="err.inline.C0029" id="err.inline.C0029"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0029"><code class=
"errqname">err:XC0029</code></a>) if an XInclude error occurs
during processing.</p>
</div>
<div class="section">
<h5><a name="c.xslt" id="c.xslt"></a>7.1.31&#160;p:xslt</h5>
<p>The <tt class="tag-element">p:xslt</tt> step applies an
[<a href="#xslt10"><span class="abbrev">XSLT 1.0</span></a>] or
[<a href="#xslt20"><span class="abbrev">XSLT 2.0</span></a>]
stylesheet to a document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xslt</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">stylesheet</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">secondary</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-mode</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">template-name</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">output-base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>If present, the value of the <tt class=
"option">initial-mode</tt> option <span class="rfc2119">must</span>
be a <tt class="type">QName</tt>.</p>
<p>If present, the value of the <tt class=
"option">template-name</tt> option <span class=
"rfc2119">must</span> be a <tt class="type">QName</tt>.</p>
<p>If present, the value of the <tt class=
"option">output-base-uri</tt> option <span class=
"rfc2119">must</span> be an <tt class="type">anyURI</tt>. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:xslt</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>If the step specifies a <tt class="option">version</tt>, then
that version of XSLT <span class="rfc2119">must</span> be used to
process the transformation. <a name="err.inline.C0038" id=
"err.inline.C0038"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0038"><code class="errqname">err:XC0038</code></a>) if the
specified version of XSLT is not available. If the step does not
specify a version, the implementation may use any version it has
available and may use any means to determine what version to use,
including, but not limited to, examining the version of the
stylesheet.</p>
<p>The XSLT stylesheet provided on the <tt class=
"port">stylesheet</tt> port is applied to the document on the
<tt class="port">source</tt> port. Any parameters passed on the
<tt class="port">parameters</tt> port are used to define top-level
stylesheet parameters. The primary result document of the
transformation appears on the <tt class="port">result</tt> port.
All other result documents appear on the <tt class=
"port">secondary</tt> port. If XSLT 1.0 is used, an empty sequence
of documents <span class="rfc2119">must</span> appear on the
<tt class="port">secondary</tt> port.</p>
<p>If a sequence of documents is provided on the <tt class=
"port">source</tt> port, the first document is used as the primary
input document. The whole sequence is also the default collection.
If no documents are provided on the <tt class="port">source</tt>
port, the primary input document is undefined and the default
collection is empty. <a name="err.inline.C0039" id=
"err.inline.C0039"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0039"><code class="errqname">err:XC0039</code></a>) if a
sequence of documents (including an empty sequence) is provided to
an XSLT 1.0 step.</p>
<p>A dynamic error occurs if the XSLT processor signals a fatal
error. This includes the case where the transformation terminates
due to a <tt class="tag-element">xsl:message</tt> instruction with
a <tt class="tag-attribute">terminate</tt> attribute value of
<tt class="literal">yes</tt>”. <a name="impl-51" id=
"impl-51"></a>How XSLT message termination errors are reported to
the XProc processor is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>The invocation of the transformation is controlled by the
<tt class="option">initial-mode</tt> and <tt class=
"option">template-name</tt> options that set the initial mode
and/or named template in the XSLT transformation where processing
begins. <a name="err.inline.C0056" id="err.inline.C0056"></a>It is
a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0056"><code class=
"errqname">err:XC0056</code></a>) if the specified initial mode or
named template cannot be applied to the specified stylesheet.</p>
<p>The <tt class="option">output-base-uri</tt> option sets the
context's output base URI per the XSLT 2.0 specification, otherwise
the base URI of the <tt class="port">result</tt> document is the
base URI of the first document in the <tt class="code">source</tt>
port's sequence. If the value of the <tt class=
"option">output-base-uri</tt> option is not absolute, it will be
resolved using the base URI of its <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> element. An XSLT 1.0 step
<span class="rfc2119">should</span> use the value of the <tt class=
"option">output-base-uri</tt> as the base URI of its output, if the
option is specified.</p>
<p>If XSLT 2.0 is used, the outputs of this step <span class=
"rfc2119">may</span> include PSVI annotations.</p>
<p>The static and initial dynamic contexts of the XSLT processor
are the contexts defined in <a href="#step-xpath-context-10" title=
"Step XPath Context">Section&#160;2.6.1.2, “Step XPath Context”</a>
for an XSLT 1.0 processor and <a href="#step-xpath-context-20"
title="Step XPath Context">Section&#160;2.6.2.2, “Step XPath
Context”</a> for an XSLT 2.0 processor with the following
adjustments.</p>
<p>The dynamic context is augmented as follows:</p>
<div class="variablelist">
<dl>
<dt>Context item</dt>
<dd>
<p>The first document that appears on the <tt class=
"port">source</tt> port.</p>
</dd>
<dt>Variable values</dt>
<dd>
<p>Any parameters passed on the <tt class="port">parameters</tt>
port are available as variable bindings to the XSLT processor.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The function implementations provided by the XSLT processor.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>The sequence of documents provided on the <tt class=
"port">source</tt> port.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="section">
<h4><a name="std-optional" id="std-optional"></a>7.2&#160;Optional
Steps</h4>
<p>The following steps are optional. If they are supported by a
processor, they must conform to the semantics outlined here, but a
conformant processor is not required to support all (or any) of
these steps.</p>
<div class="section">
<h5><a name="c.exec" id="c.exec"></a>7.2.1&#160;p:exec</h5>
<p>The <tt class="tag-element">p:exec</tt> step runs an external
command passing the input that arrives on its <tt class=
"port">source</tt> port as standard input, reading <tt class=
"port">result</tt> from standard output, and <tt class=
"port">errors</tt> from standard error.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:exec</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">errors</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">exit-status</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">command</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">args</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cwd</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">source-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">result-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-result-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">errors-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-error-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path-separator</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">failure-threshold</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">arg-separator</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'
'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The values of the <tt class="option">command</tt>, <tt class=
"option">args</tt>, <tt class="option">cwd</tt>, <tt class=
"option">path-separator</tt>, and <tt class=
"option">arg-separator</tt> options <span class=
"rfc2119">must</span> be strings.</p>
<p>The values of the <tt class="option">source-is-xml</tt>,
<tt class="option">result-is-xml</tt>, <tt class=
"option">errors-is-xml</tt>, and <tt class=
"option">fix-slashes</tt> options <span class="rfc2119">must</span>
be boolean.</p>
<p>The <tt class="tag-element">p:exec</tt> step executes the
command passed on <tt class="option">command</tt> with the
arguments passed on <tt class="option">args</tt>. The processor
does not interpolate the values of the <tt class=
"option">command</tt> or <tt class="option">args</tt> (for example,
expanding references to environment variables). <a name=
"err.inline.C0033" id="err.inline.C0033"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0033"><code class=
"errqname">err:XC0033</code></a>) if the command cannot be run.</p>
<p>If <tt class="option">cwd</tt> is specified, then the current
working directory is changed to the value of that option before
execution begins. <a name="err.inline.C0034" id=
"err.inline.C0034"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0034"><code class="errqname">err:XC0034</code></a>) if the
current working directory cannot be changed to the value of the
<tt class="option">cwd</tt> option. <a name="impl-52" id=
"impl-52"></a>If <tt class="option">cwd</tt> is not specified, the
current working directory is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>If the <tt class="option">path-separator</tt> option is
specified, every occurrence of the character identified as the
<tt class="option">path-separator</tt> character that occurs in the
<tt class="option">command</tt>, <tt class="option">args</tt>, or
<tt class="option">cwd</tt> will be replaced by the
platform-specific path separator character. <a name=
"err.inline.C0063" id="err.inline.C0063"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0063"><code class=
"errqname">err:XC0063</code></a>) if the <tt class=
"option">path-separator</tt> option is specified and is not exactly
one character long.</p>
<p>The value of the <tt class="option">args</tt> option is a
string. In order to support passing more than one argument to a
command, the <tt class="option">args</tt> string is broken into a
sequence of values. The <tt class="option">arg-separator</tt>
option specifies the character that is used to separate values; by
default it is a single space <a name="err.inline.C0066" id=
"err.inline.C0066"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0066"><code class="errqname">err:XC0066</code></a>) if the
<tt class="option">arg-separator</tt> option is specified and is
not exactly one character long.</p>
<p>The following examples of <tt class="tag-element">p:exec</tt>
are equivalent. The first uses the default <tt class=
"option">arg-separator</tt>:</p>
<div class="programlisting">
<pre>
&lt;p:exec command="someCommand" args="arg1 arg2 arg3"/&gt;
</pre></div>
<p>The second specifies an alternate separator:</p>
<div class="programlisting">
<pre>
&lt;p:exec command="someCommand" args="arg1,arg2,arg3"
arg-separator=","/&gt;
</pre></div>
<p>If one of the arguments contains a space (e.g., a filename that
contains a space), then you must specify an alternate
separator.</p>
<p>The <tt class="port">source</tt> port is declared to accept a
sequence so that it can be empty. If no document appears on the
<tt class="port">source</tt> port, then the command receives
nothing on standard input. If a document does arrive on the
<tt class="port">source</tt> port, it will be passed to the command
as its standard input. <a name="err.inline.D0006.1" id=
"err.inline.D0006.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0006"><code class="errqname">err:XD0006</code></a>) if more
than one document appears on the <tt class="port">source</tt> port
of the <tt class="tag-element">p:exec</tt> step. If <tt class=
"option">source-is-xml</tt> is true, the serialization options are
used to convert the input into serialized XML which is passed to
the command, otherwise the XPath string-value of the document is
passed.</p>
<p>The standard output of the command is read and returned on
<tt class="port">result</tt>; the standard error output is read and
returned on <tt class="port">errors</tt>. In order to assure that
the result will be an XML document, each of the results will be
wrapped in a <a href="#cv.result"><tt class=
"tag-element">c:result</tt></a> element.</p>
<p>If <tt class="option">result-is-xml</tt> is true, the standard
output of the program is assumed to be XML and will be parsed as a
single document. If it is false, the output is assumed <em>not</em>
to be XML and will be returned as escaped text.</p>
<p id="cv.line">If <tt class="option">wrap-result-lines</tt> is
true, a <a href="#cv.line"><tt class="tag-element">c:line</tt></a>
element will be wrapped around each line of output.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:line&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:line&gt;</code></p>
<p><a name="err.inline.C0035" id="err.inline.C0035"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0035"><code class=
"errqname">err:XC0035</code></a>) to specify both <tt class=
"option">result-is-xml</tt> and <tt class=
"option">wrap-result-lines</tt>.</p>
<p>The same rules apply to the standard error output of the
program, with the <tt class="option">errors-is-xml</tt> and
<tt class="option">wrap-error-lines</tt> options, respectively.</p>
<p>If either of the results are XML, they <span class=
"rfc2119">must</span> be parsed with namespaces enabled and
validation turned off, just like <a href="#p.document"><tt class=
"tag-element">p:document</tt></a>.</p>
<p>The <tt class="port">exit-status</tt> port always returns a
single <a href="#cv.result"><tt class=
"tag-element">c:result</tt></a> element which contains the system
exit status that the process returned. <a name="impl-53" id=
"impl-53"></a>The specific exit status values returned by a process
invoked with <tt class="tag-element">p:exec</tt> are <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>If a <tt class="option">failure-threshold</tt> value is
supplied, and the exit status is greater than that threshold, then
the <tt class="tag-element">p:exec</tt> step <span class=
"rfc2119">must</span> fail. <a name="err.inline.C0064" id=
"err.inline.C0064"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0064"><code class="errqname">err:XC0064</code></a>) if the
exit code from the command is greater than the specified <tt class=
"option">failure-threshold</tt> value. This failure, like any step
failure, can be captured with a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>.</p>
</div>
<div class="section">
<h5><a name="c.hash" id="c.hash"></a>7.2.2&#160;p:hash</h5>
<p>The <tt class="tag-element">p:hash</tt> step generates a hash,
or digital “fingerprint”, for some value and injects it into the
<tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:hash</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">algorithm</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">algorithm</tt> option must
be a QName. If it does not have a prefix, then it must be one of
the following values: “crc”, “md”, or “sha”.</p>
<p>If a <tt class="tag-attribute">version</tt> is not specified,
the default version is algorithm-defined. For “<tt class=
"literal">crc</tt>” it is 32, for “<tt class="literal">md</tt>” it
is 5, for “<tt class="literal">sha</tt>” it is 1.</p>
<p>A hash is constructed from the string specified in the
<tt class="option">value</tt> option using the specified algorithm
and version. Implementations <span class="rfc2119">must</span>
support [<a href="#bib.crc"><span class="abbrev">CRC32</span></a>],
[<a href="#rfc1321"><span class="abbrev">MD5</span></a>], and
[<a href="#bib.sha"><span class="abbrev">SHA1</span></a>] hashes.
<a name="impl-54" id="impl-54"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
other algorithms are supported. The resulting hash <span class=
"rfc2119">should</span> be returned as a string of hexadecimal
characters.</p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern.</p>
<p>The hash of the specified value is computed using the algorithm
and parameters specified. <a name="err.inline.C0036" id=
"err.inline.C0036"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0036"><code class="errqname">err:XC0036</code></a>) if the
requested hash algorithm is not one that the processor understands
or if the value or parameters are not appropriate for that
algorithm.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
string value of the computed hash is used in the output (if more
than one node matches, the <em>same</em> hash value is used in each
match). Nodes that do not match are copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the hash is used as the new
value of the attribute in the output. If the attribute is named
<tt class="tag-attribute">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>If the expression matches any other kind of node, the entire
node (and <em>not</em> just its contents) is replaced by the
hash.</p>
</div>
<div class="section">
<h5><a name="c.uuid" id="c.uuid"></a>7.2.3&#160;p:uuid</h5>
<p>The <tt class="tag-element">p:uuid</tt> step generates a
[<a href="#bib.uuid"><span class="abbrev">UUID</span></a>] and
injects it into the <tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:uuid</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern. The value of the <tt class="option">version</tt>
option must be an integer.</p>
<p>If the <tt class="option">version</tt> is specified, that
version of UUID must be computed. <a name="err.inline.C0060" id=
"err.inline.C0060"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0060"><code class="errqname">err:XC0060</code></a>) if the
processor does not support the specified <tt class=
"option">version</tt> of the UUID algorithm. <a name="impl-55" id=
"impl-55"></a>If the <tt class="option">version</tt> is not
specified, the version of UUID computed is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Implementations <span class="rfc2119">must</span> support
version 4 UUIDs. <a name="impl-56" id="impl-56"></a>Support for
other versions of UUID, and the mechanism by which the necessary
inputs are made available for computing other versions, is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
generated UUID is used in the output (if more than one node
matches, the <em>same</em> UUID is used in each match). Nodes that
do not match are copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the UUID is used as the new
value of the attribute in the output. If the attribute is named
<tt class="tag-attribute">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>If the expression matches any other kind of node, the entire
node (and <em>not</em> just its contents) is replaced by the
UUID.</p>
</div>
<div class="section">
<h5><a name="c.validate-with-relax-ng" id=
"c.validate-with-relax-ng"></a>7.2.4&#160;p:validate-with-relax-ng</h5>
<p>The <tt class="tag-element">p:validate-with-relax-ng</tt> step
applies [<a href="#iso19757-2"><span class="abbrev">RELAX
NG</span></a>] validation to the <tt class="port">source</tt>
document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-relax-ng</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-attribute-values</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-id-idref-warnings</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The values of the <tt class="option">dtd-attribute-values</tt>
and <tt class="option">dtd-id-idref-warnings</tt> options
<span class="rfc2119">must</span> be booleans.</p>
<p>If the root element of the schema is <a href=
"#p.data"><tt class="tag-element">c:data</tt></a> or has a
<tt class="tag-attribute">c:content-type</tt> attribute that
specifies a text content type or a media type that the
implementation recognizes, then the step <span class=
"rfc2119">should</span> treat the text node descendants of the
element as a [<a href="#relaxng-compact-syntax"><span class=
"abbrev">RELAX NG Compact Syntax</span></a>] document for
validation.</p>
<p>If the <tt class="option">dtd-attribute-values</tt> option is
<tt class="literal">true</tt>, then the attribute value defaulting
conventions of [<a href="#relaxng-dtd-compat"><span class=
"abbrev">RELAX NG DTD Compatibility</span></a>] are also
applied.</p>
<p>If the <tt class="option">dtd-id-idref-warnings</tt> option is
<tt class="literal">true</tt>, then the validator <span class=
"rfc2119">should</span> treat a schema that is incompatible with
the ID/IDREF/IDREFs feature of [<a href=
"#relaxng-dtd-compat"><span class="abbrev">RELAX NG DTD
Compatibility</span></a>] as if the document was invalid.</p>
<p><a name="err.inline.C0053" id="err.inline.C0053"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0053"><code class=
"errqname">err:XC0053</code></a>) if the <tt class=
"option">assert-valid</tt> option is <tt class="literal">true</tt>
and the input document is not valid.</p>
<p>The output from this step is a copy of the input, possibly
augmented by application of the [<a href=
"#relaxng-dtd-compat"><span class="abbrev">RELAX NG DTD
Compatibility</span></a>]. The output of this step <span class=
"rfc2119">may</span> include PSVI annotations.</p>
<p><a name="impl-57" id="impl-57"></a>Support for [<a href=
"#relaxng-dtd-compat"><span class="abbrev">RELAX NG DTD
Compatibility</span></a>] is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation defined</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.validate-with-schematron" id=
"c.validate-with-schematron"></a>7.2.5&#160;p:validate-with-schematron</h5>
<p>The <tt class="tag-element">p:validate-with-schematron</tt> step
applies [<a href="#iso19757-3"><span class=
"abbrev">Schematron</span></a>] processing to the <tt class=
"port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-schematron</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">report</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">phase</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'#ALL'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p><a name="err.inline.C0054" id="err.inline.C0054"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0054"><code class=
"errqname">err:XC0054</code></a>) if the <tt class=
"option">assert-valid</tt> option is <tt class="literal">true</tt>
and any Schematron assertions fail.</p>
<p>The value of the <tt class="option">phase</tt> option identifies
the Schematron validation phase with which validation begins.</p>
<p>The <tt class="port">parameters</tt> port provides name/value
pairs which correspond to Schematron external variables.</p>
<p>The <tt class="port">result</tt> output from this step is a copy
of the input.</p>
<p>Schematron assertions and reports, if any, <span class=
"rfc2119">must</span> appear on the <tt class="port">report</tt>
port. The output <span class="rfc2119">should</span> be in
<em class="citetitle">Schematron Validation Report Language</em>
(SVRL).</p>
<p>The output of this step <span class="rfc2119">may</span> include
PSVI annotations.</p>
</div>
<div class="section">
<h5><a name="c.validate-with-xml-schema" id=
"c.validate-with-xml-schema"></a>7.2.6&#160;p:validate-with-xml-schema</h5>
<p>The <tt class="tag-element">p:validate-with-xml-schema</tt> step
applies [<a href="#xmlschema-1"><span class="abbrev">W3C XML
Schema: Part 1</span></a>] validity assessment to the <tt class=
"port">source</tt> input.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-xml-schema</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">use-location-hints</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">try-namespaces</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">mode</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'strict'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"strict"
| "lax"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The values of the <tt class="option">use-location-hints</tt>,
<tt class="option">try-namespaces</tt>, and <tt class=
"option">assert-valid</tt> options <span class=
"rfc2119">must</span> be boolean.</p>
<p>The value of the <tt class="option">mode</tt> option
<span class="rfc2119">must</span> be an NMTOKEN whose value is
either “<tt class="literal">strict</tt>” or “<tt class=
"literal">lax</tt>”.</p>
<p>Validation is performed against the set of schemas represented
by the documents on the <tt class="port">schema</tt> port. These
schemas must be used in preference to any schema locations provided
by schema location hints encountered during schema validation, that
is, schema locations supplied for <tt class="code">xs:import</tt>
or <tt class="code">xsi:schema-location</tt>, or determined by
schema-processor-defined namespace-based strategies, for the
namespaces covered by the documents available on the schemas
port.</p>
<p>If <tt class="code">xs:include</tt> elements occur within the
supplied schema documents, they are treated like any other <a href=
"#external-docs">external documents</a>. <a name="impl-58" id=
"impl-58"></a>It is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> if the
documents supplied on the <tt class="port">schemas</tt> port are
considered when resolving <tt class="code">xs:include</tt> elements
in the schema documents provided.</p>
<p>The <tt class="option">use-location-hints</tt> and <tt class=
"option">try-namespaces</tt> options allow the pipeline author to
control how the schema processor should attempt to locate schema
documents necessary but not provided on the <tt class=
"port">schema</tt> port. Any schema documents provided on the
<tt class="port">schema</tt> port <span class="rfc2119">must</span>
be used in preference to schema documents located by other
means.</p>
<p>If the <tt class="option">use-location-hints</tt> option is
<tt class="literal">true</tt>”, the processor <span class=
"rfc2119">should</span> make use of schema location hints to locate
schema documents. If the option is “<tt class=
"literal">false</tt>”, the processor <span class=
"rfc2119">should</span> ignore any such hints.</p>
<p>If the <tt class="option">try-namespaces</tt> option is
<tt class="literal">true</tt>”, the processor <span class=
"rfc2119">should</span> attempt to dereference the namespace URI to
locate schema documents. If the option is “<tt class=
"literal">false</tt>”, the processor <span class="rfc2119">should
not</span> dereference namespace URIs.</p>
<p>The <tt class="option">mode</tt> option allow the pipeline
author to control how schema validation begins. The “<tt class=
"literal">strict</tt>” mode means that the document element must be
declared and schema-valid, otherwise it will be treated as invalid.
The “<tt class="literal">lax</tt>” mode means that the absence of a
declaration for the document element does not itself count as an
unsuccessful outcome of validation.</p>
<p><a name="err.inline.C0053.1" id="err.inline.C0053.1"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0053"><code class=
"errqname">err:XC0053</code></a>) if the <tt class=
"option">assert-valid</tt> option is <tt class="literal">true</tt>
and the input document is not valid. If the <tt class=
"option">assert-valid</tt> option is <tt class=
"literal">false</tt>, it is not an error for the document to be
invalid. In this case, if the implementation does not support the
PSVI, <tt class="tag-element">p:validate-with-xml-schema</tt> is
essentially just an “identity” step, but if the implementation
<em>does</em> support the PSVI, then the resulting document will
have additional type information (at least for the subtrees that
are valid).</p>
<p>When XML Schema validation assessment is performed, the
processor is invoked in the mode specified by the <tt class=
"option">mode</tt> option. <a name="err.inline.C0055" id=
"err.inline.C0055"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0055"><code class="errqname">err:XC0055</code></a>) if the
implementation does not support the specified mode.</p>
<p>The <tt class="port">result</tt> of the assessment is a document
with the Post-Schema-Validation-Infoset (PSVI) ([<a href=
"#xmlschema-1"><span class="abbrev">W3C XML Schema: Part
1</span></a>]) annotations, if the pipeline implementation supports
such annotations. If not, the input document is reproduced with any
defaulting of attributes and elements performed as specified by the
XML Schema recommendation.</p>
</div>
<div class="section">
<h5><a name="c.www-form-urldecode" id=
"c.www-form-urldecode"></a>7.2.7&#160;p:www-form-urldecode</h5>
<p>The <tt class="tag-element">p:www-form-urldecode</tt> step
decodes a <tt class="literal">x-www-form-urlencoded</tt> string
into a set of parameters.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urldecode</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The <tt class="option">value</tt> option is interpreted as a
string of parameter values encoded using the <tt class=
"literal">x-www-form-urlencoded</tt> algorithm. It turns each such
encoded name/value pair into a parameter. The entire set of
parameters is written (as a <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a>) on the <tt class=
"port">result</tt> output port.</p>
<p><a name="err.inline.C0037" id="err.inline.C0037"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0037"><code class=
"errqname">err:XC0037</code></a>) if the <tt class=
"option">value</tt> provided is not a properly <tt class=
"literal">x-www-form-urlencoded</tt> value. <a name=
"err.inline.C0061" id="err.inline.C0061"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0061"><code class=
"errqname">err:XC0061</code></a>) if the name of any encoded
parameter name is not a valid <tt class="type">xs:NCName</tt>. In
other words, this step can only decode simple name/value pairs
where the names do not contain colons or any characters that cannot
be used in XML names.</p>
<p>The order of the <a href="#cv.param"><tt class=
"tag-element">c:param</tt></a> elements in the result is the same
as the order of the encoded parameters, reading from left to
right.</p>
<p>If any parameter name occurs more than once in the encoded
string, the resulting parameter set will contain a <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> for each
instance. However, only one of these will actually be used if the
parameter set is passed to another step on its <em class=
"glossterm"><a href="#dt-parameter-input-port">parameter input
port</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.www-form-urlencode" id=
"c.www-form-urlencode"></a>7.2.8&#160;p:www-form-urlencode</h5>
<p>The <tt class="tag-element">p:www-form-urlencode</tt> step
encodes a set of parameter values as a <tt class=
"literal">x-www-form-urlencoded</tt> string and injects it into the
<tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urlencode</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern.</p>
<p>The set of parameters is encoded as a single <tt class=
"literal">x-www-form-urlencoded</tt> string of name/value pairs.
When parameters are encoded into name/value pairs, <em>only</em>
the local name of each parameter is used. The namespace name is
ignored and no prefix or colon appears in the name.</p>
<p>The parameters are encoded in document order. That is, the first
parameter appears first in the resulting string, the second
parameter second, etc. reading from left to right.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
encoded string is used in the output. Nodes that do not match are
copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the encoded string is used as
the new value of the attribute in the output. If the expression
matches any other kind of node, the entire node (and <em>not</em>
just its contents) is replaced by the encoded string.</p>
</div>
<div class="section">
<h5><a name="c.xquery" id="c.xquery"></a>7.2.9&#160;p:xquery</h5>
<p>The <tt class="tag-element">p:xquery</tt> step applies an
[<a href="#xquery10"><span class="abbrev">XQuery 1.0</span></a>]
query to the sequence of documents provided on the <tt class=
"port">source</tt> port.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xquery</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">query</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>If a sequence of documents is provided on the <tt class=
"port">source</tt> port, the first document is used as the initial
context item. The whole sequence is also the default collection. If
no documents are provided on the <tt class="port">source</tt> port,
the initial context item is undefined and the default collection is
empty.</p>
<p>The <tt class="port">query</tt> port must receive a single
document:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the document root element is <a href="#cv.query"><tt class=
"tag-element" id="cv.query">c:query</tt></a>, the text descendants
of this element are considered the query.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:query&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:query&gt;</code></p>
</li>
<li>
<p>If the document root element is in the XQueryX namespace, the
document is treated as an XQueryX-encoded query. <a name="impl-59"
id="impl-59"></a>Support for XQueryX is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</li>
<li>
<p>If the document root element is <a href="#p.data"><tt class=
"tag-element">c:data</tt></a> and either does not have a <tt class=
"tag-attribute">content-type</tt> attribute or has a <tt class=
"tag-attribute">content-type</tt> attribute that specifies a text
content type or a media type that the implementation recognizes,
then the text descendants of this element are considered the
query.</p>
</li>
<li>
<p>If the document root element is not <a href="#p.data"><tt class=
"tag-element">c:data</tt></a> but has a <tt class=
"tag-attribute">c:content-type</tt> attribute that specifies a text
content type or a media type that the implementation recognizes,
then the text descendants of this element are considered the
query.</p>
</li>
<li>
<p><a name="impl-60" id="impl-60"></a>Otherwise, the interpretation
of the query is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</li>
</ul>
</div>
<p>The result of the <tt class="tag-element">p:xquery</tt> step
must be a sequence of documents. <a name="err.inline.C0057" id=
"err.inline.C0057"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0057"><code class="errqname">err:XC0057</code></a>) if the
sequence that results from evaluating the XQuery contains items
other than documents and elements. Any elements that appear in the
result sequence will be treated as documents with the element as
their document element.</p>
<p>For example:</p>
<div class="programlisting">
<pre>
&lt;c:query&gt;
declare namespace atom="http://www.w3.org/2005/Atom";
/atom:feed/atom:entry
&lt;/c:query&gt;
</pre></div>
<p>The output of this step <span class="rfc2119">may</span> include
PSVI annotations.</p>
<p>The static context of the XQuery processor is augmented in the
following way:</p>
<div class="variablelist">
<dl>
<dt>Statically known default collection type</dt>
<dd>
<p><tt class="literal">document()*</tt></p>
</dd>
<dt>Statically known namespaces:</dt>
<dd>
<p>Unchanged from the implementation defaults. No namespace
declarations in the XProc pipeline are automatically exposed in the
static context.</p>
</dd>
</dl>
</div>
<p>The dynamic context of the XQuery processor is augmented in the
following way:</p>
<div class="variablelist">
<dl>
<dt>Context item</dt>
<dd>
<p>The first document that appears on the <tt class=
"port">source</tt> port.</p>
</dd>
<dt>Context position</dt>
<dd>
<p><tt class="literal">1</tt></p>
</dd>
<dt>Context size</dt>
<dd>
<p><tt class="literal">1</tt></p>
</dd>
<dt>Variable values</dt>
<dd>
<p>Any parameters passed on the <tt class="port">parameters</tt>
port augment any implementation-defined variable bindings known to
the XQuery processor. The parameter values are passed to the XQuery
processor as values of type <tt class=
"type">xs:untypedAtomic</tt>.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The function implementations provided by the XQuery
processor.</p>
</dd>
<dt>Current dateTime</dt>
<dd>
<p><a name="impl-61" id="impl-61"></a>The point in time returned as
the current dateTime is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Implicit timezone</dt>
<dd>
<p><a name="impl-62" id="impl-62"></a>The implicit timezone is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Available documents</dt>
<dd>
<p><a name="impl-63" id="impl-63"></a>The set of available
documents (those that may be retrieved with a URI) is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Available collections</dt>
<dd>
<p><a name="impl-64" id="impl-64"></a>The set of available
collections is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>The sequence of documents provided on the <tt class=
"port">source</tt> port.</p>
</dd>
</dl>
</div>
<div class="section">
<h6><a name="example-xquery" id=
"example-xquery"></a>7.2.9.1&#160;Example</h6>
<p>The following pipeline applies XInclude processing and schema
validation before using XQuery:</p>
<div class="example-wrapper" id="ex.c.xquery">
<div class="title">Example&#160;11.&#160;A Sample Pipeline
Document</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:xinclude/&gt;
&lt;p:validate-with-xml-schema name="validate"&gt;
&lt;p:input port="schema"&gt;
&lt;p:document href="http://example.com/path/to/schema.xsd"/&gt;
&lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;
&lt;p:xquery&gt;
&lt;p:input port="query"&gt;
&lt;p:data href="countp.xq" /&gt;
&lt;/p:input&gt;
&lt;/p:xquery&gt;
&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p>Where <tt class="filename">countp.xq</tt> might contain:</p>
<div class="programlisting">
<pre>
&lt;count&gt;{count(.//p)}&lt;/count&gt;
</pre></div>
</div>
</div>
<div class="section">
<h5><a name="c.xsl-formatter" id=
"c.xsl-formatter"></a>7.2.10&#160;p:xsl-formatter</h5>
<p>The <tt class="tag-element">p:xsl-formatter</tt> step receives
an [<a href="#xsl11"><span class="abbrev">XSL 1.1</span></a>]
document and renders the content. The result of rendering is stored
to the URI provided via the <tt class="option">href</tt> option. A
reference to that result is produced on the output port.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xsl-formatter</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">href</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. If it is relative, it is made absolute against
the base URI of the element on which it is specified (<a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<tt class="tag-element">p:xsl-formatter</tt> in the case of a
<a href="#option-shortcut">syntactic shortcut</a> value).</p>
<p>The content-type of the output is controlled by the <tt class=
"option">content-type</tt> option. This option specifies a media
type as defined by [<a href="#media-types"><span class=
"abbrev">IANA Media Types</span></a>]. The option may include media
type parameters as well (e.g. "application/someformat;
charset=UTF-8"). <a name="impl-65" id="impl-65"></a>The use of
media type parameters on the <tt class="option">content-type</tt>
option is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><a name="impl-66" id="impl-66"></a>If the <tt class=
"option">content-type</tt> option is not specified, the output type
is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. The
default <span class="rfc2119">should</span> be PDF.</p>
<p><a name="impl-67" id="impl-67"></a>A formatter may take any
number of optional rendering parameters via the step's parameters;
such parameters are defined by the XSL implementation used and are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>The output of this step is a document containing a single
<a href="#cv.result"><tt class="tag-element">c:result</tt></a>
element whose content is the absolute URI of the document stored by
the step.</p>
</div>
</div>
<div class="section">
<h4><a name="serialization-options" id=
"serialization-options"></a>7.3&#160;Serialization Options</h4>
<p>Several steps in this step library require serialization options
to control the serialization of XML. These options are used to
control serialization as in the [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification.</p>
<p>The following options may be present on steps that perform
serialization:</p>
<div class="variablelist">
<dl>
<dt><tt class="option">byte-order-mark</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean. If it's not specified, the default varies by encoding: for
UTF-16 it's true, for all others, it's false.</p>
</dd>
<dt><tt class="option">cdata-section-elements</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
list of <tt class="type">QName</tt>s. They are interpreted as
elements name.</p>
</dd>
<dt><tt class="option">doctype-public</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
string. The public identifier of the doctype.</p>
</dd>
<dt><tt class="option">doctype-system</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be an
<tt class="type">anyURI</tt>. The system identifier of the doctype.
It need not be absolute, and is not resolved.</p>
</dd>
<dt><tt class="option">encoding</tt></dt>
<dd>
<p>A character set name. <a name="impl-68" id="impl-68"></a>If no
<tt class="option">encoding</tt> is specified, the encoding used is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation defined</a></em>. If
the <tt class="option">method</tt> is “<tt class=
"literal">xml</tt>” or “<tt class="literal">xhtml</tt>”, the
implementation defined encoding <span class="rfc2119">must</span>
be either UTF-8 or UTF-16.</p>
</dd>
<dt><tt class="option">escape-uri-attributes</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean. It is ignored unless the specified method is “<tt class=
"literal">xhtml</tt>” or “<tt class="literal">html</tt>”.</p>
</dd>
<dt><tt class="option">include-content-type</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean. It is ignored unless the specified method is “<tt class=
"literal">xhtml</tt>” or “<tt class="literal">html</tt>”.</p>
</dd>
<dt><tt class="option">indent</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean.</p>
</dd>
<dt><tt class="option">media-type</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
string. It specifies the media type (MIME content type). If not
specified, the default varies according to the <tt class=
"option">method</tt>:</p>
<div class="variablelist">
<dl>
<dt><tt class="literal">xml</tt></dt>
<dd>
<p><tt class="literal">application/xml</tt></p>
</dd>
<dt><tt class="literal">html</tt></dt>
<dd>
<p><tt class="literal">text/html</tt></p>
</dd>
<dt><tt class="literal">xhtml</tt></dt>
<dd>
<p><tt class="literal">application/xhtml+xml</tt></p>
</dd>
<dt><tt class="literal">text</tt></dt>
<dd>
<p><tt class="literal">text/plain</tt></p>
</dd>
</dl>
</div>
<p><a name="impl-69" id="impl-69"></a>For methods other than
<tt class="literal">xml</tt>, <tt class="literal">html</tt>,
<tt class="literal">xhtml</tt>, and <tt class="literal">text</tt>;
the <tt class="option">media-type</tt> is <em class=
"glossterm"><a href="#dt-implementation-defined">implementation
defined</a></em>.</p>
</dd>
<dt><tt class="option">method</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
<tt class="type">QName</tt>. It specifies the serialization
method.</p>
</dd>
<dt><tt class="option">normalization-form</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be an
NMTOKEN, one of the enumerated values <tt class="code">NFC</tt>,
<tt class="code">NFD</tt>, <tt class="code">NFKC</tt>, <tt class=
"code">NFKD</tt>, <tt class="code">fully-normalized</tt>,
<tt class="code">none</tt> or an implementation-defined value.</p>
</dd>
<dt><tt class="option">omit-xml-declaration</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean.</p>
</dd>
<dt><tt class="option">standalone</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be an
NMTOKEN, one of the enumerated values <tt class="code">true</tt>,
<tt class="code">false</tt>, or <tt class="code">omit</tt>.</p>
</dd>
<dt><tt class="option">undeclare-prefixes</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean.</p>
</dd>
<dt><tt class="option">version</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
string.</p>
</dd>
</dl>
</div>
<p>In order to be consistent with the rest of this specification,
boolean values for the serialization parameters must use one of the
XML Schema lexical forms for boolean: "true", "false", "1", or "0".
This is different from the [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification which uses “yes” and “no”. No change in semantics is
implied by this different spelling.</p>
<p>The <tt class="option">method</tt> option controls the
serialization method used by this component with standard values of
'html', 'xml', 'xhtml', and 'text' but only the 'xml' value is
required to be supported. The interpretation of the remaining
options is as specified in [<a href=
"#xml-serialization"><span class=
"abbrev">Serialization</span></a>].</p>
<p><a name="impl-70" id="impl-70"></a>Implementations may support
other method values but their results are <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>A minimally conforming implementation must support the
<tt class="code">xml</tt> output method with the following option
values:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The <tt class="code">version</tt> must support the value
<tt class="code">1.0</tt>.</p>
</li>
<li>
<p>The <tt class="code">encoding</tt> must support the values
<tt class="code">UTF-8</tt>.</p>
</li>
<li>
<p>The <tt class="code">omit-xml-declaration</tt> must be
supported. If the value is not specified or has the value
<tt class="code">no</tt>, an XML declaration must be produced.</p>
</li>
</ul>
</div>
<p>All other option values may be ignored for the <tt class=
"code">xml</tt> output method.</p>
<p>If a processor chooses to implement an option for serialization,
it must conform to the semantics defined in the [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The use-character-maps parameter in [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification has not been provided in the standard serialization
options provided by this specification.</p>
</div>
</div>
</div>
<div class="appendix">
<h2><a name="conformance" id=
"conformance"></a>A&#160;Conformance</h2>
<p>Conformant processors <span class="rfc2119">must</span>
implement all of the features described in this specification
except those that are explicitly identified as optional.</p>
<p>Some aspects of processor behavior are not completely specified;
those features are either <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em> or
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><span class="termdef" id=
"dt-implementation-dependent">[Definition: An <em class=
"glossterm">implementation-dependent</em> feature is one where the
implementation has discretion in how it is performed.
Implementations are not required to document or explain how
<em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>
features are performed.]</span></p>
<p><span class="termdef" id=
"dt-implementation-defined">[Definition: An <em class=
"glossterm">implementation-defined</em> feature is one where the
implementation has discretion in how it is performed. Conformant
implementations <span class="rfc2119">must</span> document how
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
features are performed.]</span></p>
<div class="section">
<h3><a name="implementation-defined" id=
"implementation-defined"></a>A.1&#160;Implementation-defined
features</h3>
<p>The following features are implementation-defined:</p>
<ol class="features">
<li>It is implementation-defined what additional step types, if
any, are provided. See <a href="#step-concept" title=
"Steps">Section&#160;2.1, “Steps”</a>.</li>
<li>How inputs are connected to XML documents outside the pipeline
is implementation-defined. See <a href="#input-output" title=
"Inputs and Outputs">Section&#160;2.2, “Inputs and
Outputs”</a>.</li>
<li>How pipeline outputs are connected to XML documents outside the
pipeline is implementation-defined. See <a href="#input-output"
title="Inputs and Outputs">Section&#160;2.2, “Inputs and
Outputs”</a>.</li>
<li>In Version 1.0 of XProc, how (or if) implementers provide local
resolution mechanisms and how (or if) they provide access to
intermediate results by URI is implementation-defined. See <a href=
"#external-docs" title="External Documents">Section&#160;2.2.1,
“External Documents”</a>.</li>
<li>Except for cases which are specifically called out in , the
extent to which namespace fixup, and other checks for outputs which
cannot be serialized, are performed on intermediate outputs is
implementation-defined. See <a href="#namespace-fixup" title=
"Namespace Fixup on Outputs">Section&#160;2.4.1, “Namespace Fixup
on Outputs”</a>.</li>
<li>If no version is specified on the step or among its ancestors,
then its XPath version is implementation-defined. See <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>.</li>
<li>The version of Unicode supported is implementation-defined, but
it is recommended that the most recent version of Unicode be used.
See <a href="#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The point in time returned as the current dateTime is
implementation-defined. See <a href="#xproc-xpath-context-20"
title="Processor XPath Context">Section&#160;2.6.2.1, “Processor
XPath Context”</a>.</li>
<li>The implicit timezone is implementation-defined. See <a href=
"#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The implicit timezone is implementation-defined. See <a href=
"#step-xpath-context-20" title=
"Step XPath Context">Section&#160;2.6.2.2, “Step XPath
Context”</a>.</li>
<li>The exact format of the language string is
implementation-defined but should be consistent with the xml:lang
attribute. See <a href="#f.system-property" title=
"System Properties">Section&#160;2.7.1, “System
Properties”</a>.</li>
<li>It is implementation-defined if the processor supports any
other XPath extension functions. See <a href=
"#other-xpath-extension-functions" title=
"Other XPath Extension Functions">Section&#160;2.7.10, “Other XPath
Extension Functions”</a>.</li>
<li>Whether or not the pipeline processor supports passing PSVI
annotations between steps is implementation-defined. See <a href=
"#psvi-support" title="PSVIs in XProc">Section&#160;2.8, “PSVIs in
XProc”</a>.</li>
<li>The exact PSVI properties that are preserved when documents are
passed between steps is implementation-defined. See <a href=
"#psvi-support" title="PSVIs in XProc">Section&#160;2.8, “PSVIs in
XProc”</a>.</li>
<li>It is implementation-defined what PSVI properties, if any, are
produced by extension steps. See <a href="#psvi-support" title=
"PSVIs in XProc">Section&#160;2.8, “PSVIs in XProc”</a>.</li>
<li>How outside values are specified for pipeline options on the
pipeline initially invoked by the processor is
implementation-defined. See <a href="#options" title=
"Options">Section&#160;2.10, “Options”</a>.</li>
<li>How outside values are specified for pipeline parameters on the
pipeline initially invoked by the processor is
implementation-defined. See <a href="#parameters" title=
"Parameters">Section&#160;2.11, “Parameters”</a>.</li>
<li>Support for pipeline documents written in XML 1.1 and pipeline
inputs and outputs that use XML 1.1 is implementation-defined. See
<a href="#syntax" title="Syntax Overview">Section&#160;3, “Syntax
Overview”</a>.</li>
<li>The semantics of p:pipeinfo elements are
implementation-defined. See <a href="#annotations" title=
"Processor annotations">Section&#160;3.7, “Processor
annotations”</a>.</li>
<li>The set of URI schemes actually supported is
implementation-defined. See <a href="#common-errors" title=
"Common errors">Section&#160;3.11, “Common errors”</a>.</li>
<li>The presence of other compound steps is implementation-defined;
XProc provides no standard mechanism for defining them or
describing what they can contain. See <a href="#p.extension" title=
"Extension Steps">Section&#160;4.8, “Extension Steps”</a>.</li>
<li>If the href attribute is not specified, the location of the log
file or files is implementation-defined. See <a href="#p.log"
title="p:log">Section&#160;5.5, “p:log”</a>.</li>
<li>How each document or sequence of documents is represented in a
p:log is implementation-defined. See <a href="#p.log" title=
"p:log">Section&#160;5.5, “p:log”</a>.</li>
<li>The default value of any serialization options not specified on
a particular p:serialization element is implementation-defined. See
<a href="#p.serialization" title=
"p:serialization">Section&#160;5.6, “p:serialization”</a>.</li>
<li>When a declared step is evaluated directly by the XProc
processor (as opposed to occurring as an atomic step in some
container), how the input and output ports are connected to
documents is implementation-defined. See <a href="#p.declare-step"
title="p:declare-step">Section&#160;5.8, “p:declare-step”</a>.</li>
<li>The subpipeline may include declarations of additional steps
(e.g., other pipelines or other step types that are provided by a
particular implementation or in some implementation-defined way)
and import other pipelines. See <a href="#declare-pipelines" title=
"Declaring pipelines">Section&#160;5.8.2, “Declaring
pipelines”</a>.</li>
<li>Conformant processors must support directory paths whose scheme
is file. It is implementation-defined what other schemes are
supported by p:directory-list, and what the interpretation of
'directory', 'file' and 'contents' is for those schemes. See
<a href="#c.directory-list" title=
"p:directory-list">Section&#160;7.1.6, “p:directory-list”</a>.</li>
<li>Any file or directory determined to be special by the
p:directory-list step may be output using a c:other element but the
criteria for marking a file as special are implementation-defined.
See <a href="#c.directory-list" title=
"p:directory-list">Section&#160;7.1.6, “p:directory-list”</a>.</li>
<li>Any attributes other than name on c:file, c:directory, or
c:other are implementation-defined. See <a href="#c.directory-list"
title="p:directory-list">Section&#160;7.1.6,
“p:directory-list”</a>.</li>
<li>The interpretation of auth-method values on c:request other
than “Basic” or “Digest” is implementation-defined. See <a href=
"#cv.request" title="Specifying a request">Section&#160;7.1.10.1,
“Specifying a request”</a>.</li>
<li>An implementation may support encodings other than base64 but
these encodings and their names are implementation-defined. See
<a href="#c.request_body" title=
"Request Entity body conversion">Section&#160;7.1.10.2, “Request
Entity body conversion”</a>.</li>
<li>Pipeline authors that need to preserve cookies across several
p:http-request calls in the same pipeline or across multiple
invocations of the same or different pipelines will have to rely on
implementation-defined mechanisms. See <a href="#cookies" title=
"Cookies">Section&#160;7.1.10.3.2, “Cookies”</a>.</li>
<li>Behavior of p:unescape-markup for content-types other than
application/xml is implementation-defined. See <a href=
"#c.unescape-markup" title="p:unescape-markup">Section&#160;7.1.26,
“p:unescape-markup”</a>.</li>
<li>If cwd is not specified, the current working directory is
implementation-defined. See <a href="#c.exec" title=
"p:exec">Section&#160;7.2.1, “p:exec”</a>.</li>
<li>It is implementation-defined what other algorithms are
supported. See <a href="#c.hash" title="p:hash">Section&#160;7.2.2,
“p:hash”</a>.</li>
<li>If the version is not specified, the version of UUID computed
is implementation-defined. See <a href="#c.uuid" title=
"p:uuid">Section&#160;7.2.3, “p:uuid”</a>.</li>
<li>Support for other versions of UUID, and the mechanism by which
the necessary inputs are made available for computing other
versions, is implementation-defined. See <a href="#c.uuid" title=
"p:uuid">Section&#160;7.2.3, “p:uuid”</a>.</li>
<li>It is implementation-defined if the documents supplied on the
schemas port are considered when resolving xs:include elements in
the schema documents provided. See <a href=
"#c.validate-with-xml-schema" title=
"p:validate-with-xml-schema">Section&#160;7.2.6,
“p:validate-with-xml-schema”</a>.</li>
<li>Support for XQueryX is implementation-defined. See <a href=
"#c.xquery" title="p:xquery">Section&#160;7.2.9,
“p:xquery”</a>.</li>
<li>Otherwise, the interpretation of the query is
implementation-defined. See <a href="#c.xquery" title=
"p:xquery">Section&#160;7.2.9, “p:xquery”</a>.</li>
<li>The point in time returned as the current dateTime is
implementation-defined. See <a href="#c.xquery" title=
"p:xquery">Section&#160;7.2.9, “p:xquery”</a>.</li>
<li>The implicit timezone is implementation-defined. See <a href=
"#c.xquery" title="p:xquery">Section&#160;7.2.9,
“p:xquery”</a>.</li>
<li>The use of media type parameters on the content-type option is
implementation-defined. See <a href="#c.xsl-formatter" title=
"p:xsl-formatter">Section&#160;7.2.10, “p:xsl-formatter”</a>.</li>
<li>If the content-type option is not specified, the output type is
implementation-defined. See <a href="#c.xsl-formatter" title=
"p:xsl-formatter">Section&#160;7.2.10, “p:xsl-formatter”</a>.</li>
<li>A formatter may take any number of optional rendering
parameters via the step's parameters; such parameters are defined
by the XSL implementation used and are implementation-defined. See
<a href="#c.xsl-formatter" title=
"p:xsl-formatter">Section&#160;7.2.10, “p:xsl-formatter”</a>.</li>
<li>Implementations may support other method values but their
results are implementation-defined. See <a href=
"#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>.</li>
<li>It is implementation-defined whether additional information
items and properties, particularly those made available in the
PSVI, are preserved between steps. See <a href=
"#infoset-conformance" title=
"Infoset Conformance">Section&#160;A.3, “Infoset
Conformance”</a>.</li>
</ol>
</div>
<div class="section">
<h3><a name="implementation-dependent" id=
"implementation-dependent"></a>A.2&#160;Implementation-dependent
features</h3>
<p>The following features are implementation-dependent:</p>
<ol class="features">
<li>The evaluation order of steps not connected to one another is
implementation-dependent See <a href="#pipeline-concepts" title=
"Pipeline Concepts">Section&#160;2, “Pipeline Concepts”</a>.</li>
<li>Outside of a try/catch, the disposition of error messages is
implementation-dependent See <a href="#input-output" title=
"Inputs and Outputs">Section&#160;2.2, “Inputs and
Outputs”</a>.</li>
<li>Resolving a URI locally may involve resolvers of various sorts
and possibly appeal to implementation-dependent mechanisms such as
catalog files. See <a href="#external-docs" title=
"External Documents">Section&#160;2.2.1, “External
Documents”</a>.</li>
<li>Whether (and when and how) or not the intermediate results that
pass between steps are ever written to a filesystem is
implementation-dependent. See <a href="#external-docs" title=
"External Documents">Section&#160;2.2.1, “External
Documents”</a>.</li>
<li>The results of computing the union of namespaces in the
presence of conflicting declarations for a particular prefix are
implementation-dependent. See <a href="#step-xpath-context-10"
title="Step XPath Context">Section&#160;2.6.1.2, “Step XPath
Context”</a>.</li>
<li>The set of available documents (those that may be retrieved
with a URI) is implementation-dependent. See <a href=
"#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The set of available collections is implementation-dependent.
See <a href="#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The set of available documents (those that may be retrieved
with a URI) is implementation-dependent. See <a href=
"#step-xpath-context-20" title=
"Step XPath Context">Section&#160;2.6.2.2, “Step XPath
Context”</a>.</li>
<li>Which steps are forbidden, what privileges are needed to access
resources, and under what circumstances these security constraints
apply is implementation-dependent. See <a href=
"#security-considerations" title=
"Security Considerations">Section&#160;2.12, “Security
Considerations”</a>.</li>
<li>The value of the p:episode system property in a use-when
expression is implementation-dependent. See <a href="#use-when"
title="Conditional Element Exclusion">Section&#160;3.9,
“Conditional Element Exclusion”</a>.</li>
<li>The results of testing for steps not in the XProc namespace in
a use-when expression are implementation-dependent. See <a href=
"#use-when" title="Conditional Element Exclusion">Section&#160;3.9,
“Conditional Element Exclusion”</a>.</li>
<li>The ability of a step to read the p:log output of some former
step is implementation-dependent. See <a href="#p.log" title=
"p:log">Section&#160;5.5, “p:log”</a>.</li>
<li>Implementations may use extension attributes to provide
implementation-dependent information about a declared step. See
<a href="#declare-atomic-steps" title=
"Declaring atomic steps">Section&#160;5.8.1, “Declaring atomic
steps”</a>.</li>
<li>If no content type was specified or is associated with the
resource, the inferred content type is implementation-dependent.
See <a href="#p.data" title="p:data">Section&#160;5.14,
“p:data”</a>.</li>
<li>The interpretation of a multipart message inside another
multipart message is implementation-dependent. See <a href=
"#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</li>
<li>If the IRI reference specified by the base-uri option on
p:make-absolute-uris is not valid, or if it is absent and the input
document has no base URI, the results are implementation-dependent.
See <a href="#c.make-absolute-uris" title=
"p:make-absolute-uris">Section&#160;7.1.15,
“p:make-absolute-uris”</a>.</li>
<li>The order in which c:param elements occur in the c:param-set is
implementation-dependent. See <a href="#c.parameters" title=
"p:parameters">Section&#160;7.1.18, “p:parameters”</a>.</li>
<li>How XSLT message termination errors are reported to the XProc
processor is implementation-dependent. See <a href="#c.xslt" title=
"p:xslt">Section&#160;7.1.31, “p:xslt”</a>.</li>
<li>The specific exit status values returned by a process invoked
with p:exec are implementation-dependent. See <a href="#c.exec"
title="p:exec">Section&#160;7.2.1, “p:exec”</a>.</li>
<li>The set of available documents (those that may be retrieved
with a URI) is implementation-dependent. See <a href="#c.xquery"
title="p:xquery">Section&#160;7.2.9, “p:xquery”</a>.</li>
<li>The set of available collections is implementation-dependent.
See <a href="#c.xquery" title="p:xquery">Section&#160;7.2.9,
“p:xquery”</a>.</li>
</ol>
</div>
<div class="section">
<h3><a name="infoset-conformance" id=
"infoset-conformance"></a>A.3&#160;Infoset Conformance</h3>
<p>This specification conforms to the XML Information Set [<a href=
"#xml-infoset-rec"><span class="abbrev">Infoset</span></a>]. The
information corresponding to the following information items and
properties must be available to the processor for the documents
that flow through the pipeline.</p>
<div class="itemizedlist">
<ul>
<li>
<p>The <tt class="literal">Document Information Item</tt> with
<tt class="literal">[base URI]</tt> and <tt class=
"literal">[children]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Element Information Items</tt> with
<tt class="literal">[base URI]</tt>, <tt class=
"literal">[children]</tt>, <tt class="literal">[attributes]</tt>,
<tt class="literal">[in-scope namespaces]</tt>, <tt class=
"literal">[prefix]</tt>, <tt class="literal">[local name]</tt>,
<tt class="literal">[namespace name]</tt>, <tt class=
"literal">[parent]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Attribute Information Items</tt> with
<tt class="literal">[namespace name]</tt>, <tt class=
"literal">[prefix]</tt>, <tt class="literal">[local name]</tt>,
<tt class="literal">[normalized value]</tt>, <tt class=
"literal">[attribute type]</tt>, and <tt class="literal">[owner
element]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Character Information Items</tt> with
<tt class="literal">[character code]</tt>, <tt class=
"literal">[parent]</tt>, and, optionally, <tt class=
"literal">[element content whitespace]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Processing Instruction Information
Items</tt> with <tt class="literal">[base URI]</tt>, <tt class=
"literal">[target]</tt>, <tt class="literal">[content]</tt> and
<tt class="literal">[parent]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Comment Information Items</tt> with
<tt class="literal">[content]</tt> and <tt class=
"literal">[parent]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Namespace Information Items</tt> with
<tt class="literal">[prefix]</tt> and <tt class=
"literal">[namespace name]</tt> properties.</p>
</li>
</ul>
</div>
<p><a name="impl-71" id="impl-71"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
whether additional information items and properties, particularly
those made available in the PSVI, are preserved between steps.</p>
</div>
</div>
<div class="appendix">
<h2><a name="references" id="references"></a>B&#160;References</h2>
<div class="section">
<h3><a name="normative-references" id=
"normative-references"></a>B.1&#160;Normative References</h3>
<div class="bibliolist">
<div class="bibliomixed" id="use-cases">
<p>[<span class="abbrev">XProc Requirements</span>] <a href=
"http://www.w3.org/TR/xproc-requirements/"><span class=
"citetitle"><cite>XML Processing Model Requirements and Use
Cases</cite></span></a>. Alex Milowski, editor. W3C Working Draft
11 April 2006.</p>
</div>
<div class="bibliomixed" id="xml-infoset-rec">
<p>[<span class="abbrev">Infoset</span>] <a href=
"http://www.w3.org/TR/xml-infoset/"><span class=
"citetitle"><cite>XML Information Set (Second
Edition)</cite></span></a>. John Cowan, Richard Tobin, editors. W3C
Working Group Note 04 February 2004.</p>
</div>
<div class="bibliomixed" id="xml10">
<p>[<span class="abbrev">XML 1.0</span>] <a href=
"http://www.w3.org/TR/REC-xml/"><span class=
"citetitle"><cite>Extensible Markup Language (XML) 1.0 (Fifth
Edition)</cite></span></a>. Tim Bray, Jean Paoli, C. M.
Sperberg-McQueen, et. al. editors. W3C Recommendation 26 November
2008.</p>
</div>
<div class="bibliomixed" id="xmlns10">
<p>[<span class="abbrev">Namespaces 1.0</span>] <a href=
"http://www.w3.org/TR/REC-xml-names/"><span class=
"citetitle"><cite>Namespaces in XML 1.0 (Third
Edition)</cite></span></a>. Tim Bray, Dave Hollander, Andrew
Layman, et. al., editors. W3C Recommendation 8 December 2009.</p>
</div>
<div class="bibliomixed" id="xml11">
<p>[<span class="abbrev">XML 1.1</span>] <a href=
"http://www.w3.org/TR/xml11/"><span class=
"citetitle"><cite>Extensible Markup Language (XML) 1.1 (Second
Edition)</cite></span></a>. Tim Bray, Jean Paoli, C. M.
Sperberg-McQueen, et. al. editors. W3C Recommendation 16 August
2006.</p>
</div>
<div class="bibliomixed" id="xmlns11">
<p>[<span class="abbrev">Namespaces 1.1</span>] <a href=
"http://www.w3.org/TR/xml-names11/"><span class=
"citetitle"><cite>Namespaces in XML 1.1 (Second
Edition)</cite></span></a>. Tim Bray, Dave Hollander, Andrew
Layman, et. al., editors. W3C Recommendation 16 August 2006.</p>
</div>
<div class="bibliomixed" id="xpath">
<p>[<span class="abbrev">XPath 1.0</span>] <a href=
"http://www.w3.org/TR/xpath"><span class="citetitle"><cite>XML Path
Language (XPath) Version 1.0</cite></span></a>. James Clark and
Steve DeRose, editors. W3C Recommendation. 16 November 1999.</p>
</div>
<div class="bibliomixed" id="xslt10">
<p>[<span class="abbrev">XSLT 1.0</span>] <a href=
"http://www.w3.org/TR/xslt"><span class="citetitle"><cite>XSL
Transformations (XSLT) Version 1.0</cite></span></a>. James Clark,
editor. W3C Recommendation. 16 November 1999.</p>
</div>
<div class="bibliomixed" id="xpath2">
<p>[<span class="abbrev">XPath 2.0</span>] <a href=
"http://www.w3.org/TR/xpath20/"><span class="citetitle"><cite>XML
Path Language (XPath) 2.0</cite></span></a>. Anders Berglund, Scott
Boag, Don Chamberlin, et. al., editors. W3C Recommendation. 23
January 2007.</p>
</div>
<div class="bibliomixed" id="xpath-datamodel">
<p>[<span class="abbrev">XQuery 1.0 and XPath 2.0 Data Model
(XDM)</span>] <a href=
"http://www.w3.org/TR/xpath-datamodel/"><span class=
"citetitle"><cite>XQuery 1.0 and XPath 2.0 Data Model
(XDM)</cite></span></a>. Mary Fernández, Ashok Malhotra, Jonathan
Marsh, <em class="foreignphrase">et. al.</em>, editors. W3C
Recommendation. 23 January 2007.</p>
</div>
<div class="bibliomixed" id="xpath-functions">
<p>[<span class="abbrev">XPath 2.0 Functions and Operators</span>]
<a href="http://www.w3.org/TR/xpath-functions/"><span class=
"citetitle"><cite>XQuery 1.0 and XPath 2.0 Functions and
Operators</cite></span></a>. Ashok Malhotra, Jim Melton, and Norman
Walsh, editors. W3C Recommendation. 23 January 2007.</p>
</div>
<div class="bibliomixed" id="xslt20">
<p>[<span class="abbrev">XSLT 2.0</span>] <a href=
"http://www.w3.org/TR/xslt20/"><span class="citetitle"><cite>XSL
Transformations (XSLT) Version 2.0</cite></span></a>. Michael Kay,
editor. W3C Recommendation. 23 January 2007.</p>
</div>
<div class="bibliomixed" id="xsl11">
<p>[<span class="abbrev">XSL 1.1</span>] <a href=
"http://www.w3.org/TR/xsl/"><span class=
"citetitle"><cite>Extensible Stylesheet Language (XSL) Version
1.1</cite></span></a>. Anders Berglund, editor. W3C Recommendation.
5 December 2006.</p>
</div>
<div class="bibliomixed" id="xquery10">
<p>[<span class="abbrev">XQuery 1.0</span>] <a href=
"http://www.w3.org/TR/xquery/"><span class="citetitle"><cite>XQuery
1.0: An XML Query Language</cite></span></a>. Scott Boag, Don
Chamberlin, Mary Fernández, et. al., editors. W3C Recommendation.
23 January 2007.</p>
</div>
<div class="bibliomixed" id="iso19757-2">
<p>[<span class="abbrev">RELAX NG</span>] ISO/IEC JTC 1/SC 34.
<a href=
"http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=52348">
<span class="citetitle"><cite>ISO/IEC 19757-2:2008(E) Document
Schema Definition Language (DSDL) -- Part 2: Regular-grammar-based
validation -- RELAX NG</cite></span></a> 2008.</p>
</div>
<div class="bibliomixed" id="relaxng-compact-syntax">
<p>[<span class="abbrev">RELAX NG Compact Syntax</span>] ISO/IEC
JTC 1/SC 34. <span class="citetitle"><cite>ISO/IEC 19757-2:2003/Amd
1:2006 Document Schema Definition Languages (DSDL) — Part 2:
Grammar-based validation — RELAX NG AMENDMENT 1 Compact
Syntax</cite></span> 2006.</p>
</div>
<div class="bibliomixed" id="relaxng-dtd-compat">
<p>[<span class="abbrev">RELAX NG DTD Compatibility</span>]
<span class="citetitle"><cite>RELAX NG DTD
Compatibility</cite></span>. OASIS Committee Specification. 3
December 2001.</p>
</div>
<div class="bibliomixed" id="iso19757-3">
<p>[<span class="abbrev">Schematron</span>] ISO/IEC JTC 1/SC 34.
<span class="citetitle"><cite>ISO/IEC 19757-3:2006(E) Document
Schema Definition Languages (DSDL) — Part 3: Rule-based validation
— Schematron</cite></span> 2006.</p>
</div>
<div class="bibliomixed" id="xmlschema-1">
<p>[<span class="abbrev">W3C XML Schema: Part 1</span>] <a href=
"http://www.w3.org/TR/xmlschema-1/"><span class=
"citetitle"><cite>XML Schema Part 1: Structures Second
Edition</cite></span></a>. Henry S. Thompson, David Beech, Murray
Maloney, et. al., editors. World Wide Web Consortium, 28 October
2004.</p>
</div>
<div class="bibliomixed" id="xmlschema-2">
<p>[<span class="abbrev">W3C XML Schema: Part 2</span>] <a href=
"http://www.w3.org/TR/xmlschema-2/"><span class=
"citetitle"><cite>XML Schema Part 2: Datatypes Second
Edition</cite></span></a>. Paul V. Biron and Ashok Malhotra,
editors. World Wide Web Consortium, 28 October 2004.</p>
</div>
<div class="bibliomixed" id="xml-id">
<p>[<span class="abbrev">xml:id</span>] <a href=
"http://www.w3.org/TR/xml-id/"><span class="citetitle"><cite>xml:id
Version 1.0</cite></span></a>. Jonathan Marsh, Daniel Veillard, and
Norman Walsh, editors. W3C Recommendation. 9 September 2005.</p>
</div>
<div class="bibliomixed" id="xinclude">
<p>[<span class="abbrev">XInclude</span>] <a href=
"http://www.w3.org/TR/xinclude/"><span class="citetitle"><cite>XML
Inclusions (XInclude) Version 1.0 (Second
Edition)</cite></span></a>. Jonathan Marsh, David Orchard, and
Daniel Veillard, editors. W3C Recommendation. 15 November 2006.</p>
</div>
<div class="bibliomixed" id="xml-base">
<p>[<span class="abbrev">XML Base</span>] <a href=
"http://www.w3.org/TR/xmlbase/"><span class="citetitle"><cite>XML
Base (Second Edition)</cite></span></a>. Jonathan Marsh and Richard
Tobin, editors. W3C Recommendation. 28 January 2009.</p>
</div>
<div class="bibliomixed" id="xptr-framework">
<p>[<span class="abbrev">XPointer Framework</span>] <a href=
"http://www.w3.org/TR/xptr-framework/"><span class=
"citetitle"><cite>XPointer Framework</cite></span></a>. Paul
Grosso, Eve Maler, Jonathan Marsh, et. al., editors. W3C
Recommendation. 25 March 2003.</p>
</div>
<div class="bibliomixed" id="xptr-element">
<p>[<span class="abbrev">XPointer element() Scheme</span>] <a href=
"http://www.w3.org/TR/xptr-element/"><span class=
"citetitle"><cite>XPointer element() Scheme</cite></span></a>. Paul
Grosso, Eve Maler, Jonathan Marsh, et. al., editors. W3C
Recommendation. 25 March 2003.</p>
</div>
<div class="bibliomixed" id="xml-serialization">
<p>[<span class="abbrev">Serialization</span>] <a href=
"http://www.w3.org/TR/xslt-xquery-serialization/"><span class=
"citetitle"><cite>XSLT 2.0 and XQuery 1.0
Serialization</cite></span></a>. Scott Boag, Michael Kay, Joanne
Tong, Norman Walsh, and Henry Zongaro, editors. W3C Recommendation.
23 January 2007.</p>
</div>
<div class="bibliomixed" id="rfc1321">
<p>[<span class="abbrev">MD5</span>] <a href=
"http://www.ietf.org/rfc/rfc1321.txt"><span class=
"citetitle"><cite>RFC 1321: The MD5 Message-Digest
Algorithm</cite></span></a>. R. Rivest. Network Working Group,
IETF, April 1992.</p>
</div>
<div class="bibliomixed" id="rfc1521">
<p>[<span class="abbrev">RFC 1521</span>] <a href=
"http://www.ietf.org/rfc/rfc1521.txt"><span class=
"citetitle"><cite>RFC 1521: MIME (Multipurpose Internet Mail
Extensions) Part One: Mechanisms for Specifying and Describing the
Format of Internet Message Bodies</cite></span></a>. N. Borenstein,
N. Freed, editors. Internet Engineering Task Force. September,
1993.</p>
</div>
<div class="bibliomixed" id="rfc2119">
<p>[<span class="abbrev">RFC 2119</span>] <a href=
"http://www.ietf.org/rfc/rfc2119.txt"><span class=
"citetitle"><cite>Key words for use in RFCs to Indicate Requirement
Levels</cite></span></a>. S. Bradner. Network Working Group, IETF,
Mar 1997.</p>
</div>
<div class="bibliomixed" id="rfc2396">
<p>[<span class="abbrev">RFC 2396</span>] <a href=
"http://www.ietf.org/rfc/rfc2396.txt"><span class=
"citetitle"><cite>Uniform Resource Identifiers (URI): Generic
Syntax</cite></span></a>. T. Berners-Lee, R. Fielding, and L.
Masinter. Network Working Group, IETF, Aug 1998.</p>
</div>
<div class="bibliomixed" id="rfc2616">
<p>[<span class="abbrev">RFC 2616</span>] <a href=
"http://www.ietf.org/rfc/rfc2616.txt"><span class=
"citetitle"><cite>RFC 2616: Hypertext Transfer Protocol —
HTTP/1.1</cite></span></a>. R. Fielding, J. Gettys, J. Mogul, et.
al., editors. Internet Engineering Task Force. June, 1999.</p>
</div>
<div class="bibliomixed" id="rfc2617">
<p>[<span class="abbrev">RFC 2617</span>] <a href=
"http://www.ietf.org/rfc/rfc2617.txt"><span class=
"citetitle"><cite>RFC 2617: HTTP Authentication: Basic and Digest
Access Authentication</cite></span></a>. J. Franks, P.
Hallam-Baker, J. Hostetler, S. Lawrence, P. Leach, A. Luotonen, L.
Stewart. June, 1999 .</p>
</div>
<div class="bibliomixed" id="rfc3023">
<p>[<span class="abbrev">RFC 3023</span>] <a href=
"http://www.ietf.org/rfc/rfc3023.txt"><span class=
"citetitle"><cite>RFC 3023: XML Media Types</cite></span></a>. M.
Murata, S. St. Laurent, and D. Kohn, editors. Internet Engineering
Task Force. January, 2001.</p>
</div>
<div class="bibliomixed" id="rfc3548">
<p>[<span class="abbrev">RFC 3548</span>] <a href=
"http://www.ietf.org/rfc/rfc3548.txt"><span class=
"citetitle"><cite>RFC 3548: The Base16, Base32, and Base64 Data
Encodings</cite></span></a>. S. Josefsson, Editor. Internet
Engineering Task Force. July, 2003.</p>
</div>
<div class="bibliomixed" id="rfc3986">
<p>[<span class="abbrev">RFC 3986</span>] <a href=
"http://www.ietf.org/rfc/rfc3986.txt"><span class=
"citetitle"><cite>RFC 3986: Uniform Resource Identifier (URI):
General Syntax</cite></span></a>. T. Berners-Lee, R. Fielding, and
L. Masinter, editors. Internet Engineering Task Force. January,
2005.</p>
</div>
<div class="bibliomixed" id="rfc3987">
<p>[<span class="abbrev">RFC 3987</span>] <a href=
"http://www.ietf.org/rfc/rfc3987.txt"><span class=
"citetitle"><cite>RFC 3987: Internationalized Resource Identifiers
(IRIs)</cite></span></a>. M. Duerst and M. Suignard, editors.
Internet Engineering Task Force. January, 2005.</p>
</div>
<div class="bibliomixed" id="unicodetr17">
<p>[<span class="abbrev">Unicode TR#17</span>] <a href=
"http://unicode.org/reports/tr17/"><span class=
"citetitle"><cite>Unicode Technical Report #17: Character Encoding
Model</cite></span></a>. Ken Whistler, Mark Davis, and Asmus
Freytag, authors. The Unicode Consortium. 11 November 2008.</p>
</div>
<div class="bibliomixed" id="media-types">
<p>[<span class="abbrev">IANA Media Types</span>] <a href=
"http://www.iana.org/assignments/media-types/"><span class=
"citetitle"><cite>IANA MIME Media Types</cite></span></a>. Internet
Engineering Task Force.</p>
</div>
<div class="bibliomixed" id="tidy">
<p>[<span class="abbrev">HTML Tidy</span>] <a href=
"http://tidy.sourceforge.net/"><span class="citetitle"><cite>HTML
Tidy Library Project</cite></span></a>. SourceForge project.</p>
</div>
<div class="bibliomixed" id="tagsoup">
<p>[<span class="abbrev">TagSoup</span>] <a href=
"http://ccil.org/~cowan/XML/tagsoup/"><span class=
"citetitle"><cite>TagSoup - Just Keep On
Truckin'</cite></span></a>. John Cowan.</p>
</div>
<div class="bibliomixed" id="bib.uuid">
<p>[<span class="abbrev">UUID</span>] <a href=
"http://www.itu.int/ITU-T/studygroups/com17/oid.html"><span class=
"citetitle"><cite>ITU X.667: Information technology - Open Systems
Interconnection - Procedures for the operation of OSI Registration
Authorities: Generation and registration of Universally Unique
Identifiers (UUIDs) and their use as ASN.1 Object Identifier
components</cite></span></a>. 2004.</p>
</div>
<div class="bibliomixed" id="bib.sha">
<p>[<span class="abbrev">SHA1</span>] <a href=
"http://www.itl.nist.gov/fipspubs/fip180-1.htm"><span class=
"citetitle"><cite>Federal Information Processing Standards
Publication 180-1: Secure Hash Standard</cite></span></a>.
1995.</p>
</div>
</div>
</div>
<div class="section">
<h3><a name="informative-references" id=
"informative-references"></a>B.2&#160;Informative References</h3>
<div class="bibliolist">
<div class="bibliomixed" id="rfc4122">
<p>[<span class="abbrev">RFC 4122</span>] <a href=
"http://www.ietf.org/rfc/rfc4122.txt"><span class=
"citetitle"><cite>RFC 4122: A Universally Unique IDentifier (UUID)
URN Namespace</cite></span></a>. P. Leach and M. Mealling, editors.
Internet Engineering Task Force. July, 2005.</p>
</div>
<div class="bibliomixed" id="bib.crc">
<p>[<span class="abbrev">CRC32</span>] “32-Bit Cyclic Redundancy
Codes for Internet Applications”, <span class="citetitle"><cite>The
International Conference on Dependable Systems and Networks:
459</cite></span>. <span class=
"biblioid">10.1109/DSN.2002.1028931</span>. P. Koopman. June
2002.</p>
</div>
</div>
</div>
</div>
<div class="appendix">
<h2><a name="glossary" id="glossary"></a>C&#160;Glossary</h2>
<div class="glosslist">
<dl>
<dt><em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em></dt>
<dd>
<p>Unless otherwise noted, the term <em class=
"firstterm">Namespaces in XML</em> refers equally to [<a href=
"#xmlns10"><span class="abbrev">Namespaces 1.0</span></a>] and
[<a href="#xmlns11"><span class="abbrev">Namespaces
1.1</span></a>].</p>
</dd>
<dt><em class="glossterm"><a href="#dt-XML">XML</a></em></dt>
<dd>
<p>XProc is intended to work equally well with [<a href=
"#xml10"><span class="abbrev">XML 1.0</span></a>] and [<a href=
"#xml11"><span class="abbrev">XML 1.1</span></a>]. Unless otherwise
noted, the term “<em class="firstterm">XML</em>” refers equally to
both versions.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-ancestors">ancestors</a></em></dt>
<dd>
<p>The <em class="firstterm">ancestors</em> of a step, if it has
any, are its <em class="glossterm"><a href=
"#dt-container">container</a></em> and the ancestors of its
container.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-atomic-step">atomic
step</a></em></dt>
<dd>
<p>An <em class="firstterm">atomic step</em> is a step that
performs a unit of XML processing, such as XInclude or
transformation, and has no internal <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-bag-merger">bag-merger</a></em></dt>
<dd>
<p>The <em class="firstterm">bag-merger</em> of two or more bags
(where a bag is an unordered list or, equivalently, something like
a set except that it may contain duplicates) is a bag constructed
by starting with an empty bag and adding each member of each of the
input bags in turn to it. It follows that the cardinality of the
result is the sum of the cardinality of all the input bags.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-by-source">by
source</a></em></dt>
<dd>
<p>A document is specified <em class="firstterm">by source</em> if
it references a specific port on another step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-by-URI">by URI</a></em></dt>
<dd>
<p>A document is specified <em class="firstterm">by URI</em> if it
is referenced with a URI.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-compound-step">compound
step</a></em></dt>
<dd>
<p>A <em class="firstterm">compound step</em> is a step that
contains a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-connection">connection</a></em></dt>
<dd>
<p>A <em class="firstterm">connection</em> associates an input or
output port with some data source.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em></dt>
<dd>
<p>The steps that occur directly within, or within non-step
wrappers directly within, a step are called that step's <em class=
"firstterm">contained steps</em>. In other words, “container” and
“contained steps” are inverse relationships.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-container">container</a></em></dt>
<dd>
<p>A compound step or multi-container step is a <em class=
"firstterm">container</em> for the steps directly within it or
within non-step wrappers directly within it.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-declared-inputs">declared
inputs</a></em></dt>
<dd>
<p>The input ports declared on a step are its <em class=
"firstterm">declared inputs</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-declared-options">declared
options</a></em></dt>
<dd>
<p>The options declared on a step are its <em class=
"firstterm">declared options</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-declared-outputs">declared
outputs</a></em></dt>
<dd>
<p>The output ports declared on a step are its <em class=
"firstterm">declared outputs</em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em></dt>
<dd>
<p>The <em class="firstterm">default readable port</em>, which may
be undefined, is a specific step name/port name pair from the set
of readable ports.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em></dt>
<dd>
<p>A <em class="firstterm">dynamic error</em> is one which occurs
while a pipeline is being evaluated.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-empty-environment">empty
environment</a></em></dt>
<dd>
<p>The <em class="firstterm">empty environment</em> contains no
readable ports, an undefined default readable port and no in-scope
bindings.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-empty-sequence">empty
sequence</a></em></dt>
<dd>
<p>An <em class="firstterm">empty sequence</em> of documents is
specified with the <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a> element.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-environment">environment</a></em></dt>
<dd>
<p>The <em class="firstterm">environment</em> is a
context-dependent collection of information available within
subpipelines.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-extension-attribute">extension attribute</a></em></dt>
<dd>
<p>An element from the XProc namespace <span class=
"rfc2119">may</span> have any attribute not from the XProc
namespace, provided that the expanded-QName of the attribute has a
non-null namespace URI. Such an attribute is called an <em class=
"firstterm">extension attribute</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em></dt>
<dd>
<p>The <em class="firstterm">in-scope bindings</em> are a set of
name-value pairs, based on <em class="glossterm"><a href=
"#dt-option">option</a></em> and <em class="glossterm"><a href=
"#dt-variable">variable</a></em> bindings.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em></dt>
<dd>
<p>The <em class="firstterm">inherited environment</em> of a
<em class="glossterm"><a href="#dt-contained-steps">contained
step</a></em> is an environment that is the same as the environment
of its <em class="glossterm"><a href=
"#dt-container">container</a></em> with the <a href=
"#dt-standard-modifications">standard modifications</a>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-inline-document">inline
document</a></em></dt>
<dd>
<p>An <em class="firstterm">inline document</em> is specified
directly in the body of the element to which it connects.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-last-step">last
step</a></em></dt>
<dd>
<p>The <em class="firstterm">last step</em> in a subpipeline is its
last step in document order.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-matches">matches</a></em></dt>
<dd>
<p>A step <em class="firstterm">matches</em> its signature if and
only if it specifies an input for each declared input, it specifies
no inputs that are not declared, it specifies an option for each
option that is declared to be required, and it specifies no options
that are not declared.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-multi-container-step">multi-container step</a></em></dt>
<dd>
<p>A <em class="firstterm">multi-container step</em> is a step that
contains several alternate <em class="glossterm"><a href=
"#dt-subpipeline">subpipelines</a></em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-namespace-fixup">namespace
fixup</a></em></dt>
<dd>
<p>To produce a serializable <em class="glossterm"><a href=
"#dt-XML">XML</a></em> document, the XProc processor must sometimes
add additional namespace nodes, perhaps even renaming prefixes, to
satisfy the constraints of <em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em>. This process is
referred to as <em class="firstterm">namespace fixup</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-option">option</a></em></dt>
<dd>
<p>An <em class="firstterm">option</em> is a name/value pair where
the name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-parameter">parameter</a></em></dt>
<dd>
<p>A <em class="firstterm">parameter</em> is a name/value pair
where the name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-parameter-input-port">parameter input port</a></em></dt>
<dd>
<p>A <em class="firstterm">parameter input port</em> is a
distinguished kind of input port which accepts (only) dynamically
constructed parameter name/value pairs.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-pipeline">pipeline</a></em></dt>
<dd>
<p>A <em class="firstterm">pipeline</em> is a set of connected
steps, with outputs of one step flowing into inputs of another.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em></dt>
<dd>
<p>If a step has a parameter input port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
parameter input port and that port is <em>not</em> explicitly
marked “<tt class="code">primary='false'</tt>”, then that parameter
input port is the <em class="firstterm">primary parameter input
port</em> of the step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-primary-input-port">primary
input port</a></em></dt>
<dd>
<p>If a step has a document input port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document input port and that port is <em>not</em> explicitly marked
<tt class="code">primary='false'</tt>”, then that input port is
the <em class="firstterm">primary input port</em> of the step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em></dt>
<dd>
<p>If a step has a document output port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document output port and that port is <em>not</em> explicitly
marked “<tt class="code">primary='false'</tt>”, then that output
port is the <em class="firstterm">primary output port</em> of the
step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em></dt>
<dd>
<p>The <em class="firstterm">readable ports</em> are a set of step
name/port name pairs.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-signature">signature</a></em></dt>
<dd>
<p>The <em class="firstterm">signature</em> of a step is the set of
inputs, outputs, and options that it is declared to accept.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-specified-options">specified
options</a></em></dt>
<dd>
<p>The options on a step which have specified values, either
because a <a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> element specifies a value or
because the declaration included a default value, are its
<em class="firstterm">specified options</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-static-error">static
error</a></em></dt>
<dd>
<p>A <em class="firstterm">static error</em> is one which can be
detected before pipeline evaluation is even attempted.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-step">step</a></em></dt>
<dd>
<p>A <em class="firstterm">step</em> is the basic computational
unit of a pipeline.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-step-type-exports">step type
exports</a></em></dt>
<dd>
<p>The <em class="firstterm">step type exports</em> of an XProc
element, against the background of a set of URIs of resources
already visited (call this set <em>Visited</em>), are defined by
cases.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em></dt>
<dd>
<p>Sibling steps (and the connections between them) form a
<em class="firstterm">subpipeline</em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-variable">variable</a></em></dt>
<dd>
<p>A <em class="firstterm">variable</em> is a name/value pair where
the name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-visible">visible</a></em></dt>
<dd>
<p>If two names are in the same scope, we say that they are
<em class="firstterm">visible</em> to each other.</p>
</dd>
</dl>
</div>
</div>
<div class="appendix">
<h2><a name="language-summary" id=
"language-summary"></a>D&#160;Pipeline Language Summary</h2>
<p>This appendix summarizes the XProc pipeline language. Machine
readable descriptions of this language are available in <a href=
"schemas/xproc.rng">RELAX NG</a> (and the RELAX NG <a href=
"schemas/xproc.rnc">compact syntax</a>), <a href=
"schemas/xproc.xsd">W3C XML Schema</a>, and <a href=
"schemas/xproc.dtd">DTD</a> syntaxes.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeline<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.pipeline">p:pipeline</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;<var>subpipeline</var><br />
&lt;/p:pipeline&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:for-each<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.iteration-source">p:iteration-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:for-each&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;<strong>match</strong> =
<var>XSLTMatchPattern</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.viewport-source">p:viewport-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.output">p:output</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>?),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:viewport&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:choose<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.when">p:when</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.otherwise">p:otherwise</a>?)<br />
&lt;/p:choose&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:xpath-context&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)<br />
&lt;/p:xpath-context&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:when<br />
&#160;&#160;<strong>test</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;(<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:when&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:otherwise&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:otherwise&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:group<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:group&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:try<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.group">p:group</a>,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.catch">p:catch</a>)<br />
&lt;/p:try&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:catch<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:catch&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>p:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>p:atomic-step</var>&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>pfx:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>pfx:atomic-step</var>&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;kind? = "document"<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;<strong>kind</strong> = "parameter"&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:iteration-source<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:iteration-source&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport-source&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)?<br />
&lt;/p:viewport-source&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:output&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:log<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:serialization<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;byte-order-mark? = <var>boolean</var><br />
&#160;&#160;cdata-section-elements? = <var>NMTOKENS</var><br />
&#160;&#160;doctype-public? = <var>string</var><br />
&#160;&#160;doctype-system? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;escape-uri-attributes? = <var>boolean</var><br />
&#160;&#160;include-content-type? = <var>boolean</var><br />
&#160;&#160;indent? = <var>boolean</var><br />
&#160;&#160;media-type? = <var>string</var><br />
&#160;&#160;method? = <var>QName</var><br />
&#160;&#160;normalization-form? =
<var>NFC|NFD|NFKC|NFKD|fully-normalized|none|xs:NMTOKEN</var><br />
&#160;&#160;omit-xml-declaration? = <var>boolean</var><br />
&#160;&#160;standalone? = <var>true|false|omit</var><br />
&#160;&#160;undeclare-prefixes? = <var>boolean</var><br />
&#160;&#160;version? = <var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:variable<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:variable&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-option&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var><br />
&#160;&#160;port? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-param&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:namespaces<br />
&#160;&#160;binding? = <var>QName</var><br />
&#160;&#160;element? = <var>XPathExpression</var><br />
&#160;&#160;except-prefixes? = <var>prefix
list</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:declare-step<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)?<br />
&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:library<br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.import">p:import</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a>)*<br />
&lt;/p:library&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:import<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipe<br />
&#160;&#160;<strong>step</strong> = <var>NCName</var><br />
&#160;&#160;<strong>port</strong> =
<var>NCName</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:inline<br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix
list</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var><br />
&lt;/p:inline&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:document<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:data<br />
&#160;&#160;<strong>href</strong> = <var>anyURI</var><br />
&#160;&#160;wrapper? = <var>QName</var><br />
&#160;&#160;wrapper-prefix? = <var>string</var><br />
&#160;&#160;wrapper-namespace? = <var>string</var><br />
&#160;&#160;content-type? = <var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:empty&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:documentation&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:documentation&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeinfo&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:pipeinfo&gt;</code></p>
<p>The core steps are also summarized here.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-attribute</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-value</code><code>"</code>
<code class="attr required-attr">required</code><code>="</code><code class="value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-xml-base</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">all</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">relative</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:compare</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fail-if-not-equal</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:count</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">limit</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">0</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:delete</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:directory-list</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">exclude-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:error</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:escape-markup</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:filter</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">select</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:http-request</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:identity</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:insert</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">insertion</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'/*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">position</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"first-child"
| "last-child" | "before" | "after"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:label-elements</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml:id'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">label</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'concat("_",$p:index)'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:load</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-validate</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:make-absolute-uris</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:namespace-rename</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">from</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">to</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">apply-to</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'all'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"all"
| "elements" | "attributes"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:pack</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:parameters</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:rename</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:replace</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">replacement</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:set-attributes</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">attributes</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:sink</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:split-sequence</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">not-matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-only</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">test</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:store</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:string-replace</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unescape-markup</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'application/xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">charset</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unwrap</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap-sequence</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xinclude</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-base</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-lang</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xslt</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">stylesheet</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">secondary</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-mode</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">template-name</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">output-base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>As are the optional steps.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:exec</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">errors</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">exit-status</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">command</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">args</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cwd</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">source-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">result-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-result-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">errors-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-error-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path-separator</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">failure-threshold</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">arg-separator</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'
'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:hash</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">algorithm</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:uuid</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-relax-ng</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-attribute-values</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-id-idref-warnings</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-schematron</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">report</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">phase</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'#ALL'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-xml-schema</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">use-location-hints</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">try-namespaces</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">mode</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'strict'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"strict"
| "lax"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urldecode</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urlencode</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xquery</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">query</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xsl-formatter</code><code>"</code><code>&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>And the step vocabulary elements.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;namespace? = <var>anyURI</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param-set&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.param">c:param</a>*<br />
&lt;/c:param-set&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:data<br />
&#160;&#160;content-type? = <var>string</var><br />
&#160;&#160;charset? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:data&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:result&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:result&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:directory<br />
&#160;&#160;<strong>name</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.file">c:file</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.directory">c:directory</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.other">c:other</a>)*<br />
&lt;/c:directory&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:file<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:other<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:request<br />
&#160;&#160;<strong>method</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var><br />
&#160;&#160;detailed? = <var>boolean</var><br />
&#160;&#160;status-only? = <var>boolean</var><br />
&#160;&#160;username? = <var>string</var><br />
&#160;&#160;password? = <var>string</var><br />
&#160;&#160;auth-method? = <var>string</var><br />
&#160;&#160;send-authorization? = <var>boolean</var><br />
&#160;&#160;override-content-type? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:request&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:header<br />
&#160;&#160;<strong>name</strong> = <var>string</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:multipart<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;<strong>boundary</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.body">c:body</a>+<br />
&lt;/c:multipart&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:body<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;id? = <var>string</var><br />
&#160;&#160;description? = <var>string</var><br />
&#160;&#160;disposition? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var>*<br />
&lt;/c:body&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:response<br />
&#160;&#160;status? = <var>integer</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:response&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:line&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:line&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:query&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:query&gt;</code></p>
</div>
<div class="appendix">
<h2><a name="errors-list" id="errors-list"></a>E&#160;List of Error
Codes</h2>
<p>The following error codes are defined by this specification.</p>
<div class="section">
<h3><a name="app.static-errors" id=
"app.static-errors"></a>E.1&#160;Static Errors</h3>
<p>The following <em class="glossterm"><a href=
"#dt-static-error">static errors</a></em> are defined:</p>
<div id="static-error-summary">
<h5>Static Errors</h5>
<dl class="errs">
<dt><a name="err.S0001" id="err.S0001"></a><code class=
"errqname">err:XS0001</code></dt>
<dd>
<p>It is a static error if there are any loops in the connections
between steps: no step can be connected to itself nor can there be
any sequence of connections through other steps that leads back to
itself.</p>
<p>See: <a href="#err.inline.S0001">Connections</a></p>
</dd>
<dt><a name="err.S0002" id="err.S0002"></a><code class=
"errqname">err:XS0002</code></dt>
<dd>
<p>All steps in the same scope must have unique names: it is a
static error if two steps with the same name appear in the same
scope.</p>
<p>See: <a href="#err.inline.S0002">Scoping of Names</a></p>
</dd>
<dt><a name="err.S0003" id="err.S0003"></a><code class=
"errqname">err:XS0003</code></dt>
<dd>
<p>It is a static error if any declared input is not connected.</p>
<p>See: <a href="#err.inline.S0003">Inputs and Outputs</a></p>
</dd>
<dt><a name="err.S0004" id="err.S0004"></a><code class=
"errqname">err:XS0004</code></dt>
<dd>
<p>It is a static error if an option or variable declaration
duplicates the name of any other option or variable in the same
environment.</p>
<p>See: <a href="#err.inline.S0004">Scoping of Names</a>, <a href=
"#err.inline.S0004.1">p:option</a>, <a href=
"#err.inline.S0004.2">p:with-option</a></p>
</dd>
<dt><a name="err.S0005" id="err.S0005"></a><code class=
"errqname">err:XS0005</code></dt>
<dd>
<p>It is a static error if the primary output port of any step is
not connected.</p>
<p>See: <a href="#err.inline.S0005">Inputs and Outputs</a></p>
</dd>
<dt><a name="err.S0006" id="err.S0006"></a><code class=
"errqname">err:XS0006</code></dt>
<dd>
<p>It is a static error if the primary output port has no explicit
connection and the last step in the subpipeline does not have a
primary output port.</p>
<p>See: <a href="#err.inline.S0006">p:for-each</a>, <a href=
"#err.inline.S0006.1">p:viewport</a>, <a href=
"#err.inline.S0006.2">Declaring pipelines</a></p>
</dd>
<dt><a name="err.S0007" id="err.S0007"></a><code class=
"errqname">err:XS0007</code></dt>
<dd>
<p>It is a static error if two subpipelines in a p:choose declare
different outputs.</p>
<p>See: <a href="#err.inline.S0007">p:choose</a></p>
</dd>
<dt><a name="err.S0008" id="err.S0008"></a><code class=
"errqname">err:XS0008</code></dt>
<dd>
<p>It is a static error if any element in the XProc namespace has
attributes not defined by this specification unless they are
extension attributes.</p>
<p>See: <a href="#err.inline.S0008">Common errors</a></p>
</dd>
<dt><a name="err.S0009" id="err.S0009"></a><code class=
"errqname">err:XS0009</code></dt>
<dd>
<p>It is a static error if the p:group and p:catch subpipelines
declare different outputs.</p>
<p>See: <a href="#err.inline.S0009">p:try</a></p>
</dd>
<dt><a name="err.S0010" id="err.S0010"></a><code class=
"errqname">err:XS0010</code></dt>
<dd>
<p>It is a static error if a pipeline contains a step whose
specified inputs, outputs, and options do not match the signature
for steps of that type.</p>
<p>See: <a href="#err.inline.S0010">Extension Steps</a></p>
</dd>
<dt><a name="err.S0011" id="err.S0011"></a><code class=
"errqname">err:XS0011</code></dt>
<dd>
<p>It is a static error to identify two ports with the same name on
the same step.</p>
<p>See: <a href="#err.inline.S0011">Document Inputs</a>, <a href=
"#err.inline.S0011.1">Parameter Inputs</a>, <a href=
"#err.inline.S0011.2">p:output</a></p>
</dd>
<dt><a name="err.S0014" id="err.S0014"></a><code class=
"errqname">err:XS0014</code></dt>
<dd>
<p>It is a static error to identify more than one output port as
primary.</p>
<p>See: <a href="#err.inline.S0014">p:output</a></p>
</dd>
<dt><a name="err.S0015" id="err.S0015"></a><code class=
"errqname">err:XS0015</code></dt>
<dd>
<p>It is a static error if a compound step has no contained
steps.</p>
<p>See: <a href="#err.inline.S0015">Common errors</a></p>
</dd>
<dt><a name="err.S0017" id="err.S0017"></a><code class=
"errqname">err:XS0017</code></dt>
<dd>
<p>It is a static error to specify that an option is both required
and has a default value.</p>
<p>See: <a href="#err.inline.S0017">p:option</a></p>
</dd>
<dt><a name="err.S0018" id="err.S0018"></a><code class=
"errqname">err:XS0018</code></dt>
<dd>
<p>If an option is required, it is a static error to invoke the
step without specifying a value for that option.</p>
<p>See: <a href="#err.inline.S0018">p:option</a></p>
</dd>
<dt><a name="err.S0019" id="err.S0019"></a><code class=
"errqname">err:XS0019</code></dt>
<dd>
<p>it is a static error for a variable's document connection to
refer to the output port of any step in the surrounding container's
contained steps</p>
<p>See: <a href="#err.inline.S0019">p:variable</a></p>
</dd>
<dt><a name="err.S0020" id="err.S0020"></a><code class=
"errqname">err:XS0020</code></dt>
<dd>
<p>It is a static error if the binding attribute on p:namespaces is
specified and its value is not the name of an in-scope binding.</p>
<p>See: <a href="#err.inline.S0020">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.S0022" id="err.S0022"></a><code class=
"errqname">err:XS0022</code></dt>
<dd>
<p>In all cases except the p:output of a compound step, it is a
static error if the port identified by a p:pipe is not in the
readable ports of the step that contains the p:pipe.</p>
<p>See: <a href="#err.inline.S0022">p:pipe</a></p>
</dd>
<dt><a name="err.S0024" id="err.S0024"></a><code class=
"errqname">err:XS0024</code></dt>
<dd>
<p>It is a static error if the content of the p:inline element does
not consist of exactly one element, optionally preceded and/or
followed by any number of processing instructions, comments or
whitespace characters.</p>
<p>See: <a href="#err.inline.S0024">p:inline</a></p>
</dd>
<dt><a name="err.S0025" id="err.S0025"></a><code class=
"errqname">err:XS0025</code></dt>
<dd>
<p>It is a static error if the expanded-QName value of the type
attribute is in no namespace or in the XProc namespace.</p>
<p>See: <a href="#err.inline.S0025">p:declare-step</a></p>
</dd>
<dt><a name="err.S0026" id="err.S0026"></a><code class=
"errqname">err:XS0026</code></dt>
<dd>
<p>It is a static error if the port specified on the p:log is not
the name of an output port on the step in which it appears or if
more than one p:log element is applied to the same port.</p>
<p>See: <a href="#err.inline.S0026">p:log</a></p>
</dd>
<dt><a name="err.S0027" id="err.S0027"></a><code class=
"errqname">err:XS0027</code></dt>
<dd>
<p>It is a static error if an option is specified with both the
shortcut form and the long form.</p>
<p>See: <a href="#err.inline.S0027">Syntactic Shortcut for Option
Values</a></p>
</dd>
<dt><a name="err.S0028" id="err.S0028"></a><code class=
"errqname">err:XS0028</code></dt>
<dd>
<p>It is a static error to declare an option or variable in the
XProc namespace.</p>
<p>See: <a href="#err.inline.S0028">p:variable</a>, <a href=
"#err.inline.S0028.1">p:option</a></p>
</dd>
<dt><a name="err.S0029" id="err.S0029"></a><code class=
"errqname">err:XS0029</code></dt>
<dd>
<p>It is a static error to specify a connection for a p:output
inside a p:declare-step for an atomic step.</p>
<p>See: <a href="#err.inline.S0029">p:output</a></p>
</dd>
<dt><a name="err.S0030" id="err.S0030"></a><code class=
"errqname">err:XS0030</code></dt>
<dd>
<p>It is a static error to specify that more than one input port is
the primary.</p>
<p>See: <a href="#err.inline.S0030">Document Inputs</a>, <a href=
"#err.inline.S0030.1">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0031" id="err.S0031"></a><code class=
"errqname">err:XS0031</code></dt>
<dd>
<p>It is a static error to use an option on an atomic step that is
not declared on steps of that type.</p>
<p>See: <a href="#err.inline.S0031">Syntactic Shortcut for Option
Values</a>, <a href="#err.inline.S0031.1">p:with-option</a></p>
</dd>
<dt><a name="err.S0032" id="err.S0032"></a><code class=
"errqname">err:XS0032</code></dt>
<dd>
<p>It is a static error if no connection is provided and the
default readable port is undefined.</p>
<p>See: <a href="#err.inline.S0032">Document Inputs</a></p>
</dd>
<dt><a name="err.S0033" id="err.S0033"></a><code class=
"errqname">err:XS0033</code></dt>
<dd>
<p>It is a static error to specify any kind of input other than
“document” or “parameter”.</p>
<p>See: <a href="#err.inline.S0033">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0034" id="err.S0034"></a><code class=
"errqname">err:XS0034</code></dt>
<dd>
<p>It is a static error if the specified port is not a parameter
input port or if no port is specified and the step does not have a
primary parameter input port.</p>
<p>See: <a href="#err.inline.S0034">p:with-param</a></p>
</dd>
<dt><a name="err.S0035" id="err.S0035"></a><code class=
"errqname">err:XS0035</code></dt>
<dd>
<p>It is a static error if the declaration of a parameter input
port contains a connection; parameter input port declarations must
be empty.</p>
<p>See: <a href="#err.inline.S0035">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0036" id="err.S0036"></a><code class=
"errqname">err:XS0036</code></dt>
<dd>
<p>All the step types in a pipeline or library must have unique
names: it is a static error if any step type name is built-in
and/or declared or defined more than once in the same scope.</p>
<p>See: <a href="#err.inline.S0036">Scoping of Names</a>, <a href=
"#err.inline.S0036.1">Handling Circular and Re-entrant Library
Imports (Non-Normative)</a>, <a href="#err.inline.S0036.2">Handling
Circular and Re-entrant Library Imports (Non-Normative)</a>,
<a href="#err.inline.S0036.3">Handling Circular and Re-entrant
Library Imports (Non-Normative)</a></p>
</dd>
<dt><a name="err.S0037" id="err.S0037"></a><code class=
"errqname">err:XS0037</code></dt>
<dd>
<p>It is a static error if any step directly contains text nodes
that do not consist entirely of whitespace.</p>
<p>See: <a href="#err.inline.S0037">Common errors</a></p>
</dd>
<dt><a name="err.S0038" id="err.S0038"></a><code class=
"errqname">err:XS0038</code></dt>
<dd>
<p>It is a static error if any required attribute is not
provided.</p>
<p>See: <a href="#err.inline.S0038">Common errors</a></p>
</dd>
<dt><a name="err.S0039" id="err.S0039"></a><code class=
"errqname">err:XS0039</code></dt>
<dd>
<p>It is a static error if the port specified on the
p:serialization is not the name of an output port on the pipeline
in which it appears or if more than one p:serialization element is
applied to the same port.</p>
<p>See: <a href="#err.inline.S0039">p:serialization</a></p>
</dd>
<dt><a name="err.S0040" id="err.S0040"></a><code class=
"errqname">err:XS0040</code></dt>
<dd>
<p>It is a static error to specify any value other than true.</p>
<p>See: <a href="#err.inline.S0040">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0041" id="err.S0041"></a><code class=
"errqname">err:XS0041</code></dt>
<dd>
<p>It is a static error to specify both binding and element on the
same p:namespaces element.</p>
<p>See: <a href="#err.inline.S0041">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.S0042" id="err.S0042"></a><code class=
"errqname">err:XS0042</code></dt>
<dd>
<p>It is a static error to attempt to provide a connection for an
input port on the declaration of an atomic step.</p>
<p>See: <a href="#err.inline.S0042">Document Inputs</a></p>
</dd>
<dt><a name="err.S0044" id="err.S0044"></a><code class=
"errqname">err:XS0044</code></dt>
<dd>
<p>It is a static error if any element in the XProc namespace or
any step has element children other than those specified for it by
this specification. In particular, the presence of atomic steps for
which there is no visible declaration may raise this error.</p>
<p>See: <a href="#err.inline.S0044">Common errors</a></p>
</dd>
<dt><a name="err.S0048" id="err.S0048"></a><code class=
"errqname">err:XS0048</code></dt>
<dd>
<p>It is a static error to use a declared step as a compound
step.</p>
<p>See: <a href="#err.inline.S0048">Extension Steps</a></p>
</dd>
<dt><a name="err.S0051" id="err.S0051"></a><code class=
"errqname">err:XS0051</code></dt>
<dd>
<p>It is a static error if the except-prefixes attribute on
p:namespaces does not contain a list of tokens or if any of those
tokens is not a prefix bound to a namespace in the in-scope
namespaces of the p:namespaces element.</p>
<p>See: <a href="#err.inline.S0051">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.S0052" id="err.S0052"></a><code class=
"errqname">err:XS0052</code></dt>
<dd>
<p>It is a static error if the URI of a p:import cannot be
retrieved or if, once retrieved, it does not point to a p:library,
p:declare-step, or p:pipeline.</p>
<p>See: <a href="#err.inline.S0052">p:import</a></p>
</dd>
<dt><a name="err.S0053" id="err.S0053"></a><code class=
"errqname">err:XS0053</code></dt>
<dd>
<p>It is a static error to import a single pipeline if that
pipeline does not have a type.</p>
<p>See: <a href="#err.inline.S0053">p:import</a></p>
</dd>
<dt><a name="err.S0055" id="err.S0055"></a><code class=
"errqname">err:XS0055</code></dt>
<dd>
<p>It is a static error if a primary parameter input port is
unconnected and the pipeline that contains the step has no primary
parameter input port unless at least one explicit p:with-param is
provided for that port.</p>
<p>See: <a href="#err.inline.S0055">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0057" id="err.S0057"></a><code class=
"errqname">err:XS0057</code></dt>
<dd>
<p>It is a static error if the exclude-inline-prefixes attribute
does not contain a list of tokens or if any of those tokens (except
#all or #default) is not a prefix bound to a namespace in the
in-scope namespaces of the element on which it occurs.</p>
<p>See: <a href="#err.inline.S0057">p:inline</a></p>
</dd>
<dt><a name="err.S0058" id="err.S0058"></a><code class=
"errqname">err:XS0058</code></dt>
<dd>
<p>It is a static error if the value #default is used within the
exclude-inline-prefixes attribute and there is no default namespace
in scope.</p>
<p>See: <a href="#err.inline.S0058">p:inline</a></p>
</dd>
<dt><a name="err.S0059" id="err.S0059"></a><code class=
"errqname">err:XS0059</code></dt>
<dd>
<p>It is a static error if the pipeline element is not p:pipeline,
p:declare-step, or p:library.</p>
<p>See: <a href="#err.inline.S0059">Common errors</a></p>
</dd>
<dt><a name="err.S0060" id="err.S0060"></a><code class=
"errqname">err:XS0060</code></dt>
<dd>
<p>It is a static error if the processor encounters an explicit
request for a previous version of the language and it is unable to
process the pipeline using those semantics.</p>
<p>See: <a href="#err.inline.S0060">Backwards-compatible
Mode</a></p>
</dd>
<dt><a name="err.S0061" id="err.S0061"></a><code class=
"errqname">err:XS0061</code></dt>
<dd>
<p>It is a static error if a use-when expression refers to the
context or attempts to refer to any documents or collections.</p>
<p>See: <a href="#err.inline.S0061">Conditional Element
Exclusion</a></p>
</dd>
<dt><a name="err.S0062" id="err.S0062"></a><code class=
"errqname">err:XS0062</code></dt>
<dd>
<p>It is a static error if a required version attribute is not
present.</p>
<p>See: <a href="#err.inline.S0062">Versioning
Considerations</a></p>
</dd>
<dt><a name="err.S0063" id="err.S0063"></a><code class=
"errqname">err:XS0063</code></dt>
<dd>
<p>It is a static error if the value of the version attribute is
not a xs:decimal.</p>
<p>See: <a href="#err.inline.S0063">Versioning
Considerations</a></p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="app.dynamic-errors" id=
"app.dynamic-errors"></a>E.2&#160;Dynamic Errors</h3>
<p>The following <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic errors</a></em> are defined:</p>
<div id="dynamic-error-summary">
<h5>Dynamic Errors</h5>
<dl class="errs">
<dt><a name="err.D0001" id="err.D0001"></a><code class=
"errqname">err:XD0001</code></dt>
<dd>
<p>It is a dynamic error if a non-XML resource is produced on a
step output or arrives on a step input.</p>
<p>See: <a href="#err.inline.D0001">Inputs and Outputs</a></p>
</dd>
<dt><a name="err.D0003" id="err.D0003"></a><code class=
"errqname">err:XD0003</code></dt>
<dd>
<p>It is a dynamic error if the viewport source does not provide
exactly one document.</p>
<p>See: <a href="#err.inline.D0003">p:viewport</a>, <a href=
"#err.inline.D0003.1">p:viewport-source</a></p>
</dd>
<dt><a name="err.D0004" id="err.D0004"></a><code class=
"errqname">err:XD0004</code></dt>
<dd>
<p>It is a dynamic error if no subpipeline is selected by the
p:choose and no default is provided.</p>
<p>See: <a href="#err.inline.D0004">p:choose</a></p>
</dd>
<dt><a name="err.D0005" id="err.D0005"></a><code class=
"errqname">err:XD0005</code></dt>
<dd>
<p>It is a dynamic error if more than one document appears on the
connection for the xpath-context.</p>
<p>See: <a href="#err.inline.D0005">p:xpath-context</a></p>
</dd>
<dt><a name="err.D0006" id="err.D0006"></a><code class=
"errqname">err:XD0006</code></dt>
<dd>
<p>If sequence is not specified, or has the value false, then it is
a dynamic error unless exactly one document appears on the declared
port.</p>
<p>See: <a href="#err.inline.D0006">Document Inputs</a>, <a href=
"#err.inline.D0006.1">p:exec</a></p>
</dd>
<dt><a name="err.D0007" id="err.D0007"></a><code class=
"errqname">err:XD0007</code></dt>
<dd>
<p>If sequence is not specified on p:output, or has the value
false, then it is a dynamic error if the step does not produce
exactly one document on the declared port.</p>
<p>See: <a href="#err.inline.D0007">p:output</a></p>
</dd>
<dt><a name="err.D0008" id="err.D0008"></a><code class=
"errqname">err:XD0008</code></dt>
<dd>
<p>It is a dynamic error if a document sequence appears where a
document to be used as the context node is expected.</p>
<p>See: <a href="#err.inline.D0008">Processor XPath Context</a>,
<a href="#err.inline.D0008.1">Processor XPath Context</a>, <a href=
"#err.inline.D0008.2">p:variable</a>, <a href=
"#err.inline.D0008.3">p:with-option</a>, <a href=
"#err.inline.D0008.4">p:with-param</a></p>
</dd>
<dt><a name="err.D0009" id="err.D0009"></a><code class=
"errqname">err:XD0009</code></dt>
<dd>
<p>It is a dynamic error if the element attribute on p:namespaces
is specified and it does not identify a single element node.</p>
<p>See: <a href="#err.inline.D0009">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.D0010" id="err.D0010"></a><code class=
"errqname">err:XD0010</code></dt>
<dd>
<p>It is a dynamic error if the match expression on p:viewport does
not match an element or document.</p>
<p>See: <a href="#err.inline.D0010">p:viewport</a></p>
</dd>
<dt><a name="err.D0011" id="err.D0011"></a><code class=
"errqname">err:XD0011</code></dt>
<dd>
<p>It is a dynamic error if the resource referenced by a p:document
element does not exist, cannot be accessed, or is not a well-formed
XML document.</p>
<p>See: <a href="#err.inline.D0011">p:document</a></p>
</dd>
<dt><a name="err.D0012" id="err.D0012"></a><code class=
"errqname">err:XD0012</code></dt>
<dd>
<p>It is a dynamic error if any attempt is made to dereference a
URI where the scheme of the URI reference is not supported.</p>
<p>See: <a href="#err.inline.D0012">Common errors</a></p>
</dd>
<dt><a name="err.D0013" id="err.D0013"></a><code class=
"errqname">err:XD0013</code></dt>
<dd>
<p>It is a dynamic error if the specified namespace bindings are
inconsistent; that is, if the same prefix is bound to two different
namespace names.</p>
<p>See: <a href="#err.inline.D0013">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.D0014" id="err.D0014"></a><code class=
"errqname">err:XD0014</code></dt>
<dd>
<p>It is a dynamic error for any unqualified attribute names other
than “name”, “namespace”, or “value” to appear on a c:param
element.</p>
<p>See: <a href="#err.inline.D0014">The c:param element</a>,
<a href="#err.inline.D0014.1">The c:param-set element</a></p>
</dd>
<dt><a name="err.D0015" id="err.D0015"></a><code class=
"errqname">err:XD0015</code></dt>
<dd>
<p>It is a dynamic error if the specified QName cannot be resolved
with the in-scope namespace declarations.</p>
<p>See: <a href="#err.inline.D0015">System Properties</a></p>
</dd>
<dt><a name="err.D0016" id="err.D0016"></a><code class=
"errqname">err:XD0016</code></dt>
<dd>
<p>It is a dynamic error if the select expression on a p:input
returns atomic values or anything other than element or document
nodes (or an empty sequence).</p>
<p>See: <a href="#err.inline.D0016">Document Inputs</a></p>
</dd>
<dt><a name="err.D0017" id="err.D0017"></a><code class=
"errqname">err:XD0017</code></dt>
<dd>
<p>It is a dynamic error if the running pipeline attempts to invoke
a step which the processor does not know how to perform.</p>
<p>See: <a href="#err.inline.D0017">Extension Steps</a></p>
</dd>
<dt><a name="err.D0018" id="err.D0018"></a><code class=
"errqname">err:XD0018</code></dt>
<dd>
<p>It is a dynamic error if the parameter list contains any
elements other than c:param.</p>
<p>See: <a href="#err.inline.D0018">The c:param-set element</a></p>
</dd>
<dt><a name="err.D0019" id="err.D0019"></a><code class=
"errqname">err:XD0019</code></dt>
<dd>
<p>It is a dynamic error if any option value does not satisfy the
type required for that option.</p>
<p>See: <a href="#err.inline.D0019">Common errors</a></p>
</dd>
<dt><a name="err.D0020" id="err.D0020"></a><code class=
"errqname">err:XD0020</code></dt>
<dd>
<p>It is a dynamic error if the combination of serialization
options specified or defaulted is not allowed.</p>
<p>See: <a href="#err.inline.D0020">p:serialization</a></p>
</dd>
<dt><a name="err.D0021" id="err.D0021"></a><code class=
"errqname">err:XD0021</code></dt>
<dd>
<p>It is a dynamic error for a pipeline to attempt to access a
resource for which it has insufficient privileges or perform a step
which is forbidden.</p>
<p>See: <a href="#err.inline.D0021">Security Considerations</a></p>
</dd>
<dt><a name="err.D0022" id="err.D0022"></a><code class=
"errqname">err:XD0022</code></dt>
<dd>
<p>It is a dynamic error if a processor that does not support PSVI
annotations attempts to invoke a step which asserts that they are
required.</p>
<p>See: <a href="#err.inline.D0022">PSVIs in XProc</a></p>
</dd>
<dt><a name="err.D0023" id="err.D0023"></a><code class=
"errqname">err:XD0023</code></dt>
<dd>
<p>It is a dynamic error if an XPath expression is encountered
which cannot be evaluated (because it is syntactically incorrect,
contains references to unbound variables or unknown functions, or
for any other reason).</p>
<p>See: <a href="#err.inline.D0023">XPaths in XProc</a></p>
</dd>
<dt><a name="err.D0024" id="err.D0024"></a><code class=
"errqname">err:XD0024</code></dt>
<dd>
<p>It is a dynamic error if a 2.0 processor encounters an XPath 1.0
expression and it does not support XPath 1.0 compatibility
mode.</p>
<p>See: <a href="#err.inline.D0024">XPaths in XProc</a></p>
</dd>
<dt><a name="err.D0025" id="err.D0025"></a><code class=
"errqname">err:XD0025</code></dt>
<dd>
<p>It is a dynamic error if the namespace attribute is specified,
the name contains a colon, and the specified namespace is not the
same as the in-scope namespace binding for the specified
prefix.</p>
<p>See: <a href="#err.inline.D0025">The c:param element</a></p>
</dd>
<dt><a name="err.D0026" id="err.D0026"></a><code class=
"errqname">err:XD0026</code></dt>
<dd>
<p>It is a dynamic error if the select expression makes reference
to the context node, size, or position when the context item is
undefined.</p>
<p>See: <a href="#err.inline.D0026">p:variable</a>, <a href=
"#err.inline.D0026.1">p:option</a>, <a href=
"#err.inline.D0026.2">p:with-option</a>, <a href=
"#err.inline.D0026.3">p:with-param</a></p>
</dd>
<dt><a name="err.D0027" id="err.D0027"></a><code class=
"errqname">err:XD0027</code></dt>
<dd>
<p>It is a dynamic error if the processor encounters an
xpath-version that it does not support.</p>
<p>See: <a href="#err.inline.D0027">XPaths in XProc</a></p>
</dd>
<dt><a name="err.D0028" id="err.D0028"></a><code class=
"errqname">err:XD0028</code></dt>
<dd>
<p>It is a dynamic error if any attribute value does not satisfy
the type required for that attribute.</p>
<p>See: <a href="#err.inline.D0028">Common errors</a></p>
</dd>
<dt><a name="err.D0029" id="err.D0029"></a><code class=
"errqname">err:XD0029</code></dt>
<dd>
<p>It is a dynamic error if the document referenced by a p:data
element does not exist, cannot be accessed, or cannot be encoded as
specified.</p>
<p>See: <a href="#err.inline.D0029">p:data</a></p>
</dd>
<dt><a name="err.D0030" id="err.D0030"></a><code class=
"errqname">err:XD0030</code></dt>
<dd>
<p>It is a dynamic error if a step is unable or incapable of
performing its function.</p>
<p>See: <a href="#err.inline.D0030">Common errors</a></p>
</dd>
<dt><a name="err.D0031" id="err.D0031"></a><code class=
"errqname">err:XD0031</code></dt>
<dd>
<p>It is a dynamic error to use the XProc namespace in the name of
a parameter.</p>
<p>See: <a href="#err.inline.D0031">p:with-param</a></p>
</dd>
<dt><a name="err.D0033" id="err.D0033"></a><code class=
"errqname">err:XD0033</code></dt>
<dd>
<p>It is a dynamic error if the name specified is not the name of
an in-scope option or variable.</p>
<p>See: <a href="#err.inline.D0033">Value Available</a></p>
</dd>
<dt><a name="err.D0034" id="err.D0034"></a><code class=
"errqname">err:XD0034</code></dt>
<dd>
<p>It is a dynamic error to specify a new namespace or prefix if
the lexical value of the specified name contains a colon (or if no
wrapper is explicitly specified).</p>
<p>See: <a href="#err.inline.D0034">p:data</a>, <a href=
"#err.inline.D0034.1">p:add-attribute</a>, <a href=
"#err.inline.D0034.2">p:error</a>, <a href=
"#err.inline.D0034.3">p:label-elements</a>, <a href=
"#err.inline.D0034.4">p:pack</a>, <a href=
"#err.inline.D0034.5">p:rename</a>, <a href=
"#err.inline.D0034.6">p:wrap</a>, <a href=
"#err.inline.D0034.7">p:wrap-sequence</a></p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="app.step-errors" id=
"app.step-errors"></a>E.3&#160;Step Errors</h3>
<p>The following <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic errors</a></em> can be raised by steps
in this specification:</p>
<div id="step-error-summary">
<h5>Step Errors</h5>
<dl class="errs">
<dt><a name="err.C0002" id="err.C0002"></a><code class=
"errqname">err:XC0002</code></dt>
<dd>
<p>It is a dynamic error if the value starts with the string
“--”.</p>
<p>See: <a href="#err.inline.C0002">Request Entity body
conversion</a></p>
</dd>
<dt><a name="err.C0003" id="err.C0003"></a><code class=
"errqname">err:XC0003</code></dt>
<dd>
<p>It is a dynamic error if a username or password is specified
without specifying an auth-method, if the requested auth-method
isn't supported, or the authentication challenge contains an
authentication method that isn't supported.</p>
<p>See: <a href="#err.inline.C0003">Specifying a request</a></p>
</dd>
<dt><a name="err.C0004" id="err.C0004"></a><code class=
"errqname">err:XC0004</code></dt>
<dd>
<p>It is a dynamic error if the status-only attribute has the value
true and the detailed attribute does not have the value true.</p>
<p>See: <a href="#err.inline.C0004">Specifying a request</a></p>
</dd>
<dt><a name="err.C0005" id="err.C0005"></a><code class=
"errqname">err:XC0005</code></dt>
<dd>
<p>It is a dynamic error if the request contains a c:body or
c:multipart but the method does not allow for an entity body being
sent with the request.</p>
<p>See: <a href="#err.inline.C0005">Specifying a request</a></p>
</dd>
<dt><a name="err.C0006" id="err.C0006"></a><code class=
"errqname">err:XC0006</code></dt>
<dd>
<p>It is a dynamic error if the method is not specified on a
c:request.</p>
<p>See: <a href="#err.inline.C0006">Specifying a request</a></p>
</dd>
<dt><a name="err.C0010" id="err.C0010"></a><code class=
"errqname">err:XC0010</code></dt>
<dd>
<p>It is a dynamic error if an encoding of base64 is specified and
the character set is not specified or if the specified character
set is not supported by the implementation.</p>
<p>See: <a href="#err.inline.C0010">p:unescape-markup</a></p>
</dd>
<dt><a name="err.C0012" id="err.C0012"></a><code class=
"errqname">err:XC0012</code></dt>
<dd>
<p>It is a dynamic error if the contents of the directory path are
not available to the step due to access restrictions in the
environment in which the pipeline is run.</p>
<p>See: <a href="#err.inline.C0012">p:directory-list</a></p>
</dd>
<dt><a name="err.C0013" id="err.C0013"></a><code class=
"errqname">err:XC0013</code></dt>
<dd>
<p>It is a dynamic error if the pattern matches a processing
instruction and the new name has a non-null namespace.</p>
<p>See: <a href="#err.inline.C0013">p:rename</a></p>
</dd>
<dt><a name="err.C0014" id="err.C0014"></a><code class=
"errqname">err:XC0014</code></dt>
<dd>
<p>It is a dynamic error if the XML namespace
(http://www.w3.org/XML/1998/namespace) or the XMLNS namespace
(http://www.w3.org/2000/xmlns/) is the value of either the from
option or the to option.</p>
<p>See: <a href="#err.inline.C0014">p:namespace-rename</a></p>
</dd>
<dt><a name="err.C0017" id="err.C0017"></a><code class=
"errqname">err:XC0017</code></dt>
<dd>
<p>It is a dynamic error if the absolute path does not identify a
directory.</p>
<p>See: <a href="#err.inline.C0017">p:directory-list</a></p>
</dd>
<dt><a name="err.C0019" id="err.C0019"></a><code class=
"errqname">err:XC0019</code></dt>
<dd>
<p>It is a dynamic error if the documents are not equal, and the
value of the fail-if-not-equal option is true.</p>
<p>See: <a href="#err.inline.C0019">p:compare</a></p>
</dd>
<dt><a name="err.C0020" id="err.C0020"></a><code class=
"errqname">err:XC0020</code></dt>
<dd>
<p>It is a dynamic error if the the user specifies a value or
values that are inconsistent with each other or with the
requirements of the step or protocol.</p>
<p>See: <a href="#err.inline.C0020">Specifying a request</a></p>
</dd>
<dt><a name="err.C0022" id="err.C0022"></a><code class=
"errqname">err:XC0022</code></dt>
<dd>
<p>it is a dynamic error if the content of the c:body element does
not consist of exactly one element, optionally preceded and/or
followed by any number of processing instructions, comments or
whitespace characters</p>
<p>See: <a href="#err.inline.C0022">Request Entity body
conversion</a></p>
</dd>
<dt><a name="err.C0023" id="err.C0023"></a><code class=
"errqname">err:XC0023</code></dt>
<dd>
<p>It is a dynamic error if a select expression or match pattern
returns a node type that is not allowed by the step.</p>
<p>See: <a href="#err.inline.C0023">Common errors</a>, <a href=
"#err.inline.C0023.1">p:add-attribute</a>, <a href=
"#err.inline.C0023.2">p:insert</a>, <a href=
"#err.inline.C0023.3">p:label-elements</a>, <a href=
"#err.inline.C0023.4">p:make-absolute-uris</a>, <a href=
"#err.inline.C0023.5">p:rename</a>, <a href=
"#err.inline.C0023.6">p:replace</a>, <a href=
"#err.inline.C0023.7">p:set-attributes</a>, <a href=
"#err.inline.C0023.8">p:unwrap</a>, <a href=
"#err.inline.C0023.9">p:wrap</a></p>
</dd>
<dt><a name="err.C0025" id="err.C0025"></a><code class=
"errqname">err:XC0025</code></dt>
<dd>
<p>It is a dynamic error if the match pattern matches anything
other than an element node and the value of the position option is
“first-child” or “last-child”.</p>
<p>See: <a href="#err.inline.C0025">p:insert</a></p>
</dd>
<dt><a name="err.C0027" id="err.C0027"></a><code class=
"errqname">err:XC0027</code></dt>
<dd>
<p>It is a dynamic error if the document is not valid or the step
doesn't support DTD validation.</p>
<p>See: <a href="#err.inline.C0027">p:load</a></p>
</dd>
<dt><a name="err.C0028" id="err.C0028"></a><code class=
"errqname">err:XC0028</code></dt>
<dd>
<p>it is a dynamic error if the content of the c:body element does
not consist entirely of characters</p>
<p>See: <a href="#err.inline.C0028">Request Entity body
conversion</a></p>
</dd>
<dt><a name="err.C0029" id="err.C0029"></a><code class=
"errqname">err:XC0029</code></dt>
<dd>
<p>It is a dynamic error if an XInclude error occurs during
processing.</p>
<p>See: <a href="#err.inline.C0029">p:xinclude</a></p>
</dd>
<dt><a name="err.C0030" id="err.C0030"></a><code class=
"errqname">err:XC0030</code></dt>
<dd>
<p>It is a dynamic error if the override-content-type value cannot
be used (e.g. text/plain to override image/png).</p>
<p>See: <a href="#err.inline.C0030">Managing the response</a></p>
</dd>
<dt><a name="err.C0033" id="err.C0033"></a><code class=
"errqname">err:XC0033</code></dt>
<dd>
<p>It is a dynamic error if the command cannot be run.</p>
<p>See: <a href="#err.inline.C0033">p:exec</a></p>
</dd>
<dt><a name="err.C0034" id="err.C0034"></a><code class=
"errqname">err:XC0034</code></dt>
<dd>
<p>It is a dynamic error if the current working directory cannot be
changed to the value of the cwd option.</p>
<p>See: <a href="#err.inline.C0034">p:exec</a></p>
</dd>
<dt><a name="err.C0035" id="err.C0035"></a><code class=
"errqname">err:XC0035</code></dt>
<dd>
<p>It is a dynamic error to specify both result-is-xml and
wrap-result-lines.</p>
<p>See: <a href="#err.inline.C0035">p:exec</a></p>
</dd>
<dt><a name="err.C0036" id="err.C0036"></a><code class=
"errqname">err:XC0036</code></dt>
<dd>
<p>It is a dynamic error if the requested hash algorithm is not one
that the processor understands or if the value or parameters are
not appropriate for that algorithm.</p>
<p>See: <a href="#err.inline.C0036">p:hash</a></p>
</dd>
<dt><a name="err.C0037" id="err.C0037"></a><code class=
"errqname">err:XC0037</code></dt>
<dd>
<p>It is a dynamic error if the value provided is not a properly
x-www-form-urlencoded value.</p>
<p>See: <a href="#err.inline.C0037">p:www-form-urldecode</a></p>
</dd>
<dt><a name="err.C0038" id="err.C0038"></a><code class=
"errqname">err:XC0038</code></dt>
<dd>
<p>It is a dynamic error if the specified version of XSLT is not
available.</p>
<p>See: <a href="#err.inline.C0038">p:xslt</a></p>
</dd>
<dt><a name="err.C0039" id="err.C0039"></a><code class=
"errqname">err:XC0039</code></dt>
<dd>
<p>It is a dynamic error if a sequence of documents (including an
empty sequence) is provided to an XSLT 1.0 step.</p>
<p>See: <a href="#err.inline.C0039">p:xslt</a></p>
</dd>
<dt><a name="err.C0040" id="err.C0040"></a><code class=
"errqname">err:XC0040</code></dt>
<dd>
<p>It is a dynamic error if the document element of the document
that arrives on the source port is not c:request.</p>
<p>See: <a href="#err.inline.C0040">p:http-request</a></p>
</dd>
<dt><a name="err.C0050" id="err.C0050"></a><code class=
"errqname">err:XC0050</code></dt>
<dd>
<p>It is a dynamic error if the URI scheme is not supported or the
step cannot store to the specified location.</p>
<p>See: <a href="#err.inline.C0050">p:store</a></p>
</dd>
<dt><a name="err.C0051" id="err.C0051"></a><code class=
"errqname">err:XC0051</code></dt>
<dd>
<p>It is a dynamic error if the content-type specified is not
supported by the implementation.</p>
<p>See: <a href="#err.inline.C0051">p:unescape-markup</a></p>
</dd>
<dt><a name="err.C0052" id="err.C0052"></a><code class=
"errqname">err:XC0052</code></dt>
<dd>
<p>It is a dynamic error if the encoding specified is not supported
by the implementation.</p>
<p>See: <a href="#err.inline.C0052">Request Entity body
conversion</a>, <a href=
"#err.inline.C0052.1">p:unescape-markup</a></p>
</dd>
<dt><a name="err.C0053" id="err.C0053"></a><code class=
"errqname">err:XC0053</code></dt>
<dd>
<p>It is a dynamic error if the assert-valid option is true and the
input document is not valid.</p>
<p>See: <a href="#err.inline.C0053">p:validate-with-relax-ng</a>,
<a href="#err.inline.C0053.1">p:validate-with-xml-schema</a></p>
</dd>
<dt><a name="err.C0054" id="err.C0054"></a><code class=
"errqname">err:XC0054</code></dt>
<dd>
<p>It is a dynamic error if the assert-valid option is true and any
Schematron assertions fail.</p>
<p>See: <a href=
"#err.inline.C0054">p:validate-with-schematron</a></p>
</dd>
<dt><a name="err.C0055" id="err.C0055"></a><code class=
"errqname">err:XC0055</code></dt>
<dd>
<p>It is a dynamic error if the implementation does not support the
specified mode.</p>
<p>See: <a href=
"#err.inline.C0055">p:validate-with-xml-schema</a></p>
</dd>
<dt><a name="err.C0056" id="err.C0056"></a><code class=
"errqname">err:XC0056</code></dt>
<dd>
<p>It is a dynamic error if the specified initial mode or named
template cannot be applied to the specified stylesheet.</p>
<p>See: <a href="#err.inline.C0056">p:xslt</a></p>
</dd>
<dt><a name="err.C0057" id="err.C0057"></a><code class=
"errqname">err:XC0057</code></dt>
<dd>
<p>It is a dynamic error if the sequence that results from
evaluating the XQuery contains items other than documents and
elements.</p>
<p>See: <a href="#err.inline.C0057">p:xquery</a></p>
</dd>
<dt><a name="err.C0058" id="err.C0058"></a><code class=
"errqname">err:XC0058</code></dt>
<dd>
<p>It is a dynamic error if the all and relative options are both
true.</p>
<p>See: <a href="#err.inline.C0058">p:add-xml-base</a></p>
</dd>
<dt><a name="err.C0059" id="err.C0059"></a><code class=
"errqname">err:XC0059</code></dt>
<dd>
<p>It is a dynamic error if the QName value in the attribute-name
option uses the prefix “xmlns” or any other prefix that resolves to
the namespace name “http://www.w3.org/2000/xmlns/”.</p>
<p>See: <a href="#err.inline.C0059">p:add-attribute</a></p>
</dd>
<dt><a name="err.C0060" id="err.C0060"></a><code class=
"errqname">err:XC0060</code></dt>
<dd>
<p>It is a dynamic error if the processor does not support the
specified version of the UUID algorithm.</p>
<p>See: <a href="#err.inline.C0060">p:uuid</a></p>
</dd>
<dt><a name="err.C0061" id="err.C0061"></a><code class=
"errqname">err:XC0061</code></dt>
<dd>
<p>It is a dynamic error if the name of any encoded parameter name
is not a valid xs:NCName.</p>
<p>See: <a href="#err.inline.C0061">p:www-form-urldecode</a></p>
</dd>
<dt><a name="err.C0062" id="err.C0062"></a><code class=
"errqname">err:XC0062</code></dt>
<dd>
<p>It is a dynamic error if the match option matches a namespace
node.</p>
<p>See: <a href="#err.inline.C0062">p:delete</a></p>
</dd>
<dt><a name="err.C0063" id="err.C0063"></a><code class=
"errqname">err:XC0063</code></dt>
<dd>
<p>It is a dynamic error if the path-separator option is specified
and is not exactly one character long.</p>
<p>See: <a href="#err.inline.C0063">p:exec</a></p>
</dd>
<dt><a name="err.C0064" id="err.C0064"></a><code class=
"errqname">err:XC0064</code></dt>
<dd>
<p>It is a dynamic error if the exit code from the command is
greater than the specified failure-threshold value.</p>
<p>See: <a href="#err.inline.C0064">p:exec</a></p>
</dd>
<dt><a name="err.C0066" id="err.C0066"></a><code class=
"errqname">err:XC0066</code></dt>
<dd>
<p>It is a dynamic error if the arg-separator option is specified
and is not exactly one character long.</p>
<p>See: <a href="#err.inline.C0066">p:exec</a></p>
</dd>
</dl>
</div>
</div>
</div>
<div class="appendix">
<h2><a name="namespace-fixup-guidance" id=
"namespace-fixup-guidance"></a>F&#160;Guidance on Namespace Fixup
(Non-Normative)</h2>
<p>An XProc processor may find it necessary to add missing
namespace declarations to ensure that a document can be serialized.
While this process is implementation defined, the purpose of this
appendix is to provide guidance as to what an implementation might
do to either prevent such situations or fix them as before
serialization.</p>
<p>When a namespace binding is generated, the prefix associated
with the QName of the element or attribute in question should be
used. From an Infoset perspective, this is accomplished by setting
the <tt class="code">[prefix]</tt> on the element or attribute.
Then when an implementation needs to add a namespace binding, it
can reuse that prefix if possible. If reusing the prefix is not
possible, the implementation must generate a new prefix that is
unique to the in-scope namespace of the element or owner element of
the attribute.</p>
<p>An implementation can avoid namespace fixup by making sure that
the standard step library does not output documents that require
fixup. The following list contains suggestions as to how to
accomplish this within the steps:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>Any step that outputs an element in the step vocabulary
namespace <tt class="uri">http://www.w3.org/ns/xproc-step</tt> must
ensure that namespace is declared. An implementation should
generate a namespace binding using the prefix “<tt class=
"literal">c</tt>”.</p>
</li>
<li>
<p>When attributes are added by <a href=
"#c.add-attribute">p:add-attribute</a> or <a href=
"#c.set-attributes">p:set-attributes</a>, the step must ensure the
namespace of the attributes added are declared. If the prefix used
by the QName is not in the in-scope namespaces of the element on
which the attribute was added, the step must add a namespace
declaration of the prefix to the in-scope namespaces. If the prefix
is amongst the in-scope namespace and is not bound to the same
namespace name, a new prefix and namespace binding must be added.
When a new prefix is generated, the prefix associated with the
attribute should be changed to reflect that generated prefix
value.</p>
</li>
<li>
<p>When an element is renamed by <a href="#c.rename">p:rename</a>,
the step must ensure the namespace of the element is declared. If
the prefix used by the QName is not in the in-scope namespaces of
the element being renamed, the step must add a namespace
declaration of the prefix to the in-scope namespaces. If the prefix
is amongst the in-scope namespace and is not bound to the same
namespace name, a new prefix and namespace binding must be added.
When a new prefix is generated, the prefix associated with the
element should be changed to reflect that generated prefix
value.</p>
<p>If the element does not have a namespace name and there is a
default namespace, the default namespace must be undeclared. For
each of the child elements, the original default namespace
declaration must be preserved by adding a default namespace
declaration unless the child element has a different default
namespace.</p>
</li>
<li>
<p>When an attribute is renamed by <a href=
"#c.rename">p:rename</a>, the step must ensure the namespace of the
renamed attribute is declared. If the prefix used by the QName is
not in the in-scope namespaces of the element on which the
attribute was added, the step must add a namespace declaration of
the prefix to the in-scope namespaces. If the prefix is amongst the
in-scope namespace and is not bound to the same namespace name, a
new prefix and namespace binding must be added. When a new prefix
is generated, the prefix associated with the attribute should be
changed to reflect that generated prefix value.</p>
</li>
<li>
<p>When an element wraps content via <a href="#c.wrap">p:wrap</a>,
there may be in-scope namespaces coming from ancestor elements of
the new wrapper element. The step must ensure the namespace of the
element is declared properly. By default, the wrapper element will
inherit the in-scope namespaces of the parent element if one
exists. As such, there may be a existing namespace declaration or
default namespace.</p>
<p>If the prefix used by the QName is not in the in-scope
namespaces of the wrapper element, the step must add a namespace
declaration of the prefix to the in-scope namespaces. If the prefix
is amongst the in-scope namespace and is not bound to the same
namespace name, a new prefix and namespace binding must be added.
When a new prefix is generated, the prefix associated with the
wrapper element should be changed to reflect that generated prefix
value.</p>
<p>If the element does not have a namespace name and there is a
default namespace, the default namespace must be undeclared. For
each of the child elements, the original default namespace
declaration must be preserved by adding a default namespace
declaration unless the child element has a different default
namespace.</p>
</li>
<li>
<p>When the wrapper element is added for <a href=
"#c.wrap-sequence">p:wrap-sequence</a> or <a href=
"#c.pack">p:pack</a>, the prefix used by the QName must be added to
the in-scope namespaces.</p>
</li>
<li>
<p>When a element is removed via <a href="#c.unwrap">p:unwrap</a>,
an in-scope namespaces that are declared on the element must be
copied to any child element except when the child element declares
the same prefix or declares a new default namespace.</p>
</li>
<li>
<p>In the output from <a href="#c.xslt">p:xslt</a>, if an element
was generated from the xsl:element or an attribute from
xsl:attribute, the step must guarantee that an namespace
declaration exists for the namespace name used. Depending on the
XSLT implementation, the namespace declaration for the namespace
name of the element or attribute may not be declared. It may also
be the case that the original prefix is available. If the original
prefix is available, the step should attempt to re-use that prefix.
Otherwise, it must generate a prefix for a namespace binding and
change the prefix associated the element or attribute.</p>
</li>
</ol>
</div>
</div>
<div class="appendix">
<h2><a name="handling-imports" id=
"handling-imports"></a>G&#160;Handling Circular and Re-entrant
Library Imports (Non-Normative)</h2>
<p>When handling imports, an implementation needs to be able to
detect the following situations, and distinguish them from cases
where multiple import chains produce genuinely conflicting step
definitions:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>Circular imports: A imports B, B imports A.</p>
</li>
<li>
<p>Re-entrant imports: A imports B and C, B imports D, C imports
D.</p>
</li>
</ol>
</div>
<p>One way to achieve this is as follows:</p>
<p><span class="termdef" id="dt-step-type-exports">[Definition: The
<em class="glossterm">step type exports</em> of an XProc element,
against the background of a set of URIs of resources already
visited (call this set <em>Visited</em>), are defined by
cases.]</span></p>
<p>The <a href="#dt-step-type-exports">step type exports</a> of an
XProc element are as follows:</p>
<div class="variablelist">
<dl>
<dt>p:pipeline, p:declare-step</dt>
<dd>
<p>A singleton bag containing the <tt class="code">type</tt> of the
element</p>
</dd>
<dt>p:library</dt>
<dd>
<p>The <em class="glossterm"><a href=
"#dt-bag-merger">bag-merger</a></em> of the <em class=
"glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of all the element's children</p>
</dd>
<dt>p:import</dt>
<dd>
<p>Let <em>RU</em> be the actual resolved URI of the resource
identified by the <tt class="code">href</tt> of the element. If
<em>RU</em> is a member of <em>Visited</em>, then an empty bag,
otherwise update <em>Visited</em> by adding <em>RU</em> to it, and
return the <em class="glossterm"><a href=
"#dt-step-type-exports">step type exports</a></em> of the document
element of the retrieved representation</p>
</dd>
<dt>all other elements</dt>
<dd>
<p>An empty bag</p>
</dd>
</dl>
</div>
<p>The changes to <em>Visited</em> mandated by the <tt class=
"code">p:import</tt> case above are persistent, not scoped. That
is, not only the recursive processing of the imported resource but
also subsequent processing of siblings and ancestors must be
against the background of the updated value. In practice this means
either using a side-effected global variable, or not only passing
<em>Visited</em> as an argument to any recursive or iterative
processing, but also <em>returning</em> its updated value for
subsequent use, along with the bag of step types.</p>
<p>Given a pipeline library document with actual resolved URI
<em>DU</em>, <a name="err.inline.S0036.1" id=
"err.inline.S0036.1"></a>it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0036"><code class="errqname">err:XS0036</code></a>) if the
<em class="glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of the document element of the retrieved
representation, against the background of a singleton set
containing <em>DU</em> as the initial <em>Visited</em> set,
contains any duplicates.</p>
<p>Given a top-level pipeline document with actual resolved URI
<em>DU</em>, <a name="err.inline.S0036.2" id=
"err.inline.S0036.2"></a>it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0036"><code class="errqname">err:XS0036</code></a>) if the
<em class="glossterm"><a href="#dt-bag-merger">bag-merger</a></em>
of the <em class="glossterm"><a href="#dt-step-type-exports">step
type exports</a></em> of the document element of the retrieved
representation with the <em class="glossterm"><a href=
"#dt-step-type-exports">step type exports</a></em> of its children,
against the background of a singleton set containing <em>DU</em> as
the initial <em>Visited</em> set, contains any duplicates.</p>
<p>Given a non-top-level <tt class="code">p:pipeline</tt> or
<tt class="code">p:declare-step</tt> element, <a name=
"err.inline.S0036.3" id="err.inline.S0036.3"></a>it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0036"><code class=
"errqname">err:XS0036</code></a>) if the <em class=
"glossterm"><a href="#dt-bag-merger">bag-merger</a></em> of the
<em class="glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of its parent with the <em class=
"glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of its children, against the background of a copy
of the <em>Visited</em> set of its parent as the initial
<em>Visited</em> set, contains any duplicates.</p>
<p>The phrase "a copy of the <em>Visited</em> set" in the preceding
paragraph is meant to indicate that checking of non-top-level
<tt class="code">p:pipeline</tt> or <tt class=
"code">p:declare-step</tt> elements does <em>not</em> have a
persistent impact on the checking of its parent. The contrast is
that whereas changes to <em>Visited</em> pass both up <em>and</em>
down through <tt class="code">p:import</tt>, they pass only
<em>down</em> through <em>p:pipeline</em> and
<em>p:declare-step</em>.</p>
<p><span class="termdef" id="dt-bag-merger">[Definition: The
<em class="glossterm">bag-merger</em> of two or more bags (where a
bag is an unordered list or, equivalently, something like a set
except that it may contain duplicates) is a bag constructed by
starting with an empty bag and adding each member of each of the
input bags in turn to it. It follows that the cardinality of the
result is the sum of the cardinality of all the input
bags.]</span></p>
</div>
<div class="appendix">
<h2><a name="parallelism" id="parallelism"></a>H&#160;Sequential
steps, parallelism, and side-effects</h2>
<p>XProc imposes as few constraints on the order in which steps
must be evaluated as possible and almost no constraints on parallel
execution.</p>
<p>In the simple, and we believe overwhelmingly common case, inputs
flow into the pipeline, through the pipeline from one step to the
next, and results are produced at the end. The order of the steps
is constrained by the input/output connections between them.
Implementations are free to execute them in a purely sequential
fashion or in parallel, as they see fit. The results are the same
in either case.</p>
<p>This is not true for pipelines which rely on side effects, such
as the state of the filesystem or the state of the web. Consider
the following pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
version="1.0"
name="main"&gt;
&lt;p:xslt name="generate-stylesheet"&gt;
&lt;p:input port="source"&gt;
&lt;p:document href="someURI"/&gt;
&lt;/p:input&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="someOtherURI"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;p:store name="save-xslt" href="gen-style.xsl"/&gt;
&lt;p:xslt name="style"&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="main" port="source"/&gt;
&lt;/p:input&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="gen-style.xsl"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>There's no guarantee that “style” step will execute after the
“save-xslt” step. In this case, the solution is straightforward.
Even if you need the saved stylesheet, you don't need to rely on it
in your pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
version="1.0"
name="main"&gt;
&lt;p:xslt name="generate-stylesheet"&gt;
&lt;p:input port="source"&gt;
&lt;p:document href="someURI"/&gt;
&lt;/p:input&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:document href="someOtherURI"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;p:store name="save-xslt" href="gen-style.xsl"/&gt;
&lt;p:xslt name="style"&gt;
&lt;p:input port="source"&gt;
&lt;p:pipe step="main" port="source"/&gt;
&lt;/p:input&gt;
&lt;p:input port="stylesheet"&gt;
&lt;p:pipe step="generate-stylesheet" port="result"/&gt;
&lt;/p:input&gt;
&lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>Now the result is independent of the implementation
strategy.</p>
<p>Implementations are free to invent additional control structures
using <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> and <a href=
"#extension-attributes">extension attributes</a> to provide greater
control over parallelism in their implementations.</p>
</div>
<div class="appendix">
<h2><a name="xproc-media-type" id="xproc-media-type"></a>I&#160;The
<tt class="code">application/xproc+xml</tt> media type</h2>
<p>This appendix registers a new MIME media type, “<span class=
"quote"><tt class="code">application/xproc+xml</tt></span>”.</p>
<div class="section">
<h3><a name="media-type-registration" id=
"media-type-registration"></a>I.1&#160;Registration of MIME media
type application/xproc+xml</h3>
<div class="variablelist">
<dl>
<dt>MIME media type name:</dt>
<dd>
<p><tt class="code">application</tt></p>
</dd>
<dt>MIME subtype name:</dt>
<dd>
<p><tt class="code">xproc+xml</tt></p>
</dd>
<dt>Required parameters:</dt>
<dd>
<p>None.</p>
</dd>
<dt>Optional parameters:</dt>
<dd>
<div class="variablelist">
<dl>
<dt><tt class="code">charset</tt></dt>
<dd>
<p>This parameter has identical semantics to the <tt class=
"code">charset</tt> parameter of the <tt class=
"code">application/xml</tt> media type as specified in [<a href=
"#rfc3023"><span class="abbrev">RFC 3023</span></a>] or its
successors.</p>
</dd>
</dl>
</div>
</dd>
<dt>Encoding considerations:</dt>
<dd>
<p>By virtue of XProc content being XML, it has the same
considerations when sent as “<span class="quote"><tt class=
"code">application/xproc+xml</tt></span>” as does XML. See
[<a href="#rfc3023"><span class="abbrev">RFC 3023</span></a>],
Section 3.2.</p>
</dd>
<dt>Security considerations:</dt>
<dd>
<p>Several XProc elements may refer to arbitrary URIs. In this
case, the security issues of [<a href="#rfc2396"><span class=
"abbrev">RFC 2396</span></a>], section 7, should be considered.</p>
<p>In addition, because of the extensibility features of XProc, it
is possible that “application/xproc+xml” may describe content that
has security implications beyond those described here. However,
only in the case where the processor recognizes and processes the
additional content, or where further processing of that content is
dispatched to other processors, would security issues potentially
arise. And in that case, they would fall outside the domain of this
registration document.</p>
</dd>
<dt>Interoperability considerations:</dt>
<dd>
<p>This specification describes processing semantics that dictate
behavior that must be followed when dealing with, among other
things, unrecognized elements.</p>
<p>Because XProc is extensible, conformant "application/xproc+xml"
processors can expect that content received is well-formed XML, but
it cannot be guaranteed that the content is valid XProc or that the
processor will recognize all of the elements and attributes in the
document.</p>
</dd>
<dt>Published specification:</dt>
<dd>
<p>This media type registration is for XProc documents as described
by this specification which is located at <a href=
"http://www.w3.org/TR/xproc">http://www.w3.org/TR/xproc</a>.</p>
</dd>
<dt>Applications which use this media type:</dt>
<dd>
<p>There is no experimental, vendor specific, or personal tree
predecessor to “<span class="quote"><tt class=
"code">application/xproc+xml</tt></span>”, reflecting the fact that
no applications currently recognize it. This new type is being
registered in order to allow for the deployment of XProc on the
World Wide Web, as a first class XML application.</p>
</dd>
<dt>Additional information:</dt>
<dd>
<div class="variablelist">
<dl>
<dt>Magic number(s):</dt>
<dd>
<p>There is no single initial octet sequence that is always present
in XProc documents.</p>
</dd>
<dt>File extension(s):</dt>
<dd>
<p>XProc documents are most often identified with the extension
<span class="quote"><tt class="filename">.xpl</tt></span>”.</p>
</dd>
<dt>Macintosh File Type Code(s):</dt>
<dd>
<p>TEXT</p>
</dd>
</dl>
</div>
</dd>
<dt>Person &amp; email address to contact for further
information:</dt>
<dd>
<p>Norman Walsh, <tt class="email">&lt;<a href=
"mailto:Norman.Walsh@MarkLogic.com">Norman.Walsh@MarkLogic.com</a>&gt;</tt>.</p>
</dd>
<dt>Intended usage:</dt>
<dd>
<p>COMMON</p>
</dd>
<dt>Author/Change controller:</dt>
<dd>
<p>The XProc specification is a work product of the World Wide Web
Consortium's XML Processing Model Working Group. The W3C has change
control over these specifications.</p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="fragid" id="fragid"></a>I.2&#160;Fragment
Identifiers</h3>
<p>For documents labeled as “<span class="quote"><tt class=
"code">application/xproc+xml</tt></span>”, the fragment identifier
notation is exactly that for “<span class="quote"><tt class=
"code">application/xml</tt></span>”, as specified in [<a href=
"#rfc3023"><span class="abbrev">RFC 3023</span></a>] or its
successors.</p>
</div>
</div>
</div>
</body>
</html>