[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
=?UTF-8?Q?Re=3A_=5Bxml=2Ddev=5D_A_success_story_=E2=80=A6_using_DFDL_to_pars?==?UTF-8?Q?e_=28and_unparse=29_air_navigation_data?=
- From: Kit <kit.saels@gmail.com>
- Date: Fri, 14 Apr 2023 22:29:55 +0200
An alternative could be this:
<Runway
GLS_Channel="20abc"
Identifier="RW25R"
Latitude="N82091570"
Longitude="E156450340"
/>
--
Kit
pá 14. 4. 2023 v 19:13 odesílatel Roger L Costello <costello@mitre.org> napsal:
>
> 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" />
> <xs:element name="Runway_Identifier" type="validString" dfdl:lengthKind="explicit" dfdl:length="5" />
> <xs:element name="Station_Latitude" type="validString" dfdl:lengthKind="explicit" dfdl:length="9" />
> <xs:element name="Station_Longitude" type="validString" dfdl:lengthKind="explicit" dfdl:length="10" />
>
> 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>
> <Runway_Identifier>RW25R</Runway_Identifier>
> <Station_Latitude>N82091570</Station_Latitude>
> <Station_Longitude>E156450340</Station_Longitude>
>
> 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:
>
> Size of the AirNav.dat file is 375 MB
> Size of the XML file that DFDL parsing produced is 4.67 GB
> Recall I said that the DFDL processor can output many different formats, one being EXI (binary XML). I did that and the resulting output is nearly as small as the original air nav text file. The size of the EXI file is 384 MB
>
> /Roger
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]