Schema cleanCode.xsd


schema location:  cleanCode.xsd
targetNamespace:  cleancode.com
 
Elements  Complex types  Simple types 
body  Flow  NonEmptyString 
callout  ShortString 
cleanCodeDoc 
codeBlock 
example 
files 
head 
incident 
product-summary 


element body
diagram
namespace cleancode.com
type extension of Flow
properties
content complex
mixed true
children xhtml:form example callout codeBlock incident product-summary files
used by
element cleanCodeDoc
attributes
Name  Type  Use  Default  Fixed  Annotation
onload  xhtml:Script      
onunload  xhtml:Script      
background  xhtml:URI      
annotation
documentation 
Corresponds to html 'body'
source
<xs:element name="body">
  <xs:annotation>
    <xs:documentation>Corresponds to html 'body'</xs:documentation>
  </xs:annotation>
  <xs:complexType mixed="true">
    <xs:complexContent mixed="true">
      <xs:extension base="Flow">
        <xs:attributeGroup ref="xhtml:attrs"/>
        <xs:attribute name="onload" type="xhtml:Script"/>
        <xs:attribute name="onunload" type="xhtml:Script"/>
        <xs:attribute name="background" type="xhtml:URI"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:element>

element callout
example output
example input
<cc:callout caption="variable declarations" pre="true">
my $stuff; <b># perl</b>
$stuff = 25.3;
$stuff = "abc";

var stuff; <b>// javascript</b>
stuff = 25.3;
stuff = "abc";

double stuff; <b>// java</b>
stuff = 25.3;
// stuff = "abc"; // illegal
</cc:callout>
				
example output
example input
<cc:callout caption="Perl initialization"> (no "pre" attribute here)
<pre>
my $x; # declaration
print "x = $x\n";
</pre>
<div class="either">Results in:</div>
Use of uninitialized value
</cc:callout>
				
diagram
namespace cleancode.com
type extension of xhtml:Flow
properties
content complex
used by
complexType Flow
attributes
Name  Type  Use  Default  Fixed  Annotation
caption  xs:stringrequired      
width  xs:stringoptional      
pre  xs:booleanoptional    true  
annotation
documentation 
Callout which flows around the main text
source
<xs:element name="callout">
  <xs:annotation>
    <xs:documentation>Callout which flows around the main text</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:complexContent>
      <xs:extension base="xhtml:Flow">
        <xs:attribute name="caption" type="xs:string" use="required"/>
        <xs:attribute name="width" type="xs:string" use="optional"/>
        <xs:attribute name="pre" type="xs:boolean" use="optional" fixed="true"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:element>

element cleanCodeDoc
diagram
namespace cleancode.com
properties
content complex
children head body
annotation
documentation 
Root for CleanCode document
source
<xs:element name="cleanCodeDoc">
  <xs:annotation>
    <xs:documentation>Root for CleanCode document</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="head"/>
      <xs:element ref="body"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

element codeBlock
example output
example input
<cc:codeBlock>
	package com.cleancode.util;
	public class Utilities {
		<b>public</b> static String myStuff = "xyz";
		. . .
	}
</cc:codeBlock>
				
diagram
namespace cleancode.com
type extension of xhtml:Flow
properties
content complex
used by
complexType Flow
annotation
documentation 
Separate code block without wrap.
source
<xs:element name="codeBlock">
  <xs:annotation>
    <xs:documentation>Separate code block without wrap.</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:complexContent>
      <xs:extension base="xhtml:Flow"/>
    </xs:complexContent>
  </xs:complexType>
</xs:element>

element example
example output
example input
<cc:example language="Java, JavaScript"> (Two choices, no explicit captions)
<cc:exampleBlock>
<pre>
	print(string1); print(string2); print(string3);
</pre>
</cc:exampleBlock>
<cc:exampleBlock>
<pre>
	print(string1 + string2 + string3);
</pre>
</cc:exampleBlock>
</cc:example>
				
example output
example input
<cc:example language="Java, JavaScript"> (One choice, with explicit caption)
<cc:exampleBlock caption="Misleading Code">
<pre>
	if (cond1)
		statement1a;
		statement1b;
	else if (cond2) 
		statement2a;
		statement2b;
</pre>
</cc:exampleBlock>
</cc:example>
				
example output
example input
<cc:example language="Any"> (Multiple choices, no explicit captions)
<cc:exampleBlock>If A and B...</cc:exampleBlock>
<cc:exampleBlock>If A and not B...</cc:exampleBlock>
<cc:exampleBlock>If not A and not B...</cc:exampleBlock>
<cc:exampleBlock>If not A and B...</cc:exampleBlock>
<cc:exampleBlock>If A and B but not C...</cc:exampleBlock>
<cc:exampleBlock>If not A nor B but C...</cc:exampleBlock>
</cc:example>
				
