У меня есть следующая строка xml. Я хочу преобразовать его в объект Java, чтобы сопоставить каждый тег с полями этого объекта. Лучше, если я смогу ввести разные имена полей по сравнению с именем тега. Как я могу это сделать? Я смотрю на JAXB, но меня все еще смущают такие части, как «ответ ns4 :» и теги внутри тегов. Заранее спасибо...
<ns4:response>
<count>1</count>
<limit>1</limit>
<offset>1</offset>
<ns3:payload xsi:type="productsPayload">
<products>
<product>
<avgRating xsi:nil="true"/>
<brand>Candie's</brand>
<description>
<longDescription>
long descriptions
</longDescription>
<shortDescription>
short description
</shortDescription>
</description>
<images>
<image>
<altText>alternate text</altText>
<height>180.0</height>
<url>
url
</url>
<width>180.0</width>
</image>
</images>
<price>
<clearancePrice xsi:nil="true"/>
<regularPrice xsi:nil="true"/>
<salePrice>28.0</salePrice>
</price>
</product>
</products>
</ns3:payload>
</ns4:response>