Defining recursive algebraic data types in XML XSD
- by Ben Challenor
Imagine I have a recursive algebraic data type like this (Haskell syntax):
data Expr = Zero
| One
| Add Expr Expr
| Mul Expr Expr
I'd like to represent this in XML, and I'd like an XSD schema for it.
I have figured out how to achieve this syntax:
<Expr>
<Add>
<Expr>
<Zero/>
…