I have one kind of xml documents:

<a>
  <foo>bar</foo>
  <!-- plus loads of other tags -->
</a>

I now need to extend that kind of document with addtional information
for some cases, my idea was to just create a different namespace for
those cases, e.g. the xml document would look like this:

<a xmlns="http://www.example.com/dummyns";>
  <foo>bar</foo>
  <!-- plus loads of other tags -->

  <!-- addtional tags that doesnt exist in original A -->
  <addtionalstuff>blah</addtionalstuff>
</a>

when processing xml documents, I have a file that imports different
bindings, and jibx should find out which one to use:

<binding name="a_binddef_multi" direction="input">
    <include path="a_binddef.xml" />
    <include path="a_withadditionalstuff_binddef.xml" />
</binding>

where a_binddef.xml is a normal binding, and the
a_withadditionalstuff_binddef.xml looks like this:

<binding direction="input">

  <namespace uri="http://www.example.com/dummyns"; default="elements"/>

    <include path="a_binddef.xml" />
    <mapping ordered="false" name="a"
        class="com.example.model.AWithAddtionalStuff"
        extends="com.example.model.A"
        ns="http://www.example.com/dummyns";>

        <structure map-as="com.example.model.A" />

        <!-- here would be my mapping for addtionalstuff -->
    </mapping>
</binding>

however, i get this error message when I try to process an xml document

org.jibx.runtime.JiBXException: No unmarshaller for element
"{http://www.example.com/dummyns}a"; (line 1, col 1)

I thought the problem is that they both had the same base tag name
("a"), but I dont seem to get it right.... any pointers how I can get
this kind of "inheritance" to work?

(I tried to simplify the code above, in reality the xml and the
binddefs are quite large with many tags)

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to