JAXB Deserialization [Unmarshal] Given XML File

1 vue (au cours des 30 derniers jours)
Eric Tsai
Eric Tsai le 28 Oct 2019
Hello,
I am trying to work with the JAXB jar file, downloaded from here. I have been able to add the jar file to my java path and imported the necessary classes in Matlab, however I am not sure how to use the unmarshal method:
public static <T> T unmarshal(File xml,Class<T> type)
From my understanding, the method will load the data from xml into a provided class. However, what does the inside of the class need to look like? Are there any examples of both an xml and class file that I could view the code? The following is what I am attempting in Matlab, where <unknown class> is the class I am not sure how to structure.
jaxb = JAXB.unmarshal('plants.xml',<unknown class>)
Thanks!

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by