Writing to XML documents (decision engine)

Write an XML object for use with the decision 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:
EngineDefinition definition = ...
XmlBindingService xmlBindingService = definition.getService(XmlBindingService.class);
IlrXmlDataDriver driver = xmlBindingService.getDataDriver();
IlrXmlObject myObject = ... // An existing XML object
try {
   Writer writer = new FileWriter ("xmlFile.xml");
   driver.writeObject ( myObject, writer );
} catch ( IlrXmlErrorException e ) {
   // some writing error
}