Hi Bertrand,

I think what you have found are 2 independent bugs that I expect others
have also found before. Could you please take a look into
http://jira.codehaus.org/browse/CASTOR if there are issues that describe
your problems. If there are none please create new ones. It would be
great if you could provide us with test cases that enable the XML
committer to reproduce the problem. Please attach the tests to the
issues you have found or created.

Regards
Ralf
Castor JDO, committer

Bertrand Goupil schrieb:
> Hi all,
> 
> I want to unmarshall XML to create a list of items. My items are
> different as follow:
> 
> <itemSet>
>  <topic:item xmlns="topic.ns" />
>  <news:item xmlns="news.ns" />
>  <pack:item xmlns="pack.ns" />
> </itemSet>
> 
> In my object model, the list use an abstract class and all namespaces
> have their own class extended from the abstract class.
> eg:
> topic:item => TopicItem extends AAnyItem
> news:item = > NewsItem extends AAnyItem
> 
> I want to map a custom class from a QName (prefix+localname) and add it
> in a simple list.
> 
> I have the following mapping:
> #itemSet
> (in the ItemSet Class : List items = new LinkedList();
> public void addItem(AAnyItem item){
>  items.add(item);
> }
> )
> <class name="ItemSet">
> <map-to xml="itemSet" />
> <field name="items" type="AAnyType" collection="collection">
>  <bind-xml node="element" />
> </field>
> </class>
> #news
> <class name="NewsItem" extends="AAnyType">
> <map-to xml="item" ns-uri="news.ns"/>
> ...
> </class>
> #topic
> <class name="TopicItem" extends="AAnyType">
> <map-to xml="item" ns-uri="topic.ns"/>
> ...
> </class>
> 
> This mapping works if local name are different.
> In this case, if I have only one type of element, (no matter which
> type), the mapping work. When I mix type (like the exemple), castor use
> only one concret class for all namespace !!
> Another issue, I declare this class mapping using the include element.
> For example: includeTopic.xml for TopicItem object definition and
> includeNews.xml forNewsItem object definition.
> The mapping class depends of the declaration order and take always the
> last declaration (eg. if TopicItem object mapping is declare first, it
> will use the last definition NewsItem object.)
> 
> Have you any suggestion to solve this mapping issue, It is a bug !?
> 
> Thanks for your answers!
> 
> Bertrand
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> This e-mail, and any file transmitted with it, is confidential and 
> intended solely for the use of the individual or entity to whom it is
> addressed. If you have received this email in error, please  contact the
> sender and delete the email from your system. If you are  not the named
> addressee you should not disseminate, distribute or copy  this email.
> 
> For more information on Agence France-Presse, please visit our web site
> at http://www.afp.com
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please send an empty message
> to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 

-- 

Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany

Tel.   +49 7071 3690 52
Mobil: +49 173 9630135
Fax    +49 7071 3690 98

Email: [EMAIL PROTECTED]
Web:   www.syscon-world.de

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to