Menu

#36 ElementMap annotation cannot read value element when key is an attribute

v1.0 (example)
open
5
2014-07-17
2014-07-17
Bludwarf
No

ElementMap annotation allows these two XML formats :

@ElementMap(name = "Fields", entry = "Field", key = "Name", attribute = true, value = "Value")

 <Fields>
   <Field Name="name" Value="valeur"/>
 </Fields>

@ElementMap(name = "Fields", entry = "Field", key = "Name", value = "Value")

<Fields>
  <Field>
     <Name>name</Name>
     <Value>valeur</Value>
  </Field>
</Fields>

But it is not possible to read this format (key attribute AND value element) :

<Fields>
  <Field Name="name">
     <Value>valeur</Value>
  </Field>
</Fields>

Discussion


Log in to post a comment.

MongoDB Logo MongoDB