XML data and Julian types
12-01, 16:05–16:35 (Europe/Amsterdam), Auditorium

Developing applications often requires interacting with data in various file formats, many of which utilize the XML format and a corresponding schema file. In Julia leveraging the type system is crucial for creating efficient architectures. However, we currently lack a convenient way to represent XML data as specific Julia types. To address this gap, I have developed XsdToStruct.jl, AbstractXsdTypes.jl, XmlStructLoader.jl, and XmlStructWriter.jl. Join me on a journey through intricate W3C specifications as I demonstrate how you can streamline type creation by harnessing the information already present in the schema.


When developing applications, the need to handle data serialization and deserialization across various file formats is a common challenge. Many of these formats are based on the Extensible Markup Language, or XML for short. Many web and industry standards use such an XML based file format.

While Julia already offers packages for reading and writing XML files, there's a missing piece of the puzzle: XML data binding in Julia. XML data binding involves representing information using native data types of a language. In the context of Julia, this approach is particularly powerful as it allows us to harness the full potential of Julia's type system. In particular, it allows us to better use multiple dispatch for handling these XML files.

But to be to able to perform this data binding we need to know the definitions and properties of the data types used in a given XML document. This information is typically provided in an accompanying XML schema document (XSD). The XSD serves as the foundation for creating type or class definitions, a concept well-established in XML data binding frameworks in languages like C++, Java, or C#.

In my talk, I will introduce four Julia packages that bring XML data binding capabilities to Julia developers.
The first one "XsdToStruct.jl" contains the functionality to generate Julia structs from a given XSD file. This output is then accompanied by the second package "AbstractXsdTypes.jl", which contains the abstract type parents and also some convenient extra functions for the generated types. The "XmlStructLoader.jl" package then provides a convenient way to load XML files into the generated structures. And finally using "XmlStructWriter.jl" you can write these structures into well formed and valid XML files.

Join me as I showcase the workings of XsdToStruct, demonstrating how it transforms intricate XSD definitions into Julia structs and how you can the leverage these structs in your own code. I will also highlight some of the neat functionality you get included for free with AbstractXsdTypes for these generated types.