<!--
 edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by  Fred van Blommestein 
-->
<!--

  Library:           QDA-XML version 1.0
                     
  Release Date:      18 March 2019
  Module:            Project.xsd
  Copyright (c) QDA-XML 2019. All Rights Reserved.
-->
<!--  ===== Copyright Notice =====  -->
<!--

The Rotterdam Exchange Format Initiative (REFI) as the publisher of 
QDA-XML takes no position regarding the validity or scope of any 
  intellectual property or other rights that might be claimed to pertain 
  to the implementation or use of the technology described in this 
  document or the extent to which any license under such rights 
  might or might not be available; neither does it represent that it has 
  made any effort to identify any such rights. Information on QDA-XML's 
  procedures with respect to rights in QDA-XML specifications can be 
  found at the QDA-XML website www.qdasoftware.org..

  REFI invites any interested party to bring to its attention any 
  copyrights, patents or patent applications, or other proprietary 
  rights which may cover technology that may be required to 
  implement this specification.
  
  This document and translations of it may be copied and furnished to 
  others, and derivative works that comment on or otherwise explain 
  it or assist in its implementation may be prepared, copied, 
  published and distributed, in whole or in part, without restriction of 
  any kind, provided that the above copyright notice and this 
  paragraph are included on all such copies and derivative works. 
  However, this document itself may not be modified in any way, 
  such as by removing the copyright notice or references to QDA-XML.. 

  The limited permissions granted above are perpetual and will not be 
  revoked by REFI or its successors or assigns. 

  This document and the information contained herein is provided on 
  an "AS IS" basis and QDA-XML DISCLAIMS ALL WARRANTIES, 
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY 
  WARRANTY THAT THE USE OF THE INFORMATION HEREIN 
  WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 
  WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A 
  PARTICULAR PURPOSE.    
-->
<xsd:schema xmlns="urn:QDA-XML:project:1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:QDA-XML:project:1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
 <!--  ===== Element Declarations =====  -->
<xsd:element name="Project" type="ProjectType">
  <xsd:annotation>
    <xsd:documentation>
      This element MUST be conveyed as the root element in any instance document based on this Schema expression
    </xsd:documentation>
  </xsd:annotation>
</xsd:element>
 <!--  ===== Type Definitions =====  -->
<xsd:complexType name="ProjectType">
  <xsd:sequence>
    <xsd:element name="Users" type="UsersType" minOccurs="0"/>
    <xsd:element name="CodeBook" type="CodeBookType" minOccurs="0"/>
    <xsd:element name="Variables" type="VariablesType" minOccurs="0"/>
    <xsd:element name="Cases" type="CasesType" minOccurs="0"/>
    <xsd:element name="Sources" type="SourcesType" minOccurs="0"/>
    <xsd:element name="Notes" type="NotesType" minOccurs="0"/>
    <xsd:element name="Links" type="LinksType" minOccurs="0"/>
    <xsd:element name="Sets" type="SetsType" minOccurs="0"/>
    <xsd:element name="Graphs" type="GraphsType" minOccurs="0"/>
    <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
    <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
     <!--  Note(s) that apply to the project as a whole  -->
  </xsd:sequence>
  <xsd:attribute name="name" type="xsd:string" use="required"/>
  <xsd:attribute name="origin" type="xsd:string"/>
  <xsd:attribute name="creatingUserGUID" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUserGUID" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="basePath" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="UsersType">
  <xsd:sequence>
    <xsd:element name="User" type="UserType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="UserType">
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="CodeBookType">
  <xsd:sequence>
    <xsd:element name="Codes" type="CodesType"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="CodesType">
  <xsd:sequence>
    <xsd:element name="Code" type="CodeType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="CodeType">
  <xsd:sequence>
    <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
    <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="Code" type="CodeType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string" use="required"/>
  <xsd:attribute name="isCodable" type="xsd:boolean" use="required"/>
  <xsd:attribute name="color" type="RGBType"/>
</xsd:complexType>

<xsd:complexType name="CasesType">
  <xsd:sequence>
    <xsd:element name="Case" type="CaseType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="CaseType">
  <xsd:sequence>
    <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
    <xsd:element name="CodeRef" type="CodeRefType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="VariableValue" type="VariableValueType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="SourceRef" type="SourceRefType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="SelectionRef" type="SelectionRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="VariablesType">
  <xsd:sequence>
    <xsd:element name="Variable" type="VariableType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="VariableType">
  <xsd:sequence>
    <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string" use="required"/>
  <xsd:attribute name="typeOfVariable" type="typeOfVariableType" use="required"/>
</xsd:complexType>

