<?xml version="1.0" encoding="UTF-8" ?>
<schema targetNamespace="http://www.exchangenetwork.net/schema/header/2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
 xmlns="http://www.w3.org/2001/XMLSchema" xmlns:hdr="http://www.exchangenetwork.net/schema/header/2"
	elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0">
  <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd" />
  <annotation>
    <documentation>
      Schema Name : header_v2.0.xsd
      Current Version Available At : http://www.exchangenetwork.net/scheam/header/2
      Description : The Exchange Network Document Header Definition.
      Technical Contact : Yunhao Zhang (yzhang2006@gmail.com).
    </documentation>
  </annotation>
  <complexType name ="NameValuePair">
    <sequence>
      <element name ="PropertyName" type ="string" />
      <element name ="PropertyValue" type ="anyType" />
    </sequence>
  </complexType>
  <simpleType name="OperationCodeType">
     <restriction base="string">
       <enumeration value="None" />
       <enumeration value="Refresh" />
      <enumeration value="Insert" />
      <enumeration value="Update" />
      <enumeration value="Delete" />
      <enumeration value="Merge" />
    </restriction>
  </simpleType>
  <complexType name="DocumentHeaderType">
    <sequence>
      <element name="AuthorName" type="string" maxOccurs="1"/>
      <element name="OrganizationName" type="string" maxOccurs="1"/>
      <element name="DocumentTitle" type="string" maxOccurs="1"/>
      <element name="CreationDateTime" type="dateTime" maxOccurs="1"/>
      <element name="Keywords" type="string" minOccurs="0" maxOccurs="1"/>
      <element name="Comment" type="string" minOccurs="0" maxOccurs="1"/>
      <element name="DataFlowName" type="string" minOccurs="0" maxOccurs="1"/>
      <element name="DataServiceName" type="string" minOccurs="0" maxOccurs="1"/>
      <element name="SenderContact" type="string" minOccurs="0" maxOccurs="1"/>
      <element name="ApplicationUserIdentifier" type="string" minOccurs="0" maxOccurs="1"/>
      <element name="SenderAddress" type="anyURI" minOccurs="0" maxOccurs="unbounded"/>
      <element name="Property" type="hdr:NameValuePair" minOccurs="0" maxOccurs="unbounded"/>
      <element ref="ds:Signature" minOccurs="0"/>
    </sequence>
  </complexType>
  <complexType name="DocumentPayloadType">
    <sequence>
      <any minOccurs="1" maxOccurs="1" processContents="lax" />
    </sequence>
    <attribute name="id" type="ID" use="optional"/>
    <attribute name="operation" type="string" use="optional"/>
  </complexType>
  <complexType name="ExchangeNetworkDocumentType">
    <sequence>
      <element name="Header" type="hdr:DocumentHeaderType"/>
      <element name="Payload" type="hdr:DocumentPayloadType" minOccurs="1"  maxOccurs="unbounded" />
    </sequence>
    <attribute name="id" type="ID" use="required"/>
  </complexType>
  <element name="Document" type="hdr:ExchangeNetworkDocumentType" >
    <annotation>
      <documentation>The root element of an Exchange Network Document.</documentation>
    </annotation>
  </element>
</schema>

