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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -