6

My code is

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

help me to solve this warning....

thanks in advance

Mohsin
  • 609
  • 1
  • 7
  • 7

2 Answers2

5

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.)

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
3

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

Nishan
  • 2,821
  • 4
  • 27
  • 36
  • org.apache.xml.serialize.OutputFormat was deplicated – Peerapat A Jun 20 '13 at 07:42
  • "Deprecated. This class was deprecated in Xerces 2.9.0. It is recommended that new applications use the DOM Level 3 LSSerializer or JAXP's Transformation API for XML (TrAX) for serializing XML and HTML. See the Xerces documentation for more information." https://xerces.apache.org/xerces2-j/javadocs/other/org/apache/xml/serialize/OutputFormat.html – rogerdpack Jul 16 '19 at 18:58