UPL Processor
What's UPL?
UPL (upCast Processing Language) is a specialized document processing language aimed at making document conversion from graphically marked-up documents into rich logically marked-up documents easy.
An example:
To turn any paragraph containing more than 85% of text
- that is bold and
- whose font-size is between 16pt and 18pt
into a heading of level 1, the following UPL code could be used:
It probably cannot get much easier than that, don't you think?
UPL gives its users the flexibility to perform a broad range of typical and complex tasks in the realm of document conversion, hiding the complexity. UPL is very intuitive to use, robust and extendable. The development of UPL was not purely academic, it was likewise driven by requirements emerging in document conversion projects all around the world.
Specific functionality
… for:
Layout querying
At every node in the document, you can query it for its final styling properties, and by way of the unique %()
function, of its text descendants. You can also use XPath queries on layout properties.
Grouping
Yes, XSLT does grouping, too. But UPL's unique Painter grouping paradigm offers a way of lazy evaluation and recursive grouping specification that is much easier to specify. Specific painters placed on document nodes relieve you from tedious xsl:choose
programming, and you can rely on the layout property query functions for grouping conditions.
Creating markup using regular expressions
UPL lets you introduce markup based on regular expressions on the CDATA descendants of a node. It allows you to automatically cut through in-between elements, and create the markup either on the nearest ancestor or the top level node - functionality, which you cannot achieve in XSLT - at least not in an easy way.
Given this typical markup:
you want to markup the initial numbering with a special element. Just writing
will produce the following result:
… and much more!
Like automatic list heading unraveling, creating markup based on styling properties, renaming elements, hoisting element children, deleting elements, etc. For a full list of functions, see the UPL documentation.