Given the class

class Clazz{
    int id;
    List<String> dataSet;
}

The mapping below throws error during compile time

<mapping name="clazz" class="Clazz" value-style="attribute">
    <value name="id" field="id"/>
    <collection name="dataSet" field="dataSet"
                item-type="java.lang.String"
                factory="org.jibx.runtime.Utility.arrayListFactory">
            <value name="data"/>
    </collection>
</mapping>

Error: Attributes not allowed as child components of collection; on 
value element at (line 5, col 21, in Clazz.jibx.xml)

This error goes away when the value-style attribute is removed in the 
mapping element. This error is probably due the combination of using a 
collection of a Jibx's built-in conversion type (String in this case) 
and setting a default value style in the mapping element. The obvious ( 
& inconvenient ) fix is to move the style attribute to the value 
elements that require it.

regards
Varghese C V



-------------------------------------------------------------------------
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

Reply via email to