Re: Tips for debugging XML beans - newbie

Cezar Andrei <[email protected]> Wed, 02 Feb 2011 12:19:21 -0600
Newsgroups gmane.text.xml.xmlbeans.user
Message-ID <1296670761.3931.5.camel@i7>
Nicholas,

Did you try error.getObjectLocation()? Do you have any more details
about the error?

Cezar



On Fri, 2011-01-28 at 15:48 +0100, Nicholas W wrote:
> 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.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>