-1

当发生 SAXParseException 时,我希望异常返回 -1。但我不知道该怎么做,因为我无法处理那些异常。有什么想法我应该怎么做?在发生异常的那一刻,它会打印以下内容:

VARNING: org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace 
characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '1'.

Process finished with exit code 0 
4

1 回答 1

0

听起来你需要:

try {
  // whatever code might throw SAXParseException
} catch (SAXParseException e) {
  return -1;
}
于 2015-03-12T11:13:28.903 回答