I only have one application using JiBX at this point (very complex xsd
mandated by an industry) and didn't have to do this, but probably will
in the future.

>From the error and the docs, a way to do this would be to create a
mapping on a dummy object.  It's not an elegant solution,but it could
work.

Something like:
<binding>
        <format label="Date_dd.mm.yyyy" type="java.util.Date"
        
serializer="de.mecom.dpaplattform.util.JibxSerializer.serializeGermanDat
e"
        
deserializer="de.mecom.dpaplattform.util.JibxSerializer.deserializeGerma
nDate"
/>
        <mapping name="Dummy" class="de.mecom.dpaplattform.util.Dummy>
                <value name="Error" field="dummy"/>
        </mapping>
</binding>

and class is something like
package de.mecom.dpaplattform.util
public class Dummy {
        private String dummy;
}

Didn't try or compiled any of this.  Just from top of my head during a
really long meeting ;)

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ronald
Johnson
Sent: Tuesday, March 20, 2007 8:53 AM
To: [email protected]
Subject: [jibx-users] put format definition in separate file?

Hi,

I followed Stephans comments on how to format Date, and it works fine
(thanks!).

Since the formatting are general (and we will probably re-use them for
many bindings), I wanted to put them in a separate file that is included
in my binding files.

I tried this:

global_formats.xml:
<binding>
        <format label="Date_dd.mm.yyyy" type="java.util.Date"
        
serializer="de.mecom.dpaplattform.util.JibxSerializer.serializeGermanDat
e"
        
deserializer="de.mecom.dpaplattform.util.JibxSerializer.deserializeGerma
nDate"
/>
</binding>

and include it in my binding files (with normal include).
However, jibx complains
org.jibx.runtime.JiBXException: One or more <mapping> elements must be
defined in <binding>

I am not sure how can I remedy that, since the mapping tag demands a
class name....

What is the correct way to put formats in a separate file?
How do you guys do this (and similar behaviour)

------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to