Announcement Announcement Module
No announcement yet.
create java classes from xml file Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • create java classes from xml file

    hi all

    i have to read a xml file with spring integration, parse it and then work with the content. is there an easy way to genereate java classes from an xml file with a spring integration component?


  • #2
    JAXB, JiBX, Castor, XmlBeans etc. . There are many libraries for that. However I am personally not convinced that this is always the right thing to do especially if you only need to look/process few values and do it only once and move on.
    Hav you look at XPath which gives you a very simply API to get what you need in one line of code no matter how deep its hidden in the XML hierarchy?
    With SpringIntegration we also have various XPath components (filters, routers, transformers etc.) to help you even more.


    • #3
      thanks for the hints! i'll have a look