Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Error output stream

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: peter murray-rust <pm286 AT cam.ac.uk>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Error output stream
  • Date: Thu, 15 Dec 2005 20:46:56 +0100

peter murray-rust wrote:

I can catch the error, but I also get the following on the console:
[Fatal Error] :1:6: XML document structures must start and end within the same entity.

Is there a way of disabling this message? I sometimes deliberately want to test whether a file (e.g. HTML) is well-formed and don't want any other output.

This is Xerces talking. I've complained about that. In fact there may be a rejected bug in their Bugzilla about that. For now all you can easily do is call System.setErr in your setUp method and reversing it in your tearDown method. I do this in various places in nu.xom.test such as BuilderTest:

protected void setUp() {
System.setErr(new PrintStream(new ByteArrayOutputStream()));
}


protected void tearDown() {
System.setErr(systemErr);
}



--
´╗┐Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page