File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
XML and Related Technologies
Castor unmarshalling problem when ignoring elements
Joined: Aug 12, 2009
Apr 13, 2011 11:26:12
I have 2 XML files that have some attributes that are same.
<?xml version="1.0" standalone="yes"?> <Person> <person_id>1234</person_id> <Family-member> <Name>abc</Name> <relation>xyz</relation> <Family-member> <Family-member> <Name>der</Name> <relation>kkk</relation> <Family-member> </Person>
<?xml version="1.0" standalone="yes"?> <People> <name>aaa</name> <department>qqq</department> <name>bbb</name> <department>jjj</department> <Manager_Info>...</Manager_Info> </People>
When I am parsing the second xml, then I am getting error as org.exolab.castor.xml.MarshalException:Illegal text data found as child of:name
Unmarshaller unmarshaller = new Unmarshaller(People.class); unmarshaller.setValidation(false); // I have tried both true and false but no change unmarshaller.setIgnoreExtraElements(true); unmarshaller.setMapping(mapping);
Can you please help me why the elements are not ignored?
I agree. Here's the link:
subject: Castor unmarshalling problem when ignoring elements
JAXB Validation Issue - [org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of el
Problem in <one-to-one> relation mapping
Hibernate nested joined-subclass
Hibernate parent/child and foreign key relationships mapping
Clarification Requested - XML recordset & JAXB classes
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015