[Simple-support] Error when all elements have the same name
Brought to you by:
niallg
|
From: Arthur E. <ar...@bl...> - 2012-09-06 16:57:00
|
I have some XML such as the following:
<rdr>
<details>
<detail>
<name>version</name>
<value>15.0</value>
</detail>
<detail>
<name>resolution</name>
<value>1080X1920</value>
</detail>
<detail>
<name>browser</name>
<value>Firefox</value>
</detail>
</details>
</rdr>
and I would like to map this to a bean so I have the following properties:
@Path("details/detail[1]")
@Element(name = "value")private String version;
@Path("details/detail[2]")
@Element(name = "value")private String resolution;
@Path("details/detail[4]")
@Element(name = "value")private String browser;
This results in a null pointer exception because they all have the
same element names. InstantiatorBuilder.register(Label, Map) is
putting a null as the value against any keys that are repeated.
What is the reasoning behind this?
I commented this out and my code runs fine, but
UnionWithSameNamesAndDifferentPathsTest.testErrorInParametersExample
failed because "Ambiguous parameter should cause a failure". I can't
understand what this test is trying to test!
~
Arthur
|