ILOG JRules User Guide > Integrating Application Data > Reference > Mapping Between XML Schema and Dynamic Classes > Schema Types > Extension of Simple Type Content in Complex Types

This example shows how to extend simple type content in a schema and an XML document. The example extends temperature of base type int to include a unit attribute of type string.

Here is the schema:

<complexType temperature>
  <simpleContent>
    <extension base="int">
     <attribute name="unit" type="string"/> 
    </extension>
  </simpleContent>
</complexType>

Here is the excerpt from an XML document:

<temperature unit= "celsius">15</temperature>

Here is the XOM representation:

Class Temperature extends IlrXmlObject
{
   int content ;
   String unit ;
...
}  

Related Reference

Built-in Simple Types
Simple Type Mapping
Simple Types Derived from Other Simple Types
List and Union Types
Local Simple Types Mapped onto Inner Classes
Complex Types
Complex Type Restriction
Complex Type Extension
Local Complex Types Mapped to Inner Classes
Default Constructor Dynamic Methods
Type Identifier Mapping