The streaming API for XML has two architectures for…parsing the XML, the Stream Reader and the Events Reader.…I'll start with the Stream Reader, which uses…a single loop pulling data from the XML file.…In this project, StaX Read With Stream, I have a beginning main class…named, Read XML With Stax Stream. In its main method, I'm creating…an instance of my StAX stream reader class.…This class has a get data from XML method, which receives…a name of a file and returns a list of customer objects.…
This is the same customer class that I've been using in other parts of this course.…And it's a part of the data provider project that's connected to this project.…To get started, I'll create a few objects.…I'm going to create an instance of the standard Java input stream interface.…And then I'll use two classes that are a part…of StAX, named XML Input Factory and XML Stream Reader.…I'll start with the InputStream.…I'll declare an instance of this interface, and I'll name it in.…
And I'll instantiate it by creating the concrete class, FileInputStream.…
Author
Released
11/8/2013- Choosing a Java-based XML API
- Reading XML as a string
- Comparing streaming and tree-based APIs
- Parsing XML with SAX
- Creating and reading XML with DOM
- Adding data to an XML document with JDOM
- Reading and writing XML with StAX
- Working with JAXB and annotated classes
- Comparing Simple XML Serialization to JAXB
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome55s
-
What you should know1m 43s
-
Using the exercise files4m 48s
-
-
1. Getting Started
-
Reviewing XML terminology9m 56s
-
Reading XML as a string5m 42s
-
-
2. Parsing XML with SAX (Simple API for XML)
-
How SAX works6m 7s
-
-
3. Creating and Parsing XML with Document Object Model
-
How DOM works7m 56s
-
Creating a DOM document8m 5s
-
-
4. Creating and Parsing XML with JDOM
-
How JDOM works5m 52s
-
-
5. Creating and Parsing XML with StAX
-
How StAX works6m 11s
-
-
6. Creating and Parsing XML with JAXB
-
7. Creating and Parsing with Simple XML Serialization
-
Comparing Simple to JAXB3m 59s
-
-
Conclusion
-
Next steps1m 7s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Getting data from XML with XMLStreamReader