Hi all,
I have the problem that when I unmarshall a document and marshall it again
(roundtrip), the value of an attribute is prefixed with the name of the
inherited class:
In the original XML file the root node contains an attribute named "objid" like:
<item:item [...] objid="ID0815" [...]>
In the roundtripped XML document this attribute gets marshalled to:
<item:item [...] objid="de.foobar.referenceobjects.ItemRO:ID0815" [...]>
Why is JiBX adding this prefix?
What can I do to prevent JiBX from adding this prefix?
Situation:
I have one class "ReferenceObject" containing (nothing but) one private
attribute "objectId", available via public getter/setter.
The mapping of this class is (in a separate file):
<binding>
<mapping class="de.foobar.referenceobjects.ReferenceObject" abstract="true"
/>
</binding>
Inherited from the ReferenceObject-class, there is a class "ItemRO". It has an
attribute "reference" of type "ItemRO".
The "ItemRO" class is bound with the following mapping (in a separate file):
<binding>
<mapping class="de.foobar.referenceobjects.ItemRO"
extends="de.foobar.referenceobjects.ReferenceObject"
abstract="true">
<!-- Node: [EMAIL PROTECTED] -->
<!-- Field: ItemVO.reference [ItemRO] (inherited from superclass
ReferenceObject)-->
<value style="attribute" name="objid" get-method="getObjectId"
set-method="setObjectId" />
</mapping>
</binding>
In the main binding file, there is the following binding to a field "reference"
of type "ItemRO":
<binding>
[...]
<!-- Node: [EMAIL PROTECTED] -->
<!-- Field: ItemVO.reference [ItemRO] -->
<value style="attribute" name="objid" field="reference" usage="optional" />
[...]
</binding>
I am using one main binding file, declaring all namespaces and including all
other binding files (via <include...>).
Thanks,
Johannes
--
=======================================
Johannes Sebastian Agilo Müller
Eburonenstr. 19
D-50678 Köln
Germany
Mail: [EMAIL PROTECTED]
Web/GnuPG key: http://www.jsam.de
=======================================
-------------------------------------------------------------------------
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