Hi all,

I'm new to Castor so you'll have to forgive me if this is a dumb
question! :) Given the sample XML and mapping below, is there any way of
preventing the <input> element which appears within the <custom> element
from being unmarshalled using the Input class? The primary reason for
doing this is that the contents of <custom> are arbitrary (hence the use
of AnyNode). It just so happens that in this case the element happens to
match a previously defined element name.

  Sample XML:

  <device>
    <input>
       <!-- 'input' children omitted for brevity. -->
    </input>
    <output>
       <!-- 'output' children omitted for brevity. -->
    </output>
    <custom name="theName" type="theType">
      <input>
        <!-- 'input' children omitted for brevity. -->
      </input>
    </custom>
  </device>


  Sample Mappings:

  <class name="Input">
    <map-to xml="input" />
    <!-- Fields omitted for brevity. -->
  </class>

  <class name="Custom">
    <map-to xml="custom" />
    <field name="name" direct="true" required="true">
       <bind-xml name="name" node="attribute"/>
    </field>
    <field name="type" direct="true" required="true">
       <bind-xml name="type" node="attribute"/>
    </field>
    <field name="data" direct="true" required="true"
type="org.exolab.castor.types.AnyNode">
      <bind-xml matches="*"/>
    </field>
  </class>  

Any help appreciated!

Regards,
Chris

_______________________________________________
This email has been scanned for Softel by Star.

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

    http://xircles.codehaus.org/manage_email


Reply via email to