Not sure this will work, but you can try it, this is how you do it with
the SchemaCompiler APIs. Basically you need to cast the error Listener
to an XmlError to get the information
LinkedList errors = new LinkedList();
XmlOptions opts = new XmlOptions().setErrorListener(errors);
//TODO: you compilation step, make sure to use opts in API
for(int i=0; i <errors.size(); i++){
XmlError e = (XmlError) errors.get(i);
// All kinds of information about the Error
// Location of the Error
System.out.println("["+e.getLine()+","+e.getColumn()+"]-"+e.getSeverity(
))
// Information about the error
System.out.println(e.getErrorCode() + ": " + e.getMessage());
}
-----Original Message-----
From: Jim McMaster [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 1:05 PM
To: [email protected]
Subject: How do I find the source of a SchemaTypeSystemCompiler error?
I am trying to compile an xsd. The SchemaTypeSystemCompiler is throwing
an
XmlException, with an error:
cvc-complex-type.4: Expected attribute: className in element method
I have searched the file, and cannot find the source of the error. I
have
about 30 occurrences of the method element, and each one looks like it
has a
className attribute by visual inspection.
I know I am missing something right in front of my nose, but the cryptic
error message does not give me much help. How do I figure out what
"cvc-complex-type.4" is? How do I figure out which element is missing
the
attribute? I have tried the debugger, but when the XmlBeans exception
occurs, there is nothing I can find that shows me where in the xsd file
the
compiler found the error.
It would be nice if I could get a line and/or character offset, or some
textual context, or anything that would help me find a typo in a
537-line
schema file.
Does anyone have any suggestions?
--
Jim McMaster
mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]