Local simple types mapped to inner classes

Embedded local simple types map to inner classes.

Note:

The inner class policy is activated by default.

Mapping embedded local simple types to inner classes

This example shows how to map embedded local simple types to inner classes.

The example includes an element named ident that contains a simple type restriction. The simple type is represented in the XOM by the dynamic class BorrowedBook.Ident.

Here is the schema:

<complexType name="borrowed-book">
  <sequence>
    <element name="ident"/>
      <simpleType>
         <restriction base="string">
            <pattern value="A[0-9]*"/>
        </restriction>
      </simpleType>
    </element>
  </sequence>
</complexType>

Here is the excerpt from an XML document:

<borrowed-book>
  <ident>12345</ident>
</borrowed-book>

Here is the XOM representation:

class BorrowedBook extends IlrXmlObject
{
  class Ident
  { 
     ...
  };
} 

And here is the rule:

rule identifyBorrowedBook
{
   when {
        b: BorrowedBook (  );
        BorrowedBook.Ident equals "12345";
   }
   then {
      …
   }
}