I have data from open street maps in the format:
</way>
<way id="148531879">
<nd ref="1616241466"/>
<nd ref="1616241469"/>
<nd ref="1616241471"/>
<nd ref="1616241472"/>
<nd ref="1616241475"/>
<nd ref="1616241479"/>
<nd ref="276928691"/>
<tag k="highway" v="secondary"/>
<tag k="lit" v="no"/>
<tag k="oneway" v="yes"/>
<tag k="ref" v="L 292"/>
</way>
<way id="10870759">
<nd ref="96594201"/>
<nd ref="96594205"/>
<nd ref="96594209"/>
<nd ref="96594224"/>
<tag k="highway" v="residential"/>
<tag k="maxspeed" v="50"/>
<tag k="name" v="Rockwellstraße"/>
<tag k="oneway" v="yes"/>
<tag k="postal_code" v="38518"/>
</way>
<way id="10522831">
<nd ref="90664716"/>
<nd ref="940615687"/>
<nd ref="2222543788"/>
<nd ref="940619729"/>
<nd ref="90664692"/>
<nd ref="939024170"/>
<nd ref="298997463"/>
<tag k="highway" v="residential"/>
<tag k="name" v="Am Allerkanal"/>
<tag k="postal_code" v="38518"/>
<tag k="tracktype" v="grade2"/>
</way>
A single file contains 1000s of similar way ids. I want to store these way ids in a list/tuple, but the problem is that the content in a way id is not fixed.
For example the number of 'nd ref' enteries can be different. I was thinking of storing the way id data into a tuple, and also include a list in each tuple containing nd ref data. Then finally storing all the tuples in a single list. Please suggest whether it is feasible, and will I be able to access all the enteries through looping?