caustin/schemavore — Issue #8: Add support for generating XSD documents using simple types
Author: caustin
Created: 2011-10-28 20:00:31+00:00
State: open

Stand alone XSDs should be composed of simple/primitive elements. These should be able to construct themselves by interrogating the elements they contain. Also, rendering should respect the order the elements were declared in. A possible api could be something like the following:

class SimpleDocument(Document):
first_name = String("firstName")
last_name = String("LastName")

sd = MySimpleDocument()
sd.first_name = "Joe"
sd.last_name = "Smith"

xml = sd.xml_document
xsd = sd.xsd_document

The other implication of this is that value needs to yanked out of the constructor of the document....and that the setter method must properly validate the data at the model level before it hits the renders.