Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...
Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...
Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
5. FRAMEWORK EVALUATION 5.2. Operational Validation<br />
Listing 5.9: Apache block in XML<br />
<br />
%c%c%c%c%c<br />
<br />
%m.start%a.name%m.end<br />
<br />
<br />
%n<br />
<br />
<br />
%e%m.equal%e<br />
MIMEMagicFile<br />
/usr/local/apache/conf/magic<br />
<br />
<br />
%n<br />
<br />
<br />
%m.start%a.name%m.end<br />
<br />
<br />
6-8) and comments (line 10). The complete configuration file is in Annex B.3. The file contain-<br />
ing the co<strong>de</strong> generated by the tool for this configuration file is found at http://www-asc.<br />
di.fct.unl.pt/˜jml/SmART/xml.xml.<br />
The tool produced the following XML for the <strong>em</strong>pty block (Listing 5.14), block containing<br />
parameters (Listing 5.15), nested blocks (Listing 5.16) and comments (Listing 5.17):<br />
The Metadata generated by the tool is represented on Listing 5.18.<br />
Then, the file was re-converted to its original syntax. diff showed that the differences be-<br />
tween the original and generated files are some extra new lines in the generated file. This is due<br />
to the original file having a dual criteria for new lines. In some places, an XML tag is followed<br />
by a new line, where in other places they are not.<br />
Still, the tool is able to recognize the whole file, and it produces a file which is completely<br />
functional and well <strong>de</strong>fined.<br />
5.2.4 Parsing the Generated XML<br />
In or<strong>de</strong>r to make sure that the XML file generated by the tool was in<strong>de</strong>ed valid, an experiment<br />
was carried: parsing the file generated by the tool. Beforehand, the tool should be able to parse<br />
the generated XML file since it is able to parse files res<strong>em</strong>blant to XML.<br />
First, OGC (Original to Generic syntax Converter) was called to parse a configuration file.<br />
From this parse resulted the file xml1. Then, OGC was called again to parse xml1 into xml2.<br />
Then, GOC (Generic to Original syntax Converter) was called to print xml2 into xml3, and<br />
finally GOC was called again to print xml3 into the final file. This is <strong>de</strong>picted in Figure 5.1.<br />
58