ArticleslgStudy

science

XProc

XProc is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand XProc rather than just read about it. In short: XProc is an XML transformation language for processing documents in pipelines: chaining conversions and other steps together to achieve the desired results. It can handle documents in XML, HTML, JSON, text and binary.

Key takeaways

  • XProc belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect XProc to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of XProc from memory before moving on to harder problems.

Reference excerpt

XProc is an XML transformation language for processing documents in pipelines: chaining conversions and other steps together to achieve the desired results. It can handle documents in XML, HTML, JSON, text and binary. The current (stable) version is 3.1. While XProc 1.0 is a W3C Recommendation, XProc 3.1 is a standard developed by the W3C XProc Next Community Group. Its main characteristics are:

XProc is a programming language, expressed in XML, in which you can write pipelines. An XProc pipeline takes data as its input (often XML) and passes this through specialized steps to produce end results. Steps range from simple ones, like adding attributes, to more complex stuff like splitting/combining/pruning, transformations with XSLT and XQuery, validations against schemas, etc. Within a pipeline you can do things like working with variables, branching, looping, catch errors, etc. Everything is based on the data flowing through. XProc pipelines are not limited to a linear succession of steps. They can fork and merge. XProc allows you to create custom steps by combining other steps. These custom steps can be used just like any other. Therefore, pipelines and steps are interchangeable concepts in XProc. Custom steps can be collected into libraries. XProc aids in the housekeeping surrounding the processing, like inspecting directories, reading documents from zip files, writing things to disk, etc There is software that can execute these pipelines, the so-called XProc processors.

Example The following is a (very) simple XProc pipeline:

It declares two ports: An input port called source. This is where the original document flows in. An output port called result. This is where the resulting document flows out. The document that comes in through the source port automatically flows into the first step of the pipeline. This p:add-attribute step adds an attribute called timestamp with the current date and time. The result of this flows through the p:delete step that removes all attributes called data. Since p:delete is the last step, the resulting document flows out through the output result port. So if you supply the following XML document to this pipeline:

It comes out as:

The exact date and time recorded in the timestamp attribute is of course dependent on the date and time the pipeline is executed.

History Ideas for something, some programming language, for processing were there right from the beginnings of XML, at the end of the twentieth century. But it was not until the end of 2005 that the W3C started a working group called the XML Processing Model Working Group. This resulted in the recommendation for XProc 1.0 dated May 11, 2010. There were various attempts to create working XProc 1.0 processors. The only two currently available as open source products that implement the full 1.0 standard are XML Calabash and MorganaXProc. After the release of version 1.0, the XProc working group continued debating a next version. Ideas were raised for version 2.0. This was based on a non-XML syntax which didn’t raise a lot of support from the community. Engagement in the working grouped waned and in 2016 it ceased to exist. In June 2017 the XProc Next Community Group was founded and started working on a new version, now completely XML based. Because this was a completely different approach than the 2.0 initiative, the version number was increased to 3.0. A stable version was released on 12 September 2022. In 2024 the working group started work on a minor update which was released as XProc 3.1 on 29 May 2025. It fixes a few errata in the language specification and the standard step library and also publishes the following step libraries as finished specifications:

Dynamic pipeline execution - for running pipelines constructed dynamically File steps - for accessing and managing files on a filesystem Operating system steps - for accessing information about the operating system and running external commands Mail steps - for working with email Paged media steps - for applying CSS or XSL-FO to an XML or HTML document Text steps - optional text-related steps, eg. converting markdown to html. The standard step library already includes several required steps for working with text Validation steps - for testing whether an input conforms to a set of rules expressed in a schema. The input may be XML, HTML or JSON Invisible XML - for working with Invisible XML

Implementations The following processors support XProc 3.0 and above:

XProc 3.0 is backwards incompatible and therefore the above implementations are not expected to support XProc 1.0.

Older versions The following processors support the XProc 1.0 standard:

XML Calabash, maintained by Norman Walsh. This processor is also integrated in the Oxygen XML Editor product. Morgana Xproc 1.0, maintained by Achim Berndzen. There were several other XProc 1.0 implementations, but these were either incomplete or are not maintained.

Logo The XProc logo and mascot is a fish, called Kanava, after the Finnish word for pipeline. The logo was created by Bethan Tovey-Walsh.

References

External links Official website

Worked examples

Example 1 — a first encounter with XProc

Start with the simplest possible case. Write down what XProc claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to XProc before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about XProc ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of XProc

In research
XProc appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses XProc in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
XProc is common in secondary-school and first-year university syllabi. It links to neighbouring topics Concurrent programming languages, Data processing, Declarative programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for XProc outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “XProc” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study XProc in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what XProc means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain XProc out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is XProc in simple terms?

XProc is an XML transformation language for processing documents in pipelines: chaining conversions and other steps together to achieve the desired results. It can handle documents in XML, HTML, JSON, text and binary.

Why does XProc matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study XProc?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on XProc.

Tags

  • Concurrent programming languages
  • Data processing
  • Declarative programming languages
  • Domain-specific programming languages
  • Markup languages
  • World Wide Web Consortium standards
  • XML-based programming languages
  • XML-based standards

Keep exploring