Announcement Announcement Module
No announcement yet.
What is the correct strategy in my case? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is the correct strategy in my case?

    Hi there!

    first of all, I am really new to Spring Batch and Spring in general.
    I will describe what I am trying to achieve and hoping for some great insight from you guys.
    I want to parse an OSM (OpenStreetMaps) file which is actually an XML file, do some processing and write the output in the same format.
    OSM files consist of a number of <node> elements followed by a number of <way> elements.
    What I want to achieve is:
    Process the <way> elements, but the problem is that they have references to the <node> elements. So is it a way to have a global variable? Like an ArrayList to hold the <node> elements?
    The other goal is to parse the entire file just once and not two times (1)parse <node> elements+ignore <way> elements, 2)parse<way> elements+ignore <node> elements)
    I have read this topic: which gives a solution for the multiple element types with the MultiFragmentStaxEventItemReader class but it isn't enough to achieve the above.