Here is a brief overview of the steps required to implement xmltr within your Frontier publishing environment. A more detailed explanation is provided in the separate xmltr tutorial and in the xmltr howtos.
Step 1: Download the Software
Firstly you need to download the xmltr suite:
This archive contains an exported Frontier table (suites.xmltr) plus this documentation in pdf format.
You will also need the blox suite from Technology Solutions at: http://www.techsoln.com/ .
Step 2: Import the Xmltr Suite
Import the xmltr suite into your Frontier root. There is no need to run any initialisation scripts for the suite, which has no user interface.
Some demonstrations which translate xml to HTML are provided within the demos table in xmltr. You can try them out and see the results they produce.
Step 3: Markup Your Source Document
Next you need to analyse the structure of your documents and design a series of tags which capture that structure. For example you might define a <page></page> tag pair to denote a web page. A <section></section> tag pair might define sections within a page. A <title> tag pair might be used for headings (and remember you can re-use the same tag names in different contexts and translate them differently). An <emph></emph> tag pair might denote text to be emphasized. And paragraphs could be delimited by <par></par>.
Edit your source document to insert the required xml tags.
See the demos in the suite or the xmltr tutorial for an example.
Step 4: Define Your Translation Rules
For each possible pattern of tags within your source document, you need to define a translation rule. For example, a <page> tag is one pattern. <page><section> might be another. <page><section><par><emph> might be yet another. Decide how you want to translate the content of each of these tags within each specific context.
You can use wildcard translation rules to define a translation rule which should be applied for a tag when the context is not important (for example, you might want <emph> translated into the HTML <b></b> tag pair irrespective of the context of the <emph> tag pair in the source document). You can also specify a default translation rule which will be used if no other rule match is found.
Translation rules can use simple string substitutions or can be arbitrarily complex Frontier scripts. Within a script translation rule, you have access (via the blox suite) to the attributes associated with the xml tag which triggered the rule. These may be used to provide additional information to the translation rule for example a <page> tag might define attributes for the HTML file name or the template to be used when rendering the page via the Frontier WSF.
Step 5: Translate Your Documents
Import your xml source document into Frontier, present it to the blox parser to generate an xml parse tree, then call xmltr.TranslateTree() to apply your translation rules (with whatever results they generate).
Thats all there is to it.
Website built using Frontier and xmltr. Documentation also available in pdf format for offline reading. Copyright The Design Group Qld 2000. This page last updated Tue, 7 Nov 2000