About Java Xmleventreader

Source: Internet
Author: User

Recently I ' m dealing with a source code data mining project, and I has to use XML in it. But something confusing happens to me. So I searched on Google and finally it got clear.

In this project, I use Event Iterator API of streaming API for XML (StaX) to parse the XML files. I found a wonderful tutorial here. It really helped me a lot, thanks Lars.

But there is one thing the tutorial missed. Since Xmleventreader works as streaming, it cannot get all data from a event by only reading once. For example, when the content of a node (data between a start element and an end element) contains &lt; or &gt; (tagged by SAX, ' < ' and ' > ' originally '), by calling event.asCharacters().getData() , only characters before these is fetched. If you want to get them all, a loop should is used here.

About Java Xmleventreader

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.