Results 1 to 3 of 3

Thread: create java classes from xml file

  1. #1
    Join Date
    Apr 2010
    Posts
    8

    Question 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?

    regards
    angela

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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. #3
    Join Date
    Apr 2010
    Posts
    8

    Default

    thanks for the hints! i'll have a look

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •