ArticleslgStudy

computer science

OmniMark

OmniMark is a computer 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 OmniMark rather than just read about it. In short: OmniMark is a fourth-generation programming language used mostly in the publishing industry. It is currently a proprietary software product of Stilo International.

Key takeaways

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

Reference excerpt

OmniMark is a fourth-generation programming language used mostly in the publishing industry. It is currently a proprietary software product of Stilo International. As of July 2022, the most recent release of OmniMark was 11.0.

Usage OmniMark is used to process data, and convert it from one format to another, using a streaming architecture that allows it to handle large volumes of content sequentially without having to keep it all in memory. It has a built-in XML parser, and support for XQuery via integration with Sedna native XML database. It also has features to process find rules which implement a similar concept to regular expressions, although the pattern expression syntax is more English-like than the regular expression syntax used in Perl and other languages like the Ruby programming language, both of which are more widely used than OmniMark. OmniMark can also be used for schema transformation tasks in the same way as XSLT, but supports switching between procedural and functional code without the need for any additional constructs to support the procedural elements.

History OmniMark was originally created in the 1980s by Exoterica, a Canadian software company, as a SGML processing program called XTRAN. XTRAN was later renamed OmniMark, and Exoterica became OmniMark Technologies. The current owners of OmniMark, Stilo International, have their main offices in the UK but also maintain an office in Canada. In 1999, OmniMark president and CEO John McFadden announced that OmniMark 5 would be available free of charge, to better compete with Perl. OmniMark is no longer distributed under such a model.

Programming model OmniMark treats input as a flow that can be scanned once, rather than as a static collection of data that supports random access. Much of an OmniMark program is in the form of condition=>action rule where the condition recognizes a length of data to be acted upon and the action specifies what is to be done with the data. There are two kinds of condition:

An element rule, which can only be used with structured documents (well-formed XML, valid XML, or SGML), recognizes a complete element: the start tag, the element content, and the end tag. Since the content may hold other elements, element rules can operate in a nested fashion. OmniMark manages the nesting in such a way that the element rules can be defined independently of each other. A pattern, which can be used with both structured and unstructured documents, recognizes a length of text. Patterns are used like regular expressions in other languages (python, Perl, awk, ...) but have an English-like syntax that facilitates the creation of complex expressions. When parsing a structured document, patterns can be used on text going into the parser or on text coming out of the parser.

Processing unstructured input Find rules are used to apply patterns to unstructured input. Lengths of text are recognized by a pattern that includes temporary pattern variables to capture any part of the text that will be needed in the output. The action uses those variables to produce the required output:

If two find rules can recognize the same sequence of text, the first rule will “eat” the sequence and the second rule will never see the text. Input that is not recognized by any find rule does not get “eaten” and passes right through to the output.

Processing structured input (XML, SGML) OmniMark sees input as a flow; a program does not hold input data in memory unless part of the data has been saved in variables. As the input flows by, OmniMark maintains an element stack containing information that can be used to guide the transformation of text via the OmniMark pattern-matching facility. When each start tag is encountered, OmniMark pushes another element description on the stack. The element description includes the element name, the attribute names with the types and values of the attributes, along with other information from the parser (such as whether that element is an EMPTY element). When the corresponding end tag is encountered, the element description is popped from the top of stack. With SGML, some tags may be omitted, but OmniMark acts as if the tags were present and in the right places.

OmniMark element stack

An OmniMark program uses element rules to process XML or SGML documents. An element rule:

gets control just after the start tag has been parsed, and the element description has been pushed on the element stack. The action for the element rule has access to the descriptions of the current element and all the ancestor elements s back to the document root. passes control back to the parser by requesting the parsed content of the element in the special value "%c". The content is usually requested for scanning with pattern matching, rather than for storage in a variable. gets control again when the corresponding end tag has been parsed, but before the element description is popped from the element stack. The action for the element rule still has access to the descriptions of the current element and all the ancestor elements back to the document root. Since elements can be nested, several element rules can be in play at the same time, each with a corresponding element description on the element stack. Element rules are suspended while waiting for the parser to finish parsing their content. Only the rule for the element at top of stack can be active. When end of content is reached for the element at top of stack, the action for the corresponding element rule gets control again. When that action exits, the element description is popped and control is returned to the action for the next lower element on the stack. An element rule might simply output the parsed content (as text) and append a suffix:

A program does not need to name all of the document elements if the unnamed elements can be given some kind of generic processing:

Pattern matching on output from the parser The parsed content of each element is made available within an element rule and can be modified by a repeat ... scan block that uses patterns to identify the text to be modified:

The first pattern that matches a leading part of the text will “eat” that text and the text will not be available to the following patterns even if one of the following parts could match a longer leading part of the text. Any leading part that does not match one of the patterns in a repeat ... scan block will be discarded.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with OmniMark

Start with the simplest possible case. Write down what OmniMark claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer 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 OmniMark 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 OmniMark 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 OmniMark

In research
OmniMark appears in computer 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 OmniMark 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
OmniMark is common in secondary-school and first-year university syllabi. It links to neighbouring topics Text-oriented programming languages, XML software, so understanding it makes those chapters shorter.
In everyday life
Look for OmniMark 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 “OmniMark” →

How to study OmniMark in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what OmniMark 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 OmniMark out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is OmniMark in simple terms?

OmniMark is a fourth-generation programming language used mostly in the publishing industry. It is currently a proprietary software product of Stilo International.

Why does OmniMark matter?

Because it connects several computer 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 OmniMark?

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

Tags

  • Text-oriented programming languages
  • XML software

Keep exploring