Version 1.2 – October 18
COSC 3311 Software Design
Report 2: XML Translation
Due: Thursday, November 4, 7:00pm
Work in groups of size 1 or 2
The report2 Application sub-directory contains the following files.
, which should not be changed.
– a Postscript file that contains the Postscript definitions that you
need to make your output a proper Postscript file.
An example input file
showing some of the components in the XML
files translated by the system you are to develop.
An example output file
shows a prototype of the Postscript translation
Look at lines 548 to 624, the earlier lines are a copy of
The output was manually translated and, as a consequence, is not an exact
translation as specified in the specification – display line lengths were not calculated, they were
estimated instead – but the output is close enough to understand what is required.
added manually, describe the translation.
The output file can be displayed with ghostview on
Input and output structures
Input file structure
The input file is a tagged ASCII file.
The tags are a small subset of the XML/HTML tags used in web
The input files have the following EBNF description.
Legend: [ A ]
– optional A, can have or not have
[ A , B ]
– optional choice: can have A or B
– zero or more iterations of the choice – can have a different choice for
( A )
– must have an A
( A , B)
– must have one of A or B
– one or more iterations of the choices – can have a different choice for
– have an A followed by a B; there is a space between the A and B
The input file, viewed as a sequence of ASCII characters, has the following structure.
+[ Line ] Eof ;
[ [ Space ] Tag [ Text ] , Text ] Eol ;
TagName ‘>’ ;
+( Word , Space) ;
+( GraphicCharacter ) ;
+( ‘ ’ ) ;
Any ASCII character that puts ink on paper -- no whitespace or control
( “SECTION” , “/SECTION” , “P”, “UL”, “LI”, “/UL”) ;
The input file, viewed as a sequence of tagged components, has the following structure, which uses
some of the previous rules.