s-expression/xml isomorphism
After some discussions with Dr. George recently, I was interested in exploring the relationship between xml and s-expressions. This has certainly been done before, but I thought I would try my hand at it. In the end result, I’m able to convert an s-expression such as:
|
|
to xml:
|
|
I do so with a somewhat strange but more explicit intermediate format:
|
|
This shows pretty clearly how a single namespace xml document can be represented with an s-expression. What I’m wondering now is if I can go from the intermediate representation to something like YAML or JSON. George and I have been calling these ‘tree languages’; I wonder if some sort of overarching equivalence for these ‘tree languages’ can be shown?
I don’t think this has much practical use, but the code is here.