0 Replies Latest reply on Aug 30, 2010 10:13 AM by 807580

    Parsing XML using Stax (Element vs Text)


      We were trying to use Stax parser (Stream reader) to parse an XML file.

      Please consider the following XML file:

      By using streaming API, I need to distinguish between 'MyElem' and 'Name' and 'Data'
      I mean, I need to get the data like Element = 2 (Because MyElem appeared twice) and Text = 4 (Because 'Name' x 2, and 'Data' x 2)

      How can I distinguish between element (which doesn't contain text) and text (Name, Data)
      When I say getText it is returning '\n\t' etc. for element also. Which confuses. Is there any way to suppress this.

      Thank you in anticipation.
      Best Regards,