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
}