| ILOG JRules User Guide > Integrating Application Data > Reference > Mapping Between XML Schema and Dynamic Classes > Schema Types > Local Simple Types Mapped onto Inner Classes |
Local Simple Types Mapped onto Inner Classes |
PREVIOUS NEXT |
This example shows how to map embedded local simple types onto inner classes.
| Note |
| The inner class policy is by default activated. |
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 {
...
}
}
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |