M
M
MdaUZH2016-08-19 16:26:35
Android
MdaUZH, 2016-08-19 16:26:35

How to parse xml correctly?

Hello everyone, I have an xml document of the form:

<data>
    <moto>
        <color>white</color>
        <speed>280</speed>
        <type>0</type>
    </moto>
    <moto>
        <color>yellow</color>
        <speed>240</speed>
        <type>1</type>
    </moto>
</data>

How to parse it normally?
to get the name of the tag and what is in it, only those that are inside the tag
for 2 hours I conjure with XML Pull Parser, I can’t figure out how to immediately get both the tag name and its value ...
it turns out either one or the other, and not always connected with each other.
I need this in order to fill in the database from the xml document
Please tell me, something is not at all cooked by the head

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question