Lab 10 - Create an XProc pipeline with an XSLT step

During the lab, you will create an XProc pipeline document that will load a source document, perform a XSLT transformation and write the results to an XHTML file.

To complete the lab, you will need the list-topic-images-xhtml.xsl stylesheet.

  1. In the lab folder, create a new XProc pipeline document named pipeline.xpl.
    1. Select a name for your pipeline that will be unique.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE p:pipeline PUBLIC "-//W3C//XProc//EN" "http://www.w3.org/TR/xproc/schemas/xproc.dtd">
    <p:pipeline name="sample-pipeline" xmlns:p="http://www.w3.org/ns/xproc">
    
    </p:pipeline>
  2. Open the pipeline.xpl file in your favorite editor.
  3. Declare the following options for your pipeline:
    • source-document-uri
    • source-base-uri
    • result-document-uri
  4. Add a step to load the source document.
    <p:load name="load-source-document">
      <p:with-option name="href" select="resolve-uri($source-document-uri, $source-base-uri)" />
    </p:load>
  5. Add a step that performs an XSLT transformation using the list-topic-images-xhtml.xsl stylesheet.
    <p:xslt name="list-images">
      <p:input port="stylesheet">
        <p:document href="../xsl/list-topic-images-xhtml.xsl" />
      </p:input>
    </p:xslt>
  6. Add a step to store the XHTML output to the result document.
    <p:store name="write-html-page">
      <p:with-option name="doctype-public" select="'-//W3C//DTD XHTML 1.1//EN'" />
      <p:with-option name="doctype-system" select="'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'" />
      <p:with-option name="href" select="$result-document-uri" />
      <p:with-option name="indent" select="'true'" />
      <p:with-option name="method" select="'xhtml'" />
    </p:store>
  7. Save your changes.
  8. Test your XProc pipeline with the com.componize.samples.lab10.PipelineTest unit test.