2012-12-20 905 views
1

當我嘗試將文檔(org.w3c.dom.Document)轉換爲用於GWT的字符串時,出現問題。org.w3c.dom.Document gwt轉換器在GWT中的字符串

Bofer我開發它,而不使用GWT和我做出這樣的:

 XMLSerializer xmlSerializer = new XMLSerializer(); 
     StringWriter strWriter = new StringWriter(); 
     OutputFormat outFormat1 = new OutputFormat(); 

     outFormat1.setEncoding("UTF-8"); 
     //outFormat1.setEncoding("ISO-8859-1"); 
     outFormat1.setVersion("1.0"); 
     outFormat1.setIndenting(true); 

     outFormat1.setIndent(4); 
     //outFormat1.setIndent(2); 
     outFormat1.setOmitXMLDeclaration(false); 

     outFormat1.setMethod("xml"); 


     xmlSerializer.setOutputCharStream(strWriter); 
     xmlSerializer.setOutputFormat(outFormat1); 
     xmlSerializer.serialize(xmlDoc); 
     strWriter.close(); 

但是,應用程序給一個錯誤,因爲GWT鴕鳥政策接受它。

有人知道一些其他的解決方案嗎?

謝謝。

回答