Defining the piecemeal validation pipeline

This pipeline validates and then styles each sub-part of the input document which matches an XPath expression you provide, and reassembles the results into their original context. You can see below both the XML form and a snapshot of the pipeline authoring tool display for this pipeline.

The validate and transform steps, because they are within the scope of a viewport (bounded by the narrow and widen steps, indicated by the red arrows in the snapshot), are carried out on each sub-tree within the input document which matches the selector XPath expression, e.g. html:div.

<p:pipeline xmlns:p="http://www.w3.org/2002/02/xml-pipeline"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:html="http://www.w3.org/1999/xhtml">
 <p:processdef name="transform" definition="MT_XSLT_1.0"/>
 <p:processdef name="narrow" definition="MT_BeginViewport"/>
 <p:processdef name="widen" definition="MT_EndViewport"/>
 <p:processdef name="validate" definition="MT_W3C_XML_Schema_1.0"/>
 <p:process type="narrow">
  <p:input label="$IN"/>
  <p:param name="select" select="selector"/>
  <p:output label="#i2.0"/>
 </p:process>
 <p:process type="validate">
  <p:input label="#i2.0"/>
  <p:input name="schema" label="schemaDoc"/>
  <p:output label="#i4.2"/>
 </p:process>
 <p:process type="transform">
  <p:input label="#i4.2"/>
  <p:input name="stylesheet" label="stylesheet"/>
  <p:output label="#i5.2"/>
 </p:process>
 <p:process type="widen">
  <p:input label="#i5.2"/>
  <p:output label="$OUT"/>
 </p:process>
</p:pipeline>
Snapshot of GUI for chunk pipeline