XProc pipelines may be created in Callimachus just like any other type of resource. Navigate to any Callimachus folder where you have write access and select Pipeline from the menu.

You will be redirected to an editor with the default pipeline definition pre-populated in it:

To create your pipeline, simply type (or copy) your XProc definition into the editor. A simple XProc pipeline that outputs "Hello, World" looks like this:

<?xml version="1.0" encoding="UTF-8" ?> 
  
<p:pipeline version="1.0" 
      xmlns:p="http://www.w3.org/ns/xproc" 
      xmlns:c="http://www.w3.org/ns/xproc-step" 
      xmlns:l="http://xproc.org/library"> 
  
<p:serialization port="result" media-type="text/plain" method="text" /> 
  
<p:identity> 
  <p:input port="source"> 
    <p:inline> 
      <c:data content-type="text/plain">Hello, World</c:data> 
    </p:inline> 
  </p:input> 
</p:identity> 

</p:pipeline>

The output of this pipeline may be retrieved by resolving its URL with the suffix "?results" appended.

If you saved the above pipeline at the URL http://example.com/test/hello-world.xpl then you can get the pipeline itself at that URL, a human-readable HTML page containing the pipeline at http://example.com/test/hello-world.xpl?view and the results of the pipeline at http://example.com/test/hello-world.xpl?results, like this:

$ curl http://example.com/test/hello-world.xpl 
<?xml version="1.0" encoding="UTF-8" ?> 
<p:pipeline version="1.0" 
      xmlns:p="http://www.w3.org/ns/xproc" 
      xmlns:c="http://www.w3.org/ns/xproc-step" 
      xmlns:l="http://xproc.org/library"> 

<p:serialization port="result" media-type="text/plain" method="text" /> 

<p:identity> 
  <p:input port="source"> 
    <p:inline> 
      <c:data content-type="text/plain">Hello, World</c:data> 
    </p:inline> 
  </p:input> 
</p:identity> 

$ curl http://example.com/test/hello-world.xpl?results 

                     Hello, World

You might be thinking, "Wow! That's typical XML! Very verbose to do so little." We hope to convince you that XProx is an excellent way for us to extend Callimachus into new areas, such as gathering, transforming and rendering data from anywhere on the Web.

In the "Hello, World" example, the serialization tag sets the MIME type of the result. If this tag is not present, XProc defaults to a MIME type of "application/xml" and a method of "xml".

The p:identity tag is used to echo any defined input to the output. In this case, we specified a literal string and asked that it be put to the output.

We could do something similar by getting a resource from the Web and putting it to the output. It would be more interesting to get two resources from the Web and combine them. The following section gets two Atom feeds from blogs, combines them and creates a new Atom feed of the results.