Dear all

I have a class which constitutes a simple tree node. 
class Node {
  String id;
  String name;  // <-- this should be the tag name
  Node parent;
  List<Node> children;
}

The Node.name attribute is depending on the level. It can be 'section',
'chapter', 'article'. The generated XML tags should then be named according
to the Node.name attribute

<section id="1">
  <chapter id="3">
    <article id="7">
     ...
    </article>
  </chapter>
</section>

I created a custom mashaller and this is working fine for the marshalling
direction. The XML is genereated correctly.

But ...
... when I try to go the unmarshalling direction, trying to create the
objects from the XML, Jibx tells me
org.jibx.runtime.JiBXException: No unmarshaller for element "section" (line
2, col 1)

Could s.o. possibly tell me how I can declare the mapping so it uses my
custom unmarshaller when coming across a 'section' tag (or 'chapter' or
'article')?

Your help would graciously appreciated.

 Markus

P.S. Binding:

  <mapping class="com.bla.Node" 
  marshaller="com.bla.jibx.NodeMarshaller"
  unmarshaller="com.bla.jibx.NodeMarshaller"/>

-- 
View this message in context: 
http://www.nabble.com/Mapping-one-class-to-different-tag-names-tp23429344p23429344.html
Sent from the jibx-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to