Application Integration with XProc
Upcoming SlideShare
Loading in...5

Application Integration with XProc



This presentation gives an brief overview of XProc and discusses its potential as an application integration technology.

This presentation gives an brief overview of XProc and discusses its potential as an application integration technology.



Total Views
Views on SlideShare
Embed Views



5 Embeds 219 202 10 5 1 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Application Integration with XProc Application Integration with XProc Presentation Transcript

  • Application Integration with XProc Vojtech Toman Principal Software Engineer EMC Corporation
  • Overview XProc basics Application integration with XProc Q/A
  • XProc: An XML Pipeline Language W3C Candidate Recommendation Language for describing operations to be performed on XML documents Declarative, XML-based, extensible View slide
  • XProc Status XProc processor implementations Calabash ( Calumet ( …more in development Informal website about XProc and its use XProc Test Suite View slide
  • Validate/XQuery/Transform Pipeline Validate XQuery XSLT
  • XProc Basics Step Performs a well-defined task Validate, XSLT, XInclude, identity transformation, rename elements, … Three main step types: Atomic, compound, and built-in language constructs Pipeline Sequence (possibly non-linear) of steps Is a step itself Built-ins For-each, choose, try/catch, … XPath as expression language
  • Anatomy of an XProc Step Step declaration Type, input ports, output ports, options When used in a pipeline, a step source is a black box that Step Expects zero or more XML documents on result its input ports Produces zero or more XML documents on its output ports
  • Step Declaration – Atomic Steps Standard XProc step: p:add-attribute <p:declare-step type="p:add-attribute" xmlns:p=""> <p:input port="source"/> <p:output port="result"/> <p:option name="match" required="true"/> <p:option name="attribute-name" required="true"/> <p:option name="attribute-value" required="true"/> </p:declare-step>
  • Step Declaration – Compound Steps Pipeline that applies the p:add-attribute step <p:declare-step> <p:input port="source"/> <p:output port="result"/> <p:add-attribute match="book" attribute-name="foo" attribute-value="bar"/> </p:declare-step>
  • Extensibility of XProc Custom steps Step libraries & import functionality Extension attributes Implementation-defined mechanisms I/O extensibility Security …
  • Application Integration with XProc XProc as the XML processing layer Integration using standard XProc facilities Interoperable Integration using extensions Implementation-dependent Limited interoperability
  • XProc – Enabling Technology Some XML standards depend on XML processing capabilities XForms XForms XML The XRX architecture HTTP XForms/REST/X...... XML End-to-end XML model XProc XProc is a natural fit Native XML DB
  • Validate/XQuery/Transform Pipeline XProc itself integrates multiple XML technologies Easy to use, robust Focus on WHAT, not on the low-level HOW Better maintainability and customizability p:validate- with-xml- p:xquery p:xslt schema
  • Validate/XQuery/Transform Pipeline <p:for-each> <p:validate-with-xml-schema> <p:input port="schema">...</p:input> </p:validate-with-xml-schema> </p:for-each> <p:xquery> <p:input port="query">...</p:input> </p:xquery> <p:for-each> <p:xslt> <p:input port="stylesheet">...</p:input> </p:xslt> </p:for-each>
  • Executing external programs p:exec Program to execute p:exec Command-line arguments cmd Working directory Standard input/output Support for non-XML data Error handling
  • Executing external programs – Example Pipeline that counts the words in the input document <p:declare-step> <p:input port="source"/> <p:output port="result"/> <p:exec command="/usr/bin/wc" source-is-xml="false" result-is-xml="false"/> </p:declare-step>
  • Integration with REST Web Services p:http-request Request URL p:http-request Request method Request Authentication HTTP Headers Response REST Multipart messages Service
  • Integration with REST Web Services – Example Pipeline that retrieves the Twitter public timeline <p:declare-step> <p:output port="result"/> <p:http-request> <p:input port="source"> <p:inline> <c:request method="GET" href=""/> </p:inline> </p:input> </p:http-request> </p:declare-step>
  • Custom Atomic Steps Custom step that provides the ext:custom- integration logic step Implementation in the processor’s host language Step declaration + import Potentially not interoperable p:step-available() XPath function
  • Custom Atomic Steps – Example Custom step that triggers a workflow (xproc-wf.xpl) <p:declare-step type="wf:trigger-workflow" xmlns:wf=""> <p:input port="source"/> <p:option name="workflow-type" required="true"/> </p:declare-step> Usage: <p:declare-step xmlns:wf=""> <p:input port="source"/> <p:import href="xproc-wf.xpl"/> <wf:trigger-wf workflow-type="translate"/> </p:declare-step>
  • Integration on the I/O level Resource access in XProc is URI-based XProc processors should support file and http(s) Support for other URI schemes is implementation-defined Transparent support for additional storage models/systems p:load p:store Storage system
  • Integration on the I/O Level - Example Pipeline that loads a document from a native XML database <p:declare-step> <p:output port="result"/> <p:load href="xhive:/books/book24.xml"/> </p:declare-step>
  • Other Types of Integration XML data model integration Persistent DOM-based native XML databases Integration via other XML languages XSLT and XQuery extensions
  • Conclusions XProc deals with composing XML processes Extensible by nature Easy to integrate with external world Declarative code easier to develop and maintain
  • Questions and Answers Vojtech Toman