diagram
namespace cleancode.com
properties
content complex
children exampleBlock
used by
complexType Flow
attributes
Name  Type  Use  Default  Fixed  Annotation
language  xs:stringrequired      
annotation
documentation 
Block-level example text
source
<xs:element name="example">
  <xs:annotation>
    <xs:documentation>Block-level example text</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="exampleBlock" maxOccurs="unbounded">
        <xs:complexType>
          <xs:group ref="xhtml:block"/>
          <xs:attribute name="caption" type="xs:string" use="optional"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="language" type="xs:string" use="required"/>
  </xs:complexType>
</xs:element>

element example/exampleBlock
diagram
namespace cleancode.com
properties
isRef 0
content complex
attributes
Name  Type  Use  Default  Fixed  Annotation
caption  xs:stringoptional      
source
<xs:element name="exampleBlock" maxOccurs="unbounded">
  <xs:complexType>
    <xs:group ref="xhtml:block"/>
    <xs:attribute name="caption" type="xs:string" use="optional"/>
  </xs:complexType>
</xs:element>

element files
diagram
namespace cleancode.com
properties
content complex
children file
used by
complexType Flow
attributes
Name  Type  Use  Default  Fixed  Annotation
group  xs:stringoptional      
annotation
documentation 
Collection of files for table of contents
source
<xs:element name="files">
  <xs:annotation>
    <xs:documentation>Collection of files for table of contents</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="file" maxOccurs="unbounded">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="relfile" type="NonEmptyString"/>
            <xs:element name="absfile" type="NonEmptyString"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="group" type="xs:string" use="optional"/>
  </xs:complexType>
</xs:element>

element files/file
diagram
namespace cleancode.com
properties
isRef 0
content complex
children relfile absfile
source
<xs:element name="file" maxOccurs="unbounded">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="relfile" type="NonEmptyString"/>
      <xs:element name="absfile" type="NonEmptyString"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

element files/file/relfile
diagram
namespace cleancode.com
type NonEmptyString
properties
isRef 0
content simple
facets
minLength 1
source
<xs:element name="relfile" type="NonEmptyString"/>

element files/file/absfile
diagram
namespace cleancode.com
type NonEmptyString
properties
isRef 0
content simple
facets
minLength 1
source
<xs:element name="absfile" type="NonEmptyString"/>

element head
diagram
namespace cleancode.com
properties
content complex
children title group id version xhtml:meta
used by
element cleanCodeDoc
annotation
documentation 
Corresponds to html 'head'
source
<xs:element name="head">
  <xs:annotation>
    <xs:documentation>Corresponds to html 'head'</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="title" type="NonEmptyString">
        <xs:annotation>
          <xs:documentation>populates html:title element</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="group" type="NonEmptyString" minOccurs="0">
        <xs:annotation>
          <xs:documentation>reference to files/@group in contents template</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="id" type="NonEmptyString" minOccurs="0"/>
      <xs:element name="version" type="NonEmptyString" minOccurs="0"/>
      <xs:element ref="xhtml:meta" minOccurs="0" maxOccurs="unbounded"/>
      <!--<xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>-->
    </xs:sequence>
  </xs:complexType>
</xs:element>

element head/title
diagram
namespace cleancode.com
type NonEmptyString
properties
isRef 0
content simple
facets
minLength 1
annotation
documentation 
populates html:title element
source
<xs:element name="title" type="NonEmptyString">
  <xs:annotation>
    <xs:documentation>populates html:title element</xs:documentation>
  </xs:annotation>
</xs:element>

element head/group
diagram
namespace cleancode.com
type NonEmptyString
properties
isRef 0
content simple
facets
minLength 1
annotation
documentation 
reference to files/@group in contents template
source
<xs:element name="group" type="NonEmptyString" minOccurs="0">
  <xs:annotation>
    <xs:documentation>reference to files/@group in contents template</xs:documentation>
  </xs:annotation>
</xs:element>

element head/id
diagram
namespace cleancode.com
type NonEmptyString
properties
isRef 0
content simple
facets
minLength 1
source
<xs:element name="id" type="NonEmptyString" minOccurs="0"/>

element head/version
diagram
namespace cleancode.com
type NonEmptyString
properties
isRef 0
content simple
facets
minLength 1
source
<xs:element name="version" type="NonEmptyString" minOccurs="0"/>

element incident
example output
example input
<cc:incident name="Zip Disk">
<cc:specs>
	<cc:category>hardware</cc:category>
	<cc:date>2002.01.15</cc:date>
	<cc:company>Iomega</cc:company>
	<cc:product>Zip Drive</cc:product>
	<cc:pversion>100MB USB</cc:pversion>
	<cc:os>Win98</cc:os>
</cc:specs>
<cc:background>
	<p>
	Iomega manufactures portable storage devices which connect to PCs and Macintoshs.
	</p>
