Universal Business Language (UBL) has an impressive UBL Naming and Design Rules Checklist [1]. UBL has been a great source of inspiration also for XML Schema projects not related to UBL.
What is good for UBL is not necessarily good or relevant for other XML Schema projects. But what is recommended or not allowed in UBL is most often worth thinking about. Below I only list some of the many naming and design rules. [2]
xsd:any attribute MUST NOT be used." (ATD8, page 1) [3]xsd:any element MUST NOT be used." (ELD9, page 8)xsd:any type MUST NOT be used." (GTD2, page 10)<!-- Copyright Notice -->
<!-- xsd:schema Element With Namespaces Declarations -->
<!-- Imports -->
<!-- Global Attributes -->
<!-- Root Element --> [4]
<!-- Element Declarations -->
<!-- Type Definitions -->
<!-- Aggregate Business Information Entity Type Definitions -->
<!-- Basic Business Information Entity Type Definitions -->
xsd:SubstitutionGroups feature MUST NOT be used". (GXS5, page 11) xsd:final attribute MUST be used to control extensions." (GXS6, page 11)xsd:notations MUST NOT be used." (GXS7, page 11)xsd:all element MUST NOT be used." (GXS8, page 11)xsd:union technique MUST NOT be used except for Code Lists. The xsd:union technique MAY be used for Code Lists." (GXS11, page 11)xsd:documentation element." (MDC2, page 11) [6]UBL Naming and Design Rules Checklist (pdf at OASIS).
In Denmark, the government has adopted UBL (OASIS standard) under the name of OIOXML. Since 2005-02-01 only XML invoices can be used if you want to do business with the public administration, even with public kindergartens.
In wordprocessingML (wordML) by contrast, <xsd:anyAttribute> and <xsd:any> (for elements) are used a lot since it most be possible to save "unknown" markup declared in the user's own XML Schema inside a MS Word document saved as wordML.
In wordprocessingML (wordML) by contrast, the root element, "w:wordDocument", is declared as the very last declaration of the XML Schema (it has almost 10.000 lines).
In wordprocessingML (wordML) by contrast, not one build-in XSD simpleType is used directly. All 99 simpleTypes are user-defined.
In wordML by contrast, we would expect a lot of mixed content, elements containing a mixture of elements and data (text). In XHTML it could look like this: <p>This <b>is</b> bold</p>. But Microsoft doesn't like mixed content either: a "run" element with a "runProperty" is used for each formatted fragment like this:
<w:p> <w:r> <w:t>This </w:t> </w:r> <w:r> <w:rPr> <w:b/> </w:rPr> <w:t>is</w:t> </w:r> <w:r> <w:t> bold</w:t> </w:r>
</w:p>
Note that above only the second w:r (run) is bold. In this way wordprocessingML can do without mixed content!
Last updated 2007-01-08