bubblebath
bubblebath

Reputation: 999

XMLStreamReader skips element with no attribute

I have an XMLStreamReader and when I go thorough the xml it skips one element and goes to the next. I would like to read everything in order so this for me is very annoying and ruins my parsing.

This is the XML:

    <bar>Chaps        
        <drink>
            <search>
                    <containgLetter>ri</containgLetter>
            </search>
        </drink>
    <bar>

This is the what i get the order of the tags

What I want is

I want to know how to read the tag search and make sure that its included

Upvotes: 1

Views: 629

Answers (1)

jtahlborn
jtahlborn

Reputation: 53694

My guess would be that you are attempting to process the text content of the elements and are inadvertently swallowing the start element event for the search element. (of course, since you've included no code, that's just a guess).

Upvotes: 1

Related Questions