Pipeline naming example

<p:pipelines xmlns:p="http://www.w3.org/2006/xproc">

<p:pipeline name="pipe">
  <p:declare-input port="document"/>
  <p:declare-input port="schema"/>
  <p:declare-input port="stylesheet"/>
  <p:declare-input port="pre-xi-schema"/>
  <p:declare-output port="resultdocs" ref="#getchaps/chaps"/>
  <p:declare-output port="manifest"/>

  <p:choose name="validxi">
    <p:declare-input port="input" ref="#pipe/pre-xi-schema"/>
    <p:declare-output port="result"/>

    <p:when test="/*">
      <p:step kind="validate">
	<p:input port="document" ref="#pipe/document"/>
	<p:input port="schema" ref="#pipe/pre-xi-schema"/>
	<p:output port="result" ref="#validxi/result"/>
      </p:step>
    </p:when>
    <p:otherwise>
      <p:step kind="identity">
	<p:input port="document" ref="#pipe/document"/>
	<p:output port="result" ref="#validxi/result"/>
      </p:step>
    </p:otherwise>
  </p:choose>

  <p:step kind="xinclude" name="xinc">
    <p:input port="document" ref="#validxi/result"/>
    <p:output port="result"/>
  </p:step>

  <p:step kind="validate" name="chkvalid">
    <p:input port="document" ref="#xinclude/result"/>
    <p:input port="schema" ref="#pipe/schema"/>
    <p:output port="result"/>
  </p:step>

  <p:for-each name="getchaps">
    <p:declare-input port="chapter" ref="#chkvalid/result" select="//chapter"/>
    <p:declare-output port="result" ref="#xform/result"/>

    <p:step kind="xslt" name="normalize">
      <p:input port="document" ref="#getchaps/chapter"/>
      <p:input port="stylesheet" href="normalize.xsl"/>
      <p:output port="result"/>
    </p:step>

    <p:step kind="xslt" name="xform">
      <p:input port="document" ref="#normalize/result"/>
      <p:input port="stylesheet" href="doc2html.xsl"/>
      <p:output port="result"/>
    </p:step>
  </p:for-each>

  <p:step kind="xslt">
    <p:input port="document" ref="#chkvalid/result"/>
    <p:input port="stylesheet" ref="#pipe/stylesheet"/>
    <p:output port="result" ref="#pipe/manifest"/>
  </p:step>
</p:pipeline>

<p:pipeline name="pipe">
  <p:declare-input port="document" name="document"/>
  <p:declare-input port="schema" name="schema"/>
  <p:declare-input port="stylesheet" name="stylesheet"/>
  <p:declare-input port="pre-xi-schema" name="pre-xi-schema"/>
  <p:declare-output port="resultdocs" ref="xformresult"/>
  <p:declare-output port="manifest" ref="manifest"/>

  <p:choose name="validxi">
    <p:declare-input port="input" name="validxiin" ref="pre-xi-schema"/>
    <p:declare-output port="result" name="validxiout" ref="testresult"/>

    <p:when test="/*">
      <p:step kind="validate">
	<p:input port="document" ref="document"/>
	<p:input port="schema" ref="pre-xi-schema"/>
	<p:output port="result" name="testresult"/>
      </p:step>
    </p:when>
    <p:otherwise>
      <p:step kind="identity">
	<p:input port="document" ref="document"/>
	<p:output port="result" name="testresult"/>
      </p:step>
    </p:otherwise>
  </p:choose>

  <p:step kind="xinclude" name="xinc">
    <p:input port="document" ref="validxiout"/>
    <p:output port="result" name="xincout"/>
  </p:step>

  <p:step kind="validate" name="chkvalid">
    <p:input port="document" ref="xincout"/>
    <p:input port="schema" ref="schema"/>
    <p:output port="result" name="vout"/>
  </p:step>

  <p:for-each name="getchaps">
    <p:declare-input port="test" name="chapter"
		     ref="#chkvalid/result" select="//chapter"/>
    <p:declare-output port="result" ref="xformresult"/>

    <p:step kind="xslt" name="normalize">
      <p:input port="document" ref="chapter"/>
      <p:input port="stylesheet" href="normalize.xsl"/>
      <p:output port="result" name="normres"/>
    </p:step>

    <p:step kind="xslt" name="xform">
      <p:input port="document" ref="normres"/>
      <p:input port="stylesheet" href="doc2html.xsl"/>
      <p:output port="result" name="xformresult"/>
    </p:step>
  </p:for-each>

  <p:step kind="xslt">
    <p:input port="document" ref="vout"/>
    <p:input port="stylesheet" ref="stylesheet"/>
    <p:output port="result" name="manifest"/>
  </p:step>
</p:pipeline>

</p:pipelines>

Received on Wednesday, 2 August 2006 12:58:41 UTC