Skip to Content.
Sympa Menu

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

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: peter murray-rust <pm286 AT cam.ac.uk>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Error output stream
  • Date: Wed, 14 Dec 2005 21:30:10 +0000

Using xom1.1+junit:
If I parse an XML file with an error as in the following:

String test2S = "<cml>";
Document doc2 = null;
try {
doc2 = new Builder().build(new StringReader(test2S));
fail("should throw parsing exception");
} catch (ParsingException e) {
assertEquals("should throw ", "XML document structures must start and end within the same entity.", e.getMessage());
}

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.

P.


Peter Murray-Rust
Unilever Centre for Molecular Sciences Informatics
University of Cambridge,
Lensfield Road, Cambridge CB2 1EW, UK
+44-1223-763069




Archive powered by MHonArc 2.6.24.

Top of Page