the binding XML will be

<?xml version="1.0" encoding="UTF-8"?>
<binding value-style="attribute">
<mapping class="Customer" name="Customer"  >
        <structure      name="John"  map-as="commonTag"/> 
        <structure      name="bill"  map-as="commonTag"/> 
</mapping>
<mapping type-name="commonTag"  class="commonTag" abstract="true">
<value style="attribute"        name= "age"     field= "age" usage="optional"/>
<value style="attribute"        name= "age"     field= "age" usage="optional"/>
</mapping>      
</binding>

You class definition is wrong. 
You will have to have a class definition like this

public class Customer { 
        commonTag john ; 
        commonTag bill ; 
} 

public class commonTag{
string name;
string age;
}







jamesavery22 wrote:
> 
> The xml I want looks like this:
> 
> <customers>
>       <john>
>               <age>27</age>
>       </john>
>       <bill>
>               <age>29</age>
>       </bill>
> </customers>
> 
> 
> and the class is like this:
> 
> public class Customer {
>       private string name;
>       private string age;
> }
> 
> 
> How can I just get the structure name to be based on the field "name?"
> 

-- 
View this message in context: 
http://www.nabble.com/any-way-to-set-the-name-of-a-structure-from-a-field--tp18944218p18945738.html
Sent from the jibx-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to