I have successfully set it up following the instructions on the castor site.
Currently, this is what i have:
<Config>
<Channel name="Help">
<ChannelConfig name="Help">
<color>CCCCCC</color>
</ChannelConfig>
</Channel>
</Config>

Is there a way to eliminate the extra Channel node, so it would look like
this:
<Config>
<ChannelConfig name="Help">
<color>CCCCCC</color>
</ChannelConfig>
</Config>

Here is my current mapping file:
<mapping>
      <class name="com.ss.external.Config">
          <map-to xml="Config"/>
          <field name="Channels" collection="hashtable">
              <bind-xml name="Channel">
                  <class name="org.exolab.castor.mapping.MapItem">
                      <field name="key" type="java.lang.String">
                          <bind-xml name="name" node="attribute"/>
                      </field>
                      <field name="value"
type="com.ss.external.ChannelConfig">
                          <bind-xml name="ChannelConfig"/>
                      </field>
                  </class>
              </bind-xml>                 
          </field>                
      </class>  
      <class name="com.ss.external.ChannelConfig">
          <map-to xml="ChannelConfig"/>
          <field name="Name" type="java.lang.String">
              <bind-xml name="name" node="attribute"/>
          </field>
          <field name="Color" type="java.lang.String">
              <bind-xml name="color" node="element"/>
          </field>
      </class>
    </mapping>

Thanks in advance for your help,
Philippe

PS. is there a way to make the marshaller print out well formatted xml?
-- 
View this message in context: 
http://www.nabble.com/Hashmap-mapping-question-tp15489378p15489378.html
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