Jump to content

XProc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 109.91.132.57 (talk) at 15:56, 24 March 2010 (XProc status is now Proposed Recommendation, small code correction due to this made, too). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
XProc
Filename extension
.xpl
Internet media type
application/xml
Developed byWorld Wide Web Consortium
Type of formatStylesheet language
Extended fromXML
Standard1.0 (Proposed Recommendation)

XProc is a W3C Proposed Recommendation to define an XML transformation language to define XML Pipelines.

Below is an example XProc file:

<p:pipeline name="pipeline" xmlns:p="http://www.w3.org/ns/xproc" 
  version="1.0">
  <p:input port="schemas" sequence="true"/>

  <p:xinclude name="included">
    <p:input port="source">
      <p:pipe step="pipeline" port="source"/>
    </p:input>
  </p:xinclude>

  <p:validate-with-xml-schema name="validated">
    <p:input port="source">
      <p:pipe step="included" port="result"/>
    </p:input>
    <p:input port="schema">
      <p:pipe step="pipeline" port="schemas"/>
    </p:input>
  </p:validate-with-xml-schema>
</p:pipeline>

This is a pipeline that consists of two atomic steps, XInclude and Validate. The pipeline itself has two inputs, “source” (a source document) and “schemas” (a list of W3C XML Schemas). The XInclude step reads the pipeline input “source” and produces a result document. The Validate step reads the pipeline input “schemas” and the output from the XInclude step and produces a result document. The result of the validation, “result”, is the result of the pipeline.

Here is the equivalent abbreviated XProc pipeline:

<p:pipeline name="pipeline" xmlns:p="http://www.w3.org/ns/xproc">
  <p:input port="schemas" sequence="true"/>

  <p:xinclude/>

  <p:validate-with-xml-schema>
    <p:input port="schema">
      <p:pipe step="pipeline" port="schemas"/>
    </p:input>
  </p:validate-with-xml-schema>
</p:pipeline>

Implementations

See also