Writing to XML documents (classic rule engine)

Write an XML object for use with the classic rule engine to an XML document using IlrXmlObject.

About this task

During serialization, XML objects are represented as XML data. You can write an XML object to a document using the IlrXmlObject class.

Procedure

To write an XML object to an XML document:

Use the IlrXmlObject instance as follows:
IlrReflect model = ... // the model specifying the structure of the XML document
IlrXmlObject myObject = ... // An existing XML object
try {
   driver.setModel ( model ); // not necessary if the schema is already 
loaded
   Writer writer = new FileWriter ("xmlFile.xml");
   driver.writeObject ( myObject, writer );
} catch ( IlrXmlErrorException e ) {
   // some writing error
}