hpehl / piriti

JSON and XML Mapper for GWT
40 stars 16 forks source link

Attributes not added correctly to nodes with text-only content #1

Open hpehl opened 12 years ago

hpehl commented 12 years ago

What steps will reproduce the problem?

  1. Create a POJO marked-up as such:
public class SomeClass
{
@Path("field")
public String text;
@Path("field/@name")
public String name;
}
  1. Create an instance of SomeClass, give both fields values and attempt to map to XML with Piriti.

What is the expected output? What do you see instead?

Expected:

<?xml version="1.0" encoding="UTF-8"?>
<someClass>
 <field name="nameValue">value</field>
</someClass>

Actual result:

<?xml version="1.0" encoding="UTF-8"?>
<someClass>
 <field>value</field>
 <field name="nameValue"/>
</someClass>

What version of the product are you using? On what operating system? 0.8, Java 1.6, GWT 2.4.0

Please provide any additional information below.

Mapping XML -> POJO works fine, it's just POJO -> XML that breaks.