I have got this warning: com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release

ぐ巨炮叔叔 提交于 2020-01-03 16:43:35

问题


My code is

 OutputFormat wOf = new OutputFormat( "XML", "ISO-8859-1", true );

help me to solve this warning....

thanks in advance


回答1:


One solution is to not use that class.

Another solution is to ignore the warning. Looking at the class, I suspect that this is the only viable solution ... if you stick with the Sun XML stack.

(FWIW - this looks like a mistake on Sun's part in integrating the Apache XML stack into Java SE. The class should be in a different package that doesn't trigger this warning. The original Apache version is clearly not intended to be "internal use only". Another interpretation is that this is not a mistake, but something that Oracle intends to fix in a future release by providing a better API for controlling XML formatting.)




回答2:


Use org.apache.xml.serialize.OutputFormat instead of com.sun classes



来源:https://stackoverflow.com/questions/5455132/i-have-got-this-warning-com-sun-org-apache-xml-internal-serialize-outputformat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!