<xsd:complexType name="VariableValueType">
  <xsd:sequence>
    <xsd:element name="VariableRef" type="VariableRefType"/>
    <xsd:choice>
      <xsd:element name="TextValue" type="xsd:string" minOccurs="0"/>
      <xsd:element name="BooleanValue" type="xsd:boolean" minOccurs="0"/>
      <xsd:element name="IntegerValue" type="xsd:integer" minOccurs="0"/>
      <xsd:element name="FloatValue" type="xsd:decimal" minOccurs="0"/>
      <xsd:element name="DateValue" type="xsd:date" minOccurs="0"/>
      <xsd:element name="DateTimeValue" type="xsd:dateTime" minOccurs="0"/>
    </xsd:choice>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="SetsType">
  <xsd:sequence>
    <xsd:element name="Set" type="SetType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="SetType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="MemberCode" type="CodeRefType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="MemberSource" type="SourceRefType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="MemberNote" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>

<xsd:complexType name="SourcesType">
  <xsd:choice maxOccurs="unbounded">
    <xsd:element name="TextSource" type="TextSourceType"/>
    <xsd:element name="PictureSource" type="PictureSourceType"/>
    <xsd:element name="PDFSource" type="PDFSourceType"/>
    <xsd:element name="AudioSource" type="AudioSourceType"/>
    <xsd:element name="VideoSource" type="VideoSourceType"/>
  </xsd:choice>
</xsd:complexType>

<xsd:complexType name="TextSourceType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="PlainTextContent" type="xsd:string" minOccurs="0"/>
  <xsd:element name="PlainTextSelection" type="PlainTextSelectionType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="VariableValue" type="VariableValueType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="richTextPath" type="xsd:string"/>
  <xsd:attribute name="plainTextPath" type="xsd:string"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
   <!-- Either PlainTextContent or plainTextPath MUST be filled, not both -->
</xsd:complexType>

<xsd:complexType name="PlainTextSelectionType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="startPosition" type="xsd:integer" use="required"/>
  <xsd:attribute name="endPosition" type="xsd:integer" use="required"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="PictureSourceType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="TextDescription" type="TextSourceType" minOccurs="0"/>
  <xsd:element name="PictureSelection" type="PictureSelectionType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="VariableValue" type="VariableValueType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="path" type="xsd:string"/>
  <xsd:attribute name="currentPath" type="xsd:string"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="PictureSelectionType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="firstX" type="xsd:integer" use="required"/>
  <xsd:attribute name="firstY" type="xsd:integer" use="required"/>
  <xsd:attribute name="secondX" type="xsd:integer" use="required"/>
  <xsd:attribute name="secondY" type="xsd:integer" use="required"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="PDFSourceType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="PDFSelection" type="PDFSelectionType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="Representation" type="TextSourceType" minOccurs="0"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="VariableValue" type="VariableValueType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="path" type="xsd:string"/>
  <xsd:attribute name="currentPath" type="xsd:string"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="PDFSelectionType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="Representation" type="TextSourceType" minOccurs="0"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="page" type="xsd:integer" use="required"/>
  <xsd:attribute name="firstX" type="xsd:integer" use="required"/>
  <xsd:attribute name="firstY" type="xsd:integer" use="required"/>
  <xsd:attribute name="secondX" type="xsd:integer" use="required"/>
  <xsd:attribute name="secondY" type="xsd:integer" use="required"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="AudioSourceType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="Transcript" type="TranscriptType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="AudioSelection" type="AudioSelectionType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="VariableValue" type="VariableValueType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="path" type="xsd:string"/>
  <xsd:attribute name="currentPath" type="xsd:string"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="AudioSelectionType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="begin" type="xsd:integer" use="required"/>
  <xsd:attribute name="end" type="xsd:integer" use="required"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="VideoSourceType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="Transcript" type="TranscriptType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="VideoSelection" type="VideoSelectionType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="VariableValue" type="VariableValueType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="path" type="xsd:string"/>
  <xsd:attribute name="currentPath" type="xsd:string"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="VideoSelectionType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="begin" type="xsd:integer" use="required"/>
  <xsd:attribute name="end" type="xsd:integer" use="required"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="TranscriptType">
  <xsd:sequence>
  <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
  <xsd:element name="PlainTextContent" type="xsd:string" minOccurs="0"/>
  <xsd:element name="SyncPoint" type="SyncPointType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="TranscriptSelection" type="TranscriptSelectionType" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="richTextPath" type="xsd:string"/>
  <xsd:attribute name="plainTextPath" type="xsd:string"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
   <!-- Either PlainTextContent or plainTextPath MUST be filled, not both -->
</xsd:complexType>

<xsd:complexType name="TranscriptSelectionType">
  <xsd:sequence>
    <xsd:element name="Description" type="xsd:string" minOccurs="0"/>
    <xsd:element name="Coding" type="CodingType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="fromSyncPoint" type="GUIDType"/>
  <xsd:attribute name="toSyncPoint" type="GUIDType"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
  <xsd:attribute name="modifyingUser" type="GUIDType"/>
  <xsd:attribute name="modifiedDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="SyncPointType">
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="timeStamp" type="xsd:integer"/>
  <xsd:attribute name="position" type="xsd:integer"/>
