After Aristotle explained to me that there's no reasonable way I can auto-generate JSON and YAML from the same Bermuda island file which defines the XML output format, I've decided to stop work on that for a while. Instead, I'm focusing my energy on the XML work. Today I've normalized the attribute and element island syntax. They're the same, except that the only quantifier allowed on an attribute is '?' (optional). Then I turned to RelaxNG generation.
if: 'defined $instance->revision'
Allows you to automatically generate this xml from an object:
<?xml version="1.0" encoding="utf-8"?>
<card revision="3" href="http://www.example.com/">
<name some_attr="foo">John Smith</name>
But it also generates RelaxNG which properly validates that XML:
<?xml version="1.0" encoding="UTF-8"?>
<element name="card" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-da
Yeah, I have a lot more work to do (like switching to full grammars), but this is coming along nicely.
Currently we default to UTF8, but that's easy to change. Also, I don't yet have "includes" to reference another island. That might take some major reworking of the XML to get that right, but I want to refactor a lot more of what I'm doing in order to make this workable.