Hello

I'm using castor 0.9.9.1 with a mapping file (AB-binding.xml). The
mapping file has an include element that points to another mapping file
with the mapping definition of the common classes in my project. The
problem is that Castor can't find the mapping file so it uses the
default mapping during the Marshalling. I load the mapping file during
the runtime of my program with the following code and URL:

        Mapping mapping = new Mapping();
                mapping.loadMapping(marshalBindingURL);

        http://127.0.0.1:8080/binding/AB-binding.xml

Here is the mapping file with the include element. The file
common-binding.xml is in the same directory.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapping SYSTEM "mapping.dtd">
<mapping>
    <include href="common-binding.xml"/>
    <class name="my.ABList" auto-complete="false">
        <map-to xml="AListe"/>
        <field name="AListe" type="java.util.Collection"
required="false" direct="false" transient="false">
            <bind-xml name="A" location="AListe" node="element"
reference="false"/>
        </field>
        <field name="BListe" type="java.util.Collection"
required="false" direct="false" transient="false">
            <bind-xml name="B" location="BListe"  node="element"
reference="false"/>
        </field>
    </class>
</mapping>

If I run my program with this file it produces a XML file like the
following one. The elements from the master mapping file have the right
name but all elements from the common-binding.xml have wrong element
names. If I change the value from the href attribute to
http://127.0.0.1:8080/binding/common-binding.xml everything works fine
and my program creates the correct XML file. But this is no solution to
me because I must serve several test levels.

<?xml version="1.0" encoding="UTF-8"?>
<ABListe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="http://127.0.0.1:8080/schema/my-schema.xs
d">
        <AListe>
                <A>
                        <element-number-one>value</element-number-one>
                        <element-number-two>value</element-number-two>
                        ...
                        ...
                        ...
                </A>
        </AListe>
</ABListe>

I would really appreciate it if somebody can help me.

Best regards 
Christian


-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------


-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to