</cc:background>
<cc:scenario>
	<p>
	I am a regular PC user exclusively.
	A couple years back, I was a regular Mac user, and my Mac had a dual
	personality of a PC as well (very spiffy).
	...
	</p>
</cc:scenario>
<cc:issues>
	<ul>
	<li>
	The big one is interoperability.
	Iomega makes the drive hardware, the disk media, and the software...
	so why can't I read a Mac disk on my PC?
	...
	</li>
	</ul>
</cc:issues>

<cc:nutshell>
	<p>
	A good product; it's been around long enough to prove its usefulness and staying power. 
	</p>
</cc:nutshell>
</cc:incident>
				
diagram
namespace cleancode.com
properties
content complex
children specs background scenario issues nutshell
used by
complexType Flow
attributes
Name  Type  Use  Default  Fixed  Annotation
name  ShortStringrequired      
annotation
documentation 
Software or website incident description
source
<xs:element name="incident">
  <xs:annotation>
    <xs:documentation>Software or website incident description</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="specs">
        <xs:complexType>
          <xs:sequence>
            <xs:sequence>
              <xs:element name="category" type="xhtml:Inline"/>
              <xs:element name="date" type="xhtml:Inline"/>
              <xs:element name="company" type="xhtml:Inline"/>
            </xs:sequence>
            <xs:choice>
              <xs:sequence>
                <xs:annotation>
                  <xs:documentation>software</xs:documentation>
                </xs:annotation>
                <xs:element name="product" type="xhtml:Inline"/>
                <xs:element name="pversion" type="xhtml:Inline"/>
                <xs:element name="os" type="xhtml:Inline"/>
              </xs:sequence>
              <xs:sequence>
                <xs:annotation>
                  <xs:documentation>web page</xs:documentation>
                </xs:annotation>
                <xs:element name="section" type="xhtml:Inline"/>
                <xs:element name="os" type="xhtml:Inline"/>
                <xs:element name="browser" type="xhtml:Inline"/>
                <xs:element name="url" type="xhtml:Inline"/>
                <xs:element name="homepage" type="xhtml:Inline"/>
              </xs:sequence>
              <xs:element name="item" type="xhtml:Inline">
                <xs:annotation>
                  <xs:documentation>non-software/web page</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:choice>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="background" type="Flow"/>
      <xs:element name="scenario" type="Flow"/>
      <xs:element name="issues" type="Flow"/>
      <xs:element name="nutshell" type="Flow"/>
    </xs:sequence>
    <xs:attribute name="name" type="ShortString" use="required"/>
  </xs:complexType>
</xs:element>

element incident/specs
example output
example input

<cc:specs>
	<cc:category>software</cc:category>
	<cc:date>2002.11.11</cc:date>
	<cc:company>Lotus</cc:company>
	<cc:product>Lotus 1-2-3</cc:product> (unique elements for each example hilighted)
	<cc:pversion>9.5</cc:pversion>
	<cc:os>WinXP</cc:os>
</cc:specs>
				
example output
example input
<cc:specs>
	<cc:category>communication</cc:category>
	<cc:date>2002.01.25</cc:date>
	<cc:company>Alaska Air</cc:company>
	<cc:item>email</cc:item>
</cc:specs>
				
example output
example input
<cc:specs>
	<cc:category>web page</cc:category>
	<cc:date>2002.03.20</cc:date>
	<cc:company>Brainbench</cc:company>
	<cc:section>Question of the Week</cc:section>
	<cc:os>Win XP</cc:os>
	<cc:browser>any</cc:browser>
	<cc:url>http://www.brainbench.com/xml/bb/qow/engqow.xml <i>(expired)</i></cc:url>
	<cc:homepage>http://www.brainbench.com</cc:homepage>
</cc:specs>
				
diagram
namespace cleancode.com
properties
isRef 0
content complex
children category date company product pversion os section os browser url homepage item
source
<xs:element name="specs">
  <xs:complexType>
    <xs:sequence>
      <xs:sequence>
        <xs:element name="category" type="xhtml:Inline"/>
        <xs:element name="date" type="xhtml:Inline"/>
        <xs:element name="company" type="xhtml:Inline"/>
      </xs:sequence>
      <xs:choice>
        <xs:sequence>
          <xs:annotation>
            <xs:documentation>software</xs:documentation>
          </xs:annotation>
          <xs:element name="product" type="xhtml:Inline"/>
          <xs:element name="pversion" type="xhtml:Inline"/>
          <xs:element name="os" type="xhtml:Inline"/>
        </xs:sequence>
        <xs:sequence>
          <xs:annotation>
            <xs:documentation>web page</xs:documentation>
          </xs:annotation>
          <xs:element name="section" type="xhtml:Inline"/>