private void printError(DOMError error){
  int severity=error.getSeverity();
  fOut.print("[");
  if (severity == DOMError.SEVERITY_WARNING) {
    fOut.print("Warning");
  }
 else   if (severity == DOMError.SEVERITY_ERROR) {
    fOut.print("Error");
  }
 else {
    fOut.print("FatalError");
    eStatus=false;
  }
  fOut.print("] ");
  DOMLocator locator=error.getLocation();
  if (locator != null) {
    fOut.print(locator.getLineNumber());
    fOut.print(":");
    fOut.print(locator.getColumnNumber());
    fOut.print(":");
    fOut.print(locator.getByteOffset());
    fOut.print(",");
    fOut.print(locator.getUtf16Offset());
    Node node=locator.getRelatedNode();
    if (node != null) {
      fOut.print("[");
      fOut.print(node.getNodeName());
      fOut.print("]");
    }
    String systemId=locator.getUri();
    if (systemId != null) {
      int index=systemId.lastIndexOf('/');
      if (index != -1)       systemId=systemId.substring(index + 1);
      fOut.print(": ");
      fOut.print(systemId);
    }
  }
  fOut.print(":");
  fOut.print(error.getMessage());
  fOut.println();
  fOut.flush();
}

private void printError ( DOMError error ) { int severity = error . getSeverity ( ) ; fOut . print ( "[" ) ; if ( severity == DOMError . SEVERITY_WARNING ) { fOut . print ( "Warning" ) ; } else if ( severity == DOMError . SEVERITY_ERROR ) { fOut . print ( "Error" ) ; } else { fOut . print ( "FatalError" ) ; eStatus = false ; } fOut . print ( "] " ) ; DOMLocator locator = error . getLocation ( ) ; if ( locator != null ) { fOut . print ( locator . getLineNumber ( ) ) ; fOut . print ( ":" ) ; fOut . print ( locator . getColumnNumber ( ) ) ; fOut . print ( ":" ) ; fOut . print ( locator . getByteOffset ( ) ) ; fOut . print ( "," ) ; fOut . print ( locator . getUtf16Offset ( ) ) ; Node node = locator . getRelatedNode ( ) ; if ( node != null ) { fOut . print ( "[" ) ; fOut . print ( node . getNodeName ( ) ) ; fOut . print ( "]" ) ; } String systemId = locator . getUri ( ) ; if ( systemId != null ) { int index = systemId . lastIndexOf ( '/' ) ; if ( index != - 1 ) systemId = systemId . substring ( index + 1 ) ; fOut . print ( ": " ) ; fOut . print ( systemId ) ; } } fOut . print ( ":" ) ; fOut . print ( error . getMessage ( ) ) ; fOut . println ( ) ; fOut . flush ( ) ; }
prints the error message .
