Simple Content

This model forces the character data to conform to a simple type. Thus, a single value represents the content. XBinder models this by defining a property called "value". The value property will be defined just the same as would be done for an attribute of the same simple type.

A complex type with simple content may be defined in one of three ways:

  1. extend a simple type

  2. extend another complex type with simple content

  3. restrict another complex type with simple content [4]

XSD:

   <xsd:complexType name="TypeName">
      <xsd:simpleContent>
         <xsd:extension base="BaseType">
             <!-- attributes declared here -->
         </xsd:extension>
      </xsd:simpleContent>
   </xsd:complexType>

Resulting code if BaseTypeis a simple type, mapped to a primitive type PT:

Java:

public class TypeName extends XBComplexType
   {
      ...
      //attribute methods
      ...
      //content methods

      public PT getValue() {...}

      public void setValue(PT value) {...}
      ...
   }

C#:

   {
      ...
      //attribute methods
      ...
      //content methods

      public PT getValue() {...}

      public void setValue(PT value) {...}
      ...
   }


[4] XBinder does not currently support simpleContent restrictions that require a simpleType child, which includes restrictions on complex types with a mixed, emptiable particle content model.