Omnimark  ☑

Until the appearance of XSLT, Omnimark was a frequent choice for SGML conversions. It contained a pattern-matching language which enabled transformation between SGML and non-SGML formats (down-translation), between non-SGML and SGML formats (up-translation), and between arbitrary text formats (cross-translation).

Figure 13. Fragment of Omnimark code showing transformation to LaTeX

down-translate

global stream temp

element ABSTRACT 
        output "%n\begin{abstract}%n%c%n\end{abstract}"

element ACRONYM
        set buffer temp to "%c"
        output "%g(temp)\index{M}{%g(temp)}"
            when attribute remap isnt specified
        output "\acro{%g(temp)}{%v(remap)}"
            when attribute remap is specified
	  

In the example in Figure 13, “Fragment of Omnimark code showing transformation to LaTeX”, the %c emits the element content (equivalent to XSLT’s apply-templates); %n is a newline; %g dereferences a buffer; %v dereferences an attribute. A streaming feature meant the document did not have to be read into memory in its entirety; a value not yet encountered in document order (but known to occur) could be referenced, but not dereferenced until the end of processing, by which time the desired value would have been encountered and set as a referent).[6]

For a brief period in the late 1990s the product was made available without charge, but this was later abandoned. The software is still available in a much more advanced version for XML and is widely used in publishing workflows.



[6] Very large documents with very high numbers of such referents typically caused a brief but audible rattling at the end of processing as the disk drive actuator arm repeatedly sought and wrote the data from whatever temporary location had been created during processing.