Hi all,

I'm having a bit of trouble with my code and I was hoping somebody could
lend me a hand.  I'll be looking into myself but hopefully someone can point
out what I've done wrong.

I've got some Java code that unmarshalls some data from a URL.  I seem to
get the correct number of objects back from my code but when inspecting the
objects, something is up.  I'll browse down through my objects but when I
get to a certain level everything after that is just null objects.

Here's my code:
<code>
// Load Mapping
Mapping mapping = new Mapping();
mapping.loadMapping("docs/mapping.xml");

// Create a new Unmarshaller
unmarshaller = new Unmarshaller(OAIPMH.class);
unmarshaller.setMapping(mapping);
unmarshaller.setIgnoreExtraElements(true);
unmarshaller.setIgnoreExtraAttributes(true);
unmarshaller.setValidation(false);

URL url = new URL(urlStr);
InputStream urlStream = url.openStream();
InputSource urlSource = new InputSource(urlStream);

OAIPMH oaipmh = (OAIPMH) unmarshaller.unmarshal(urlSource);
urlStream.close();
</code>

Mapping file - http://www.ltheobald.co.uk/mapping.xml
URL I am trying to parse -
http://life.essexcc.gov.uk:8081/ixbin/oai?verb=ListRecords&resumptionToken=5X4aRFhV8zb/940

If you look at the feed, you'll see there is a "ci:record" element.  This is
where things start to go wrong.  Although the correct amount of objects seem
to be created, all the members of these objects are null.

I'm guess it's something to do the fact that I have two record elements (one
with a different namespace) but I haven't been able to get round this.

Can anyone see any glaring errors in my mapping file that could be causing
this?

Regards,
Lee
-- 
View this message in context: 
http://www.nabble.com/Null-Objects-While-Unmarshalling---Due-to-simiarily-named-elements--tf3657536.html#a10218708
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to