XML 文書への書き込み (クラシック・ルール・エンジン)
IlrXmlObject を使用して、クラシック・ルール・エンジン用の XML オブジェクトを XML 文書に書き込みます。
このタスクについて
XML オブジェクトは、シリアライゼーション中に XML データとして表されます。 IlrXmlObject クラスを使用して、XML オブジェクトを文書に書き込むことができます。
手順
XML オブジェクトを XML 文書に書き込む手順は、以下のとおりです。
IlrXmlObject インスタンスを以下のように使用します。
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
}