You can use jaxb api. All you need is a xsd document for your xml. Then jaxb will generate the Java classes that you can use in your program.
Parse "struct" xml in Java
-
26-06-2023 - |
Domanda
I am facing a parsing problem with xml generated in C. I need to parse Xml like below to Java objects. Is there any elegant way how to deal with this?
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>resps</name>
<value>
<array>
<data>
<member>
<name>id</name>
<value>
<int>10</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Test Name</string>
</value>
</member>
</data>
</array>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow