FoX is an XML library written in Fortran 95. It allows software developers to read, write and modify XML documents from Fortran applications without the complications of dealing with multi-language development. FoX can be freely redistributed as part of open source and commercial software packages.
The developer is offered three principle APIs which are accessed as Fortran modules. FoX_wxml is an XML writer used to sequentially create arbitrary XML documents quickly with minimal memory requirements. Character escaping is handled within the library and the well-formedness constraints are enforced. FoX_sax is a streaming, validating parser based on java's Simple API for XML. Arbitrary XML documents can be read by registering callbacks on events such as the start of a new tag or of character data. This approach is fast and needs little memory (even for large documents) but can be difficult to use for complex documents. The third module, FoX_dom, offers a full implementation of the W3C document object model. An in-memory tree structure representing the XML document is created by parsing an existing document or creating and appending nodes to a new tree. This data structure can be modified and (re)serialized to disk. Two additional modules are available that ease the creation of XML documents in specific domains. FoX_wcml allows the creation of documents in a subset of the Chemical Markup Language suitable for computational chemistry and condensed matter physics. FoX_wkml allows the creation of KML documents used by applications such as Google Earth. Further information needed to use and obtain FoX is available here and elsewhere:
FoX is largely the result of work by Toby White during the eMinerals project. Toby is now platform lead at Timetric and FoX is currently maintained by Andrew Walker (Bristol Earth Sciences). The code was developed from earlier work by Alberto Garcia and Jon Wakelin. Much of the FoX_wkml module was written by Gen-Tao Chiang (Cambridge Earth Sciences).