sorry got the binding right now.
<structure value-style="attribute" name="myelement" >
<value style="attribute" name="attrib" field="xyz"/>
</structure>
Regards,
Chetan
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hi,
I need to bind an empty element which will only have attributes.
For example,
--------------------------------------------------
Example Msg
--------------------------------------------------
<parent>
<child1>abc</child1>
<child2>def</child2>
<myelement attrib="myattrib"/>
</parent>
At present i am doing it like this
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<binding>
<mapping name="parent" class="Parent">
<value name="child1" field="child1"/>
<value name="child2" field="child2"/>
<structure element="empty" field="myelement"/>
</mapping>
<mapping name="myelement" class="java.lang.String">
<value style="attribute" name="attrib" field="myelement" />
<value style="element" name="myelement" field="mylement"/>
</mapping>
</binding>
--------------------------------------------------
And the output looks like this
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<parent myattrib="myattrib-val">
<child1>1</child1>
<child2>2</child2>
<myelement>myattrib-val</myelement>
</parent>
--------------------------------------------------
whereas it should actually look like this (or as in Example Msg)
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<parent>
<child1>1</child1>
<child2>2</child2>
<myelement myattrib="myattrib-val"/>
</parent>
--------------------------------------------------
Can you kindly tell me how to achieve this.
Regards,
Chetan
_______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users