Hi Stephen, Greg,
Thanks for all your ideas. It is very beneficial.
Finally I am getting what I want but need to do some extra effort in putting
"ns-uri" in all "map-to" elements as Stephen
suggested.
There is only one limitation to this solution is I can not use location attribute now for elements. But I can use the same for attribute. It is fine with me.
I feel future versions of Castor should take care of prefix and namespaces during UnMarshalling/Marshalling. If UnMarshaller provides the methods to retrieve the namespace and prefix bound with elements one can use the same during Marshalling.
This makes life easy when there is need to change the Prefix OR NameSpace. One can easily do the same.
If one had user interface for editing my configuration files, I would never mind using prefix. And if there is one prefix then also it is fine. But when more than prefix present in file one should think about using it when user editing files. User may not feel comfortable in my opinion.
Please find below the complete listing of solution I had.
Thanks and Regards,
Jitesh
<tmsettings xmlns="http://www.ne.jp/method"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ne.jp/method settings.xsd">
<logging>
<logger name="tmcompiler" boundrylevel="5"/>
<logger name="tmclient" boundrylevel="10"/>
<logger name="tmwebapp" boundrylevel="15"/>
</logging>
</tmsettings>
<ca:mapping xmlns:ca="http://castor.exolab.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://castor.exolab.org/ mapping.xsd">
<ca:map-to xml="tmsettings" ns-uri="http://www.ne.jp/method" />
<ca:field name="loggerList" type="TMLoggerList">
<ca:bind-xml name="logging" />
</ca:field>
</ca:class>
<ca:map-to xml="logging" ns-uri="http://www.ne.jp/method" />
<ca:field name="loggerList" collection="map" get-method="getLoggerList"
set-method="addLogger" type="TMLogger">
<ca:bind-xml name="logger"/>
</ca:field>
</ca:class>
<ca:class name="TMLogger">
<ca:map-to xml="logger" ns-uri="http://www.ne.jp/method" />
<ca:field name="name" type="string">
<ca:bind-xml name="name" node="attribute"/>
</ca:field>
<ca:field name="boundryLevel" type="string">
<ca:bind-xml name="boundrylevel" node="attribute"/>
</ca:field>

