company logo
search | contact | company
product logoWord to XML roundtripping pipeline processor
  • Overview
  • Features
  • Support
  • Downloads
  • Licensing
  • News
 
  • Importers
  • Processors
    • Pipeline Variables
    • UPL Processor
    • Sectioner
    • Commandline Processor
    • XSLT Processor
    • Unicode Translation Processor
    • XML Validator
    • External Pipeline Processor
  • Exporters
 
Home / Features / Processors / UPL Processor

UPL Processor

This is easily the most useful module of all. The UPL processor implements a custom document processing language, the upCast Processing Language. It implements operations targeted specifically at document processing and conversion.

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

  1. that is bold and
  2. whose font-size is between 16pt and 18pt

into a heading of level 1, the following UPL code could be used:

[element(uci:par) and %(@font-weight="bold" and @font-size >= 16pt and @font-size <= 18pt) > 0.85] { set-heading-level(1); }

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:

<par><b>1.</b> <i>a) </i>Some text</par>

you want to markup the initial numbering with a special element. Just writing

[element(par]] { markup-regex( "^(\\d+[.][ ][a-z]\\))", { "ignore()", "group-shallow(numbering)" } ); }

will produce the following result:

<par><inline type="numbering"><b>1.</b> <i>a)</i></inline><i> </i>Some text</par>

… 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.

 

© 2003-2024 infinity-loop GmbH | Send mail to Webmaster | Impressum | Datenschutzerklärung | Privacy Policy