Java: XML Integration

0
Join & Subscribe
LinkedIn Learning
Free Trial Available
English
Certificate Available
4-5 hours worth of material
selfpaced

Overview

Learn how to create and parse XML with a variety of Java APIs and libraries, including DOM, SAX, JAXB, and more.

Learn how to choose the right Java API for your application and get started coding with XML and Java. In this course, author David Gassner shows you how to read and create XML strings and files, decide whether to use a streaming or tree-based API, and find out which APIs are compatible with Android. Plus, discover how to use both standard APIs that are included with the Java SE and EE distributions, such as DOM, SAX, and JAXB, and learn about popular open-source libraries such as JDOM and the Simple XML Serialization framework.

Syllabus

Introduction
  • Welcome
  • What you should know
  • Using the exercise files
1. Getting Started
  • Reviewing XML terminology
  • Choosing an XML processing API
  • Exploring the sample data provider project
  • Reading XML as a string
2. Parsing XML with SAX (Simple API for XML)
  • How SAX works
  • Creating a SAX event handler class
  • Tracking XML elements in SAX handlers
  • Capturing text values in SAX handlers
  • Handling namespace strings and prefixes with SAX
  • Handling parsing errors in SAX
3. Creating and Parsing XML with Document Object Model
  • How DOM works
  • Creating a DOM document
  • Adding child elements with DOM
  • Adding data elements and attributes with DOM
  • Wrapping text in CDATA sections with DOM
  • Serializing a DOM document to a string
  • Serializing a DOM document to a file
  • Reading an XML file with DocumentBuilder
  • Getting data from XML with DOM
  • Handling XML namespaces and prefixes with DOM
  • Searching a DOM object tree with XPath
4. Creating and Parsing XML with JDOM
  • How JDOM works
  • Creating an XML document with JDOM
  • Adding data to an XML document with JDOM
  • Wrapping text in CDATA sections with JDOM
  • Outputting an XML file with JDOM
  • Parsing an XML file with JDOM
  • Getting data from XML with JDOM
  • Searching a JDOM document with XPath
5. Creating and Parsing XML with StAX
  • How StAX works
  • Exporting data with XMLStreamWriter
  • Creating an XML string with XMLStreamWriter
  • Formatting documents with StAX utility classes
  • Outputting an XML file with XMLStreamWriter
  • Parsing an XML file with XMLStreamReader
  • Getting data from XML with XMLStreamReader
  • Parsing an XML file with XMLEventReader
  • Parsing XML in Android with XmlPullParser
6. Creating and Parsing XML with JAXB
  • Comparing XML binding with other programming models
  • Annotating POJO classes for use with JAXB
  • Creating XML from annotated classes with JAXB
  • Parsing XML with JAXB and annotated classes
7. Creating and Parsing with Simple XML Serialization
  • Comparing Simple to JAXB
  • Annotating POJO classes for use with Simple
  • Creating XML from annotated classes with Simple
  • Parsing XML with Simple and annotated classes
Conclusion
  • Next steps

Taught by

David Gassner