In that case, can I please ask you to create a new Jira issue and attach
all relevant file to it. But please try to keep the set of files (and
size) minimal to ease our life.
Werner
Black, Peter (IT) wrote:
Werner,
That did not help. That gives me a null list.
I think it has to do with the namespaces.
When I remove the namespaces, it works.
Peter
-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 16, 2007 5:19 AM
To: [email protected]
Subject: Re: [castor-user] unable to retrieve element value
Peter,
the field mapping for 'Authorizations' somehow does not look right to
me. Drop the locations attribute from the following field mapping
<field name="authorizations"
type="com.value.Authorization" collection="arraylist">
<bind-xml name="Authorisations" />
</field>
and see whether this makes a difference.
Regards
Werner
Black, Peter (IT) wrote:
Hello,
I am having difficulty retrieving the value of an element in my xml.
Here is a sample of my xml I am trying to unmarshal, and my castor
binding file:
<s:DBResponse xmlns:s="http://www.abc.com/neris"
xmlns:tc="http://xml.abc.com/ns/tc/tmd/11.0/TMDElements"
xmlns:ac="http://xml.abc.com/ns/tc/tmd/11.0/TAccount"
xmlns:di="http://xml.abc.com/ns/tmd/11.0/instruction/neris"
xmlns:sc="http://xml.abc.com/ns/tc/tmd/11.0/TMDSecurity">
<di:DBEntities>
<di:DBEntity>
<tc:Header>
<tc:EntryUser>Peter</tc:EntryUser>
<tc:EntryTime>2006-12-03 20:56:56.683</tc:EntryTime>
</tc:Header>
<tc:Authorisations>
<tc:Authorisation>
<tc:AuthorisationUser>Peter</tc:AuthorisationUser>
<tc:AuthorisationTime>2006-12-03
21:58:54.057828</tc:AuthorisationTime>
</tc:Authorisation>
</tc:Authorisations>
...
</di:DBEntity>
...
</di:DBEntities>
<mapping>
<class name="com.abc.value.DBResponse">
<map-to xml="DBResponse" />
<field name="dbEntities" type="com.abc.value.DBEntity"
collection="arraylist">
<bind-xml name="DBEntity" location="DBEntities"
/>
</field>
</class>
<class name="com.abc.value.DBEntity">
<map-to xml="DBEntity" />
<field name="authorizations"
type="com.value.Authorization" collection="arraylist">
<bind-xml name="Authorisation"
location="Authorisations" />
</field>
</class>
<class name="com.abc.value.Authorization">
<map-to xml="Authorisation"/>
<field name="authorizationUser" type="string">
<bind-xml name="AuthorisationUser"
node="element"/>
</field>
<field name="authorizationTime" type="string">
<bind-xml name="AuthorisationTime"
node="element" />
</field>
</class>
</mapping>
I end up getting an object graph that includes everything, but the
fields of my Authorization object, authorizationUser and
authorizationTime, are null, when they should be set to 'Peter' and
'2006-12-03 21:58:54.057828', respectively.
Thanks,
Peter
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not
intend to waive confidentiality or privilege. Use of this email is prohibited
when received in error.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email