Hi Eugeny, Do you need to use both versions (both namespaces) within a single document? Your easiest solution is to use two separate binding definitions, which works fine as long as you're not mixing the two within a single document. Otherwise it gets more complicated.
- Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Eugeny N Dzhurinsky wrote: > Hello! > > I'm new to JIBX, I'd like to map same class to several namespaces. How should > I do that? > > I tried to use something like this: > > <!-- Binding for JEP-0030: Service discovery --> > <binding> > <!-- setup serializers/deserializers --> > <format type="com.echomine.xmpp.JID" > serializer="com.echomine.xmpp.JID.toString" > deserializer="com.echomine.xmpp.JID.parseJID"/> > <mapping name="query" ns="http://jabber.org/protocol/disco#info" > ordered='false' > class="com.echomine.jabber.packet.DiscoveryQueryIQPacket"> > <namespace uri="http://jabber.org/protocol/disco#info" > default="elements"/> > <collection field="features" usage="optional"> > <structure name="feature" type="com.echomine.jabber.packet.Feature"> > <value style="attribute" name="var" field="var" /> > </structure> > </collection> > <collection field="identities" usage="optional"> > <structure name="identity" > type="com.echomine.jabber.packet.Identity"> > <value style="attribute" name="category" field="category" /> > <value style="attribute" name="type" field="type" /> > <value style="attribute" name="name" field="name" /> > </structure> > </collection> > </mapping> > <!-- > <mapping name="query" ns="http://jabber.org/protocol/disco#items" > ordered='false' > class="com.echomine.jabber.packet.DiscoveryQueryIQPacket"> > <namespace uri="http://jabber.org/protocol/disco#items" > default="elements"/> > <collection field="items" usage="optional"> > <structure name="item" type="com.echomine.jabber.packet.Item"> > <value style="attribute" name="jid" field="jid" /> > <value style="attribute" name="name" field="name" /> > <value style="attribute" name="node" field="node" > usage="optional" /> > </structure> > </collection> > </mapping> > --> > </binding> > > But that doesn't work, mapping is invalid because I'm trying to map same > object? > > Thank you in advance! > > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users