Hi,
very hard to tell, as looking at this, I cannot spot the obvious error.
What about the fulyl qualified class name of the IDOC class ? If that#s
wrong, Castor XML will use introspection, which might be what is
happening ?
Regards
Werner
PS What Castor version are you using ?
Konni wrote:
I'm new to castor and I wanted to use a mapping file in order to modify my
xml-file in the marshalling process. But the mapping file has no effect.
Here is the mapping file (Mapping.xml):
<?xml version="1.0" encoding="iso-8859-1"?>
<mapping>
<class name="bestellung.IDOC">
<map-to xml="IDOC"/>
<field name="BEGIN" type="string">
<bind-xml name="BLABLABLA" node="attribute" />
</field>
</class>
</mapping>
Here is the beginning of the original xml file:
<?xml version="1.0" encoding="iso-8859-1"?>
<ORDERS05>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
...
Here is my Java code:
...
FileWriter writer = new FileWriter("Testbestellung_neu.xml");
Marshaller marshaller = new Marshaller(writer);
Mapping mapping = new Mapping();
mapping.loadMapping(new URL("file:/D:/Temp/XML/Mapping.xml"));
marshaller.setMapping(mapping);
marshaller.setEncoding("iso-8859-1");
marshaller.marshal(orders05);
writer.close();
...
I expected the IDOC segment after the marshalling process like the
following:
<IDOC BLABLABLA="1">
The mapping file is in the classpath. When I call the program, there is the
INFO message "Loading mapping descriptors from ...". So the file will be
found. And there are no error messages.
What am I doing wrong ?
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email