10
« on: May 05, 2003, 12:49:07 pm »
I have been testing the XML schema generator and have been pleased with the results so far. There is one interesting piece that could really improve the generator and it revolves around leveraging Attribute Groups in One to Many relationships. An example is below (borrowed from VBXML.COM)
<attributeGroup name="bookInfo">
<attribute name="href" type="URI"/>
<attribute name="price" type="float" pattern="\d*(.\d{2})+"/>
<attribute name="isbn" type="string" pattern="\d{10}"/>
</attributeGroup>
<complexType name="book">
<attributeGroup ref="bookInfo"/>
</complexType>
The advantage of an attribute group is space. I have been working with some very large XML documents that were serialized out into a Database, then I pulled the model into EA. I then used the Schema Generator to see how close it was to the original XML document. The XSD was an isomporphic equivalent, but the documents would be much larger as the size of the XML document grew (repeating elements), this is due to the attributes being repeated everytime vs a reference.
Since the relationship of the tables is maintained in EA, it should be possible to take advantage of Attribute Groups in future releases of the Schema Generator.