Here is my mapping files:

D:\mapping\message\SendSerialCodeSMSReqMap.xml

...

   <include href="../common/SIAPHeaderMap.xml"/>

...



D:\mapping\common\SIAPHeaderMap.xml

...

   <include href="SendAddressMap.xml"/>

...



D:\mapping\common\SendAddressMap.xml

...

<mapping>

    <class name="com.test.xml.common.SendAddress">

        <map-to xml="SendAddress"/>

        <field name="deviceType" type="java.lang.String">

            <bind-xml name="DeviceType" node="element"/>

        </field>

        <field name="deviceId" type="java.lang.String">

            <bind-xml name="DeviceID" node="element"/>

        </field>

    </class>

</mapping>

...



Here is my test code.

 …

Mapping reqMapping = new Mapping();

reqMapping.loadMapping("D:\\mapping\\message\\SendSerialCodeSMSReqMap.xml");

xmlContext.addMapping(reqMapping);

…



It cannot find the SendAddressMap.xml. I looked into the source code, and I 
found the relative path is always based on the root mapping 
file(SendSerialCodeSMSReqMap.xml) but not the parent mapping 
file(SIAPHeaderMap.xml).


Reply via email to