if (false) throw new XmlException("dummy"); // keeps the compiler happy
//noinspection ConstantIfStatement
if (false) throw new XmlSchemaException("dummy", new XmlException("dummy")); // keeps the compiler happy
} catch (XmlException e) {
XPathException de = new XPathException("Error reported by XML parser: " + e.getMessage(), e);
ExpressionLocation loc = new ExpressionLocation();
loc.setSystemId(getSystemId());
loc.setLineNumber(e.get_LineNumber());
loc.setColumnNumber(e.get_LinePosition());
de.setLocator(loc);
throw de;
} catch (XmlSchemaException e) {
XPathException de = new XPathException("Validation error reported by XML parser: " + e.getMessage(), e);
ExpressionLocation loc = new ExpressionLocation();
loc.setSystemId(getSystemId());
loc.setLineNumber(e.get_LineNumber());
//System.err.println("** parser reported line " + e.get_LineNumber());
loc.setColumnNumber(e.get_LinePosition());
de.setLocator(loc);
throw de;
} catch (Exception e) {
// The Microsoft spec says that the only exception thrown is XmlException. But
// we've seen others, for example System.IO.FileNotFoundException when the DTD can't
// be located
XPathException de = new XPathException("Error reported by XML parser: " + e.getMessage(), e);
ExpressionLocation loc = new ExpressionLocation();
loc.setSystemId(getSystemId());
de.setLocator(loc);
throw de;
}
int intype = parser.get_NodeType().Value;
isEmptyElement = parser.get_IsEmptyElement();