java - I am trying to convert a string to efficient xml using nagasena example but i get a runtime error -


private static void encode(string sourcefile) throws filenotfoundexception,       ioexception, exioptionsexception, transmogrifierexception { string scurrentline=null; stringbuilder sb = new stringbuilder(); try (bufferedreader br = new bufferedreader(new filereader(sourcefile))){  while ((scurrentline = br.readline()) != null) { sb.append(scurrentline); }  } string sb1= sb.tostring();  system.out.println("xml string:"+sb1+"\n");  outputstream out =null; //this code nagasena  grammarcache grammarcache; transmogrifier transmogrifier = new transmogrifier(); grammarcache = new grammarcache(grammaroptions.default_options); transmogrifier.setgrammarcache(grammarcache); transmogrifier.setoutputstream(out); //passing string input     transmogrifier.encode(new inputsource(sb1)); system.out.println("check2 : string exi conversion"+ out +"\n"); 


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -