The purpose of this guide is to explain what AtlaBase library data contains and how you can work with it.
Our library editors gather data from a variety of file formats, usually PDF, PNG, DWG and IES files. The information therein is then transferred to our relational database in an information schema we call the ABF (AtlaBase Format). It is then regularly exported to our customers in the form of XML files in the CEF (Common Export Format) schema. The isolation between ABF and CEF allows us to develop new features without disturbing our customers with unnecessary CEF changes. It also allows us to export CEF files of different versions to different customers as required.
For both historical and technical reasons Capture are our only client with direct access to ABF data. We rely on the Capture Component for fixture visualisation in our ABF editor, which requires faster turnaround times than possible through batch exports. This also explains why some data may appear to be missing from the CEF.
CEF files are UTF-8 encoded XML files using the AtlaBase CEF schema. The CEF schema contains entity definitions for various types of objects such as fixtures and filters. A CEF file may contain one or many such objects.
|CEF schema 2.4.2||AtlaBase.CommonExportFormat.xsd|
The CEF schema is the primary documentation of our CEF file format. The rest of this guide provides additional information and explanations for things you can find in a CEF file.
1.1 About XML schemas
An XML schema is the recipe for the contents of an XML file. It defines the content structure of an XML file. XML schemas are XML files themselves, but with an XSD file ending. If you are new to working with XML schemas we recommend that you invest some time into studying them.
XML schema files are useful in many ways:
- They document an XML file format.
- They can be used for validation of XML files.
- They can be used to generate software code that make development easier.
- They can be used by XML editors for syntax checking and autocompletion.
1.2 Working with XML files
All common programming languages come with XML support of some kind. They all have their pros and cons, but we stress the importance of first surveying your options. Generally speaking, there are three common approaches to reading XML files available:
XML readers. In Java called SAX and in .Net XmlTextReader. It reads bit by bit of an XML file and lets the application know what it has found. It is the most performant approach, but only supports forward scanning.
DOM readers. In Java the DocumentBuilder classes and in .Net the XmlDocument and XDocument classes. DOM is short for “Document Object Model” and this approach reads the entire contents of the XML document into memory in a structure fashion that allows for random access of the entire document, either by specific navigation of the substructure, or by means of XPath which is a very powerful way of identifying specific elements of an XML (or rather any DOM structure).
Object mapping. The contents of the XML file are mapped into code objects of classes that match the contents of the XML file. This is done either by manually declaring classes in code that match the structure of the XML or by automatic generation of such. In Java this is known as JAXB and in .Net as XML Serialization.
The most powerful approach and the one that we would recommend is the last, object mapping.
In C#.Net there is a command line tool available called Xsd.exe that can generate all code necessary to serialize and deserialize XML files with only a few lines of code.