They can be unmarshalled into any Hashtable/Map field as such:

   <class name="MyRootClass">
      <map-to xml="root"/>
      <field name="namespaces" collection="hashtable" type="string">
            <bind-xml node="namespace"/>
      </field>
      ...
   </class>

Keep in mind however this this is locally scoped, meaning that only namespaces declared on the element that maps to the MyRootClass will be added to the hashtable.

So if you have child elements that also declare namespaces, they will need their own hashtable/map to hold their own locally declared namespaces.

--Keith



Siddharth Chhabra wrote:
hi
I was wondering if someone could point me to a
mapping file/snippet which demonstrates how to
unmarshall the namespace declarations which usually
appear at the top of an xml document.
since some of these declarations cannot be
anticipated at designtime, is there a way to
unmarshall them in a "namespace declaration list"
example declaration : (this is the root of the doc)
<process name="invokeProcess"
xmlns:tns="http://www.panaceasoftware.com/invokeDefinition";
xmlns:bns="http://www.beasoftware.com/receiveRequest"/>
I would like to have the prefix 'tns, bns, etc..'
mapped to their respective namespace-uris if
possible.
I am not sure whether this is currently supported by
castor ?
I tried using a <bind-xml matches="xmlns*" /> but
that doesnt seem to work


Any insights/suggestions how to handle this will be
greatly appreciated.
Note : The rest of my xml payload works like a
charm.


________________________________________________________________________



----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user

Reply via email to