Sign In/My Account | View Cart  
advertisement

Article:
 XML Schema Design Patterns: Is Complex Type Derivation Unnecessary?
Subject: Just RELAX!
Date: 2003-10-30 15:17:45
From: Tom Gaven


Dare,


Just RELAX!


This article points out some of the major flaws with complex type derivation and WXS.


Another important point to mention is the sheer complexity of the WXS syntax. How are you going to extend a schema if you can't comprehend the original?


Here is an equivalent RNC (Relax NG Compact Syntax) schema for the WXS model group sample presented in the article:


XMLDeviantGrp = ( firstSubscribed?, lastPostDate?, numPosts?, email? )
numPosts = element numPosts { xsd:integer }
email = element email { text }
firstSubscribed = attribute firstSubscribed { xsd:date}
lastPostDate = attribute lastPostDate{ xsd:date }


DareObasanjo = ( XMLDeviantGrp, signature, mailReader )
signature = element signature { text }
mailReader = attribute mailReader { "Microsoft Outlook" }


This schema is a third the size of the WXS equivalent, and is much easier to understand.


This syntax is so compact that you could create 3 derivations of it in the same time it took you to comprehend the original WXS equivalent.


No need to be concerned about complexType inheritance, xsi:type, substitution groups, block, final, blockDefault, finalDefault, and sections 3.4.6 and 3.9.6 of the WXS spec!!!


Just RELAX!!


Tom


No Previous Message Previous Message   Next Message Next Message


Sponsored By: