<?xml version='1.0' encoding='UTF-8'?>
<!--

Schema for JiBX binding definition file

This file is generally kept up to date in terms of structure, but the comments
may not match the HTML binding documentation. The HTML documentation should be
considered correct in the case of any differences.

-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="binding">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="namespace" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="format" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="include" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="mapping" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
    
    <xs:attribute name="add-constructors" type="xs:string"/>
    <xs:attribute name="direction" type="xs:string"/>
    <xs:attribute name="force-classes" type="xs:boolean"/>
    <xs:attribute name="forwards" type="xs:boolean"/>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="package" type="xs:string"/>
    <xs:attribute name="track-source" type="xs:boolean"/>
    
    <xs:attributeGroup ref="style"/>
    
  </xs:complexType>
</xs:element>

<xs:element name="include">
  <xs:complexType>
    <xs:attribute name="path" use="required" type="xs:string"/>
  </xs:complexType>
</xs:element>

<xs:element name="collection">
  <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="value"/>
      <xs:element ref="structure"/>
      <xs:element ref="collection"/>
    </xs:choice>
    
    <xs:attribute name="load-method" type="xs:string"/>
    <xs:attribute name="size-method" type="xs:string"/>
    <xs:attribute name="store-method" type="xs:string"/>
    <xs:attribute name="add-method" type="xs:string"/>
    <xs:attribute name="iter-method" type="xs:string"/>
    <xs:attribute name="item-type" type="xs:string"/>
    
    <xs:attributeGroup ref="style"/>
    <xs:attributeGroup ref="name"/>
    <xs:attributeGroup ref="object"/>
    <xs:attributeGroup ref="property"/>
    <xs:attributeGroup ref="structure"/>
    
  </xs:complexType>
</xs:element>

<xs:element name="format">
  <xs:complexType>
    
    <xs:attribute name="label" type="xs:string"/>
    <xs:attribute name="type" use="required" type="xs:string"/>
    
    <xs:attributeGroup ref="string"/>
    
  </xs:complexType>
</xs:element>

<xs:element name="mapping">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="namespace" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="format" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="mapping" minOccurs="0" maxOccurs="unbounded"/>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="value"/>
        <xs:element ref="structure"/>
        <xs:element ref="collection"/>
      </xs:choice>
    </xs:sequence>
    
    <xs:attribute name="class" use="required" type="xs:string"/>
    <xs:attribute name="abstract" type="xs:boolean"/>
    <xs:attribute name="extends" type="xs:string"/>
    <xs:attribute name="type-name" type="xs:string"/>
    
    <xs:attributeGroup ref="style"/>
    <xs:attributeGroup ref="name"/>
    <xs:attributeGroup ref="object"/>
    <xs:attributeGroup ref="structure"/>
    
  </xs:complexType>
</xs:element>

<xs:element name="namespace">
  <xs:complexType>
    <xs:attribute name="uri" use="required" type="xs:string"/>
    <xs:attribute name="prefix" type="xs:string"/>
    <xs:attribute name="default" type="xs:string"/>
  </xs:complexType>
</xs:element>

<xs:element name="structure">
  <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="value"/>
      <xs:element ref="structure"/>
      <xs:element ref="collection"/>
    </xs:choice>
    
    <xs:attribute name="map-as" type="xs:string"/>
    
    <xs:attributeGroup ref="name"/>
    <xs:attributeGroup ref="object"/>
    <xs:attributeGroup ref="property"/>
    <xs:attributeGroup ref="structure"/>
    <xs:attributeGroup ref="style"/>
    
  </xs:complexType>
</xs:element>

<xs:element name="value">
  <xs:complexType>
    
    <xs:attribute name="constant" type="xs:string"/>
    <xs:attribute name="format" type="xs:string"/>
    <xs:attribute name="ident" type="xs:string"/>
    <xs:attribute name="nillable" type="xs:boolean"/>
    <xs:attribute name="style" type="xs:string"/>
    
    <xs:attributeGroup ref="name"/>
    <xs:attributeGroup ref="property"/>
    <xs:attributeGroup ref="string"/>
    
  </xs:complexType>
</xs:element>

<xs:attributeGroup name="style">
  <xs:attribute name="value-style" type="xs:string"/>
</xs:attributeGroup>

<xs:attributeGroup name="name">
  <xs:attribute name="name" type="xs:string"/>
  <xs:attribute name="ns" type="xs:string"/>
</xs:attributeGroup>

<xs:attributeGroup name="property">
  <xs:attribute name="field" type="xs:string"/>
  <xs:attribute name="type" type="xs:string"/>
  <xs:attribute name="usage" type="xs:string"/>
  <xs:attribute name="test-method" type="xs:string"/>
  <xs:attribute name="get-method" type="xs:string"/>
  <xs:attribute name="set-method" type="xs:string"/>
</xs:attributeGroup>

<xs:attributeGroup name="structure">
  <xs:attribute name="allow-repeats" type="xs:boolean"/>
  <xs:attribute name="choice" type="xs:boolean"/>
  <xs:attribute name="flexible" type="xs:boolean"/>
  <xs:attribute name="label" type="xs:string"/>
  <xs:attribute name="ordered" type="xs:boolean"/>
  <xs:attribute name="using" type="xs:string"/>
</xs:attributeGroup>

<xs:attributeGroup name="string">
  <xs:attribute name="default" type="xs:string"/>
  <xs:attribute name="enum-value-method" type="xs:string"/>
  <xs:attribute name="serializer" type="xs:string"/>
  <xs:attribute name="deserializer" type="xs:string"/>
</xs:attributeGroup>

<xs:attributeGroup name="object">
  <xs:attribute name="create-type" type="xs:string"/>
  <xs:attribute name="factory" type="xs:string"/>
  <xs:attribute name="pre-set" type="xs:string"/>
  <xs:attribute name="post-set" type="xs:string"/>
  <xs:attribute name="pre-get" type="xs:string"/>
  <xs:attribute name="marshaller" type="xs:string"/>
  <xs:attribute name="nillable" type="xs:boolean"/>
  <xs:attribute name="unmarshaller" type="xs:string"/>
</xs:attributeGroup>

</xs:schema>
