Skip to Content.
Sympa Menu

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

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT>
  • To: peter murray-rust <pm286 AT>
  • Cc: xom-interest <xom-interest AT>
  • 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() {

´╗┐Elliotte Rusty Harold elharo AT
XML in a Nutshell 3rd Edition Just Published!

Archive powered by MHonArc 2.6.24.

Top of Page