How would I go about storing everything in between the db to a new
custom object?

for example I have a custom object with parameters (name, street,
long, lat)

and at every db tag, I want it to store each element into a variable
and then when it hits the close db tag, the variables can be added to
an arraylist like this  customObjectarraylist.add(new
CustomObject(name,street,long,lat)).
Then when i populate the markers I can just iterate through the
arraylist.

Any help on this would be much appreciated!



On Jun 27, 3:42 pm, chaitanya <[email protected]> wrote:
> How about using the SAXParser ? The SAXParser will throw events for
> start of a tag and end of a tag. Plus it is much more faster than a
> DOM Parser. For every head element i.e. in your case db have a flag
> and store the value in the name tag in either a StringBuilder or a
> custom object which contains information about overlays.
>
> On Jun 27, 10:52 am, Michael <[email protected]> wrote:
>
>
>
> > Hello, on my app I will be reading in from an XML file thats formatted
> > something like this
>
> > <database>
> > <db1>
>
> > <db>
> > <name>name here</name>
> > <street>street here</street>
> > <long> longitude here</long>
> > <lat> latitude here </lat>
> > </db>
>
> > <db>
> > <name> new name here </name>
> > <street> new street here </street>
> > <long> new longitude here </long>
> > <lat> new latitude here </latitude>
> > </db>
>
> > </db1>
> > </database>
>
> > With this information I need to create Overlay Markers on the map
> > (using latitude and longitude) and when they're clicked on I need it
> > to display the name with the address. Depending on the conditions of
> > where the map is, the number of markers will be different so I need a
> > dynamic model for reading in these markers.
>
> > If I were to use Document methods like getElementById(String name)
> > then I couldn't call getElementById("name") because it would likely
> > try to call just the first <name></name> or give an unintended result.
>
> > Any help on this would be much appreciated!
>
> > Michael

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to