</xsd:complexType>

<xsd:complexType name="CodingType">
  <xsd:sequence>
    <xsd:element name="CodeRef" type="CodeRefType"/>
    <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="creatingUser" type="GUIDType"/>
  <xsd:attribute name="creationDateTime" type="xsd:dateTime"/>
</xsd:complexType>

<xsd:complexType name="GraphsType">
  <xsd:sequence>
    <xsd:element name="Graph" type="GraphType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="GraphType">
  <xsd:sequence>
    <xsd:element name="Vertex" type="VertexType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="Edge" type="EdgeType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="VertexType">
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="representedGUID" type="GUIDType"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="firstX" type="xsd:integer" use="required"/>
  <xsd:attribute name="firstY" type="xsd:integer" use="required"/>
  <xsd:attribute name="secondX" type="xsd:integer"/>
  <xsd:attribute name="secondY" type="xsd:integer"/>
  <xsd:attribute name="shape" type="ShapeType"/>
  <xsd:attribute name="color" type="RGBType"/>
</xsd:complexType>

<xsd:complexType name="EdgeType">
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="representedGUID" type="GUIDType"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="sourceVertex" type="GUIDType" use="required"/>
  <xsd:attribute name="targetVertex" type="GUIDType" use="required"/>
  <xsd:attribute name="color" type="RGBType"/>
  <xsd:attribute name="direction" type="directionType"/>
  <xsd:attribute name="lineStyle" type="LineStyleType"/>
</xsd:complexType>

<xsd:complexType name="NotesType">
  <xsd:sequence>
    <xsd:element name="Note" type="TextSourceType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="LinksType">
  <xsd:sequence>
    <xsd:element name="Link" type="LinkType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="LinkType">
  <xsd:sequence>
    <xsd:element name="NoteRef" type="NoteRefType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="guid" type="GUIDType" use="required"/>
  <xsd:attribute name="name" type="xsd:string"/>
  <xsd:attribute name="direction" type="directionType"/>
  <xsd:attribute name="color" type="RGBType"/>
  <xsd:attribute name="originGUID" type="GUIDType"/>
  <xsd:attribute name="targetGUID" type="GUIDType"/>
</xsd:complexType>

<xsd:complexType name="NoteRefType">
  <xsd:attribute name="targetGUID" type="GUIDType" use="required"/>
</xsd:complexType>

<xsd:complexType name="CodeRefType">
  <xsd:attribute name="targetGUID" type="GUIDType" use="required"/>
</xsd:complexType>

<xsd:complexType name="SourceRefType">
  <xsd:attribute name="targetGUID" type="GUIDType" use="required"/>
</xsd:complexType>

<xsd:complexType name="SelectionRefType">
  <xsd:attribute name="targetGUID" type="GUIDType" use="required"/>
</xsd:complexType>

<xsd:complexType name="VariableRefType">
  <xsd:attribute name="targetGUID" type="GUIDType" use="required"/>
</xsd:complexType>

<xsd:simpleType name="GUIDType">
  <xsd:restriction base="xsd:token">
    <xsd:pattern value="([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|(\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\})"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="RGBType">
  <xsd:restriction base="xsd:token">
    <xsd:pattern value="#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="directionType">
  <xsd:restriction base="xsd:token">
    <xsd:enumeration value="Associative"/>
    <xsd:enumeration value="OneWay"/>
    <xsd:enumeration value="Bidirectional"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="typeOfVariableType">
  <xsd:restriction base="xsd:token">
    <xsd:enumeration value="Text"/>
    <xsd:enumeration value="Boolean"/>
    <xsd:enumeration value="Integer"/>
    <xsd:enumeration value="Float"/>
    <xsd:enumeration value="Date"/>
    <xsd:enumeration value="DateTime"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="ShapeType">
  <xsd:restriction base="xsd:token">
    <xsd:enumeration value="Person"/>
    <xsd:enumeration value="Oval"/>
    <xsd:enumeration value="Rectangle"/>
    <xsd:enumeration value="RoundedRectangle"/>
    <xsd:enumeration value="Star"/>
    <xsd:enumeration value="LeftTriangle"/>
    <xsd:enumeration value="RightTriangle"/>
    <xsd:enumeration value="UpTriangle"/>
    <xsd:enumeration value="DownTriangle"/>
    <xsd:enumeration value="Note"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="LineStyleType">
  <xsd:restriction base="xsd:token">
    <xsd:enumeration value="dotted"/>
    <xsd:enumeration value="dashed"/>
    <xsd:enumeration value="solid"/>
  </xsd:restriction>
</xsd:simpleType>
</xsd:schema>