Tips for debugging XML beans - newbie

Nicholas W <[email protected]> Fri, 28 Jan 2011 15:48:19 +0100
Newsgroups gmane.text.xml.xmlbeans.user
Message-ID <[email protected]>
Hi All,
 I am having some trouble unmarshalling data generated by a remote
REST web service (for which I have the XSD.

I have set

log4j.logger.org.apache.xmlbeans = DEBUG

in log4j.properties

and I am using code like:

XmlOptions xmloptions = new XmlOptions();
		 ArrayList errorList = new ArrayList();
		 xmloptions.setErrorListener(errorList);

FindObjectsResponseDocument f =
FindObjectsResponseDocument.Factory.parse(xmlresult,xmloptions);

boolean valid = f.validate();
if (!valid) {
			   for (int i = 0; i < errorList.size(); i++)
			      {
			          XmlError error = (XmlError)errorList.get(i);
			
			          System.out.println("\n");
			          System.out.println("Message: " + error.getMessage() + "\n");
			          System.out.println("Location of invalid XML: " +
			              error.getCursorLocation().xmlText() + "\n");
			      }
		}

To find out whats going on.

However. Elements are null when they should not be, nothing is
reported in the logging and the errorList is empty.

I would be greatful if you could point me to some resources to show
how to debug XMLBeans unmarshalling.

Thanks a lot
Regards,
Nicholas W.