Hi Folks, I created a parser to parse air navigation data (air nav data is the data that is loaded into the aircraft’s computer to enable it to fly the aircraft). The parser is completely declarative, i.e., it has no code. The parser is specified
using the DFDL language, which is a simple extension of XML Schema. Here is an excerpt of the DFDL schema that I wrote: <xs:element name="GLS_Channel" type="validString" dfdl:lengthKind="explicit" dfdl:length="5" /> Notice how declarative it is. It specifies “what” data fields are in the air nav document, not “how” to parse its data fields. That, in my opinion, is a huge benefit. I fed the air nav file into the Apache open-source DFDL processor (Daffodil), along with my DFDL schema. I instructed the DFDL processor to serialize the parsed air nav data to XML: I could have instructed the DFDL processor to serialize the parsed air nav data to JSON or to EXI (binary XML, i.e., super-compact XML) or to a number of other formats. The XML document that parsing produced is highly readable. Here is an excerpt of the XML output: <GLS_Channel>20abc</GLS_Channel> Notice how readable it is. And, of course, the XML document is highly processable. The entire XML suite of technologies may be used to process it.
In addition to the advantages just listed, DFDL also has the advantage of unparsing. Thus, I was also able to unparse the XML: Here are some interesting statistics:
/Roger |