private void writeXmi ( CAS aCas , File name , String modelFileName ) throws IOException , SAXException { FileOutputStream out = null ; try { // write XMI out = new FileOutputStream ( name ) ; XmiCasSerializer ser = new XmiCasSerializer ( aCas . getTypeSystem ( ) ) ; XMLSerializer xmlSer = new XMLSerializer ( out , false ) ; ser . serialize ( aCas , xmlSer . getContentHandler ( ) ) ; } finally { if ( out != null ) { out . close ( ) ; } } }
Serialize a CAS to a file in XMI format