Hi Roland,

I'm not one of the Castor XML experts but as far as I know this should
be possible. I would suggest you to start with marshalling a sample
object first without mapping and then by using a mapping that you modify
step by step until your xml document looks like you want it to. I would
expect the unmarshalling of this document to work also with the same
mapping then.

Having said that I guess your mapping should not be to far away of what
it should be.

Regards
Ralf
Castor JDO, committer


[EMAIL PROTECTED] schrieb:
> Hi all,
> 
> I want to use Castor XML to fill a Hashtable in my class from an XML file.
> This Hashtable should map Strings to Hashsets which contain also Strings.
> Unfortunately, I could not find an example for this.
> 
> Here is what I currently have in the mapping file:
> 
> <field name="myHashtable" collection="hashtable">
>       <bind-xml name="myHashtable" node="element">
>       <class name="org.exolab.castor.mapping.MapItem">
>               <field name="key" type="java.lang.String">
>                       <bind-xml name="key" node="element"/>
>               </field>
>               <field name="value" type="java.util.HashSet">
>                       <bind-xml name="value" node="element"/>
>               </field>
>       </class>
>       </bind-xml>
> </field>
> 
> 
> And this is in the source XML:
> 
> <myHashtable xsi:type="java:java.lang.String"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>       <key key="mykey"  xsi:type="java:java.util.Hashset"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>               <value xsi:type="java:java.lang.String"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>myvalue</value>
>       </key>
> </myHashtable>
> 
> 
> Any ideas how this code should look like? Is this even possible with Castor
> XML?
> 
> Thanks in advance for your help.
> 
> 
> Greetings,
> Roland
> 
> -------------------------------------------------
> 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