public static XWPFTemplate compile ( InputStream inputStream , Configure config ) { try { XWPFTemplate instance = new XWPFTemplate ( ) ; instance . config = config ; instance . doc = new NiceXWPFDocument ( inputStream ) ; instance . visitor = new TemplateVisitor ( instance . config ) ; instance . eleTemplates = instance . visitor . visitDocument ( instance . doc ) ; return instance ; } catch ( IOException e ) { logger . error ( "Compile template failed" , e ) ; throw new ResolverException ( "Compile template failed" ) ; } }
template file as InputStream