AXE - Cutting XML specification down to size
Frustrated that specifying the structure of XML data was too complicated, we decided to see if we could do better...
What if an example of your XML data could be your XML format specification?
<Animal Name='Mouse' LatinName='Mus'> <BodyLength>7.5</BodyLength> <TailLength>3.5</TailLength> <Eats> <Food>Cheese</Food> </Eats> </Animal>But you could make your specification more accurate by adding annotations, for example to say what was optional and what could occur multiple times:
<Animal Name='Mouse' LatinName='?Mus'> <BodyLength>7.5</BodyLength> ? <TailLength>3.5</TailLength> ? <Eats> + <Food>Cheese</Food> </Eats> </Animal>And you could add further annotations to specify your types more accurately:
<Animal Name='string' LatinName='? string'> <BodyLength>float( min=0 )</BodyLength> ? <TailLength>float( min=0 )</TailLength> ? <Eats> + <Food>string</Food> </Eats> </Animal>And you could make it more modular by defining your own simple types:
<Animal Name='string' LatinName='? string'> <BodyLength>positiveFloat</BodyLength> ? <TailLength>positiveFloat</TailLength> ? <Eats> + <Food>string</Food> </Eats> </Animal> positiveFloat = float( min=0 )Or your own complex types:
<Animal>AnimalType</Animal> AnimalType = <_ Name='string' LatinName='? string'> <BodyLength>positiveFloat</BodyLength> ? <TailLength>positiveFloat</TailLength> ? <Eats> + <Food>string</food> </Eats> </_> positiveFloat = float( min=0 )Then you've got an Annotated XML Example or AXE...
The main aim of Codalogic's primary product is to make using XML data in applications really easy. The aim is that people that do not regularly use XML, or just want to use XML as a means to an end, can interact with XML data easily and quickly. For this we developed a C++ XML data binding tool. The problem we had though is that it required the user to specify their XML data structures using W3C XSD XML Schemas. As many will know, this really requires guru levels of XML knowledge and conflicted with our main mission.
We started to wonder if we could come up with a simpler way to enable our customers to specify their XML's structure. After a few attempts that didn't go anywhere, we started to wonder if a customer could use a file containing an example of their XML data to describe their XML format.
We found that typically on its own an XML example is not sufficient to describe a full XML vocabular. Then it occurred to us that maybe the customer could add small cues or annotations to the XML example to help the tool better understand the format of the XML.
From here Annotated XML Example (or AXE as we call it) was born.
The result is that AXE allows you to start specifying your XML data structure using just an example of your XML data. You can then add simple and intuitive annotations to that example to build up a complete and powerful description of your XML data structure.
We're excited about AXE, and we hope that it will become widely adopted. We hope that XML parser maintainers will implement AXE as a validation technology alongside validators such as XSD XML Schema and Relax NG. We also hope that XML IDE suppliers will also incorporate AXE into their tools.
But we also realise that we have to spend some time convincing fellow developers that AXE is a worthwhile technology, and we need to document AXE better, and we hope that it can be adopted by a suitable standards organisation, and we hope..., well lots of things really. Which is why we hope to work with the developer community to achieve these goals. Which is why we've set up these web pages.
Finding out more
To read more about AXE you can read the current specification.
We also are building up a list of tools that support AXE.