XML Schemas Experiences Rogue Wave Software Allen Brookes
XML Schemas Experiences Rogue Wave Software Allen Brookes
Introduction • Rogue Wave XML Schema experience mainly from data binding product XML Object Link • Mostly positive experiences • Main issues • • Difficult Schema Features Invalid Schemas Versioning Compiler Limitations
Schema Features • Schema provides many features with no or no simple equivalent in C++ • Choice • Complex. Type restriction • Mixed content • Resulting representation may be inefficient or unnatural
Schema Features - Choice • Need to store all types possible in the choice • Need to store an indication of the current choice • Result is somewhat inefficient (extra storage) and unnatural (can hold and manipulate data not in the document)
Schema Features - restriction • Restriction cause class members to change type <complex. Type name=“base”> <sequence> <any/> </sequence> </complex. Type> <complex. Content> <restriction base=“base”> <sequence> <element name=“foo” type=“int”/> </sequence> </restriction> </complex. Content </complex. Type>
Schema Features – mixed content • Mixed content doesn’t seem consistent with XML as data language. • Our one request for mixed content didn’t really need it. <element name=“foo”> <complex. Type mixed=“true”> <attribute name=“bar” type=“string”/> </complex. Type> </element> <foo bar=“bar”>content</foo>
Invalid Schemas • Many customers have invalid schemas • • • Ambiguous schemas Circular includes Illegal restrictions Namespace problems Non standard extensions • Often generated by tools • Customers want schemas supported anyway
Versioning • Our versioning model: all versioning changes represented with new XML namespace. • Customers want XML data models to ignore extra element and attribute content. • Possible in our model only with wildcards.
Compiler Limitations • Large Schemas may cause too many classes to be generated. • FPML, Fix. ML, JXDM, JDF • Obvious fix would be to divide into multiple libraries but Schema doesn’t provide divisions that would make that possible without a lot of analysis
Summary/Conclusions • Most issues from difficult Schema features, both real and perceived • Possible solution: changing or profiling Schema • Does profiling Schema make sense? • Customer expectations and tool design are guided by Schema spec. Profiling should reset expectations. • Profiling won’t stop users from using features and they will still expect support. • Are problems with Schema or our data model? • XML Beans shows that a different model allows support for all of schema while supporting versioning.
- Slides: 10