Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

5 Minute Tutorial for StaxMate

StaxMate is designed to be used for 2 main tasks:

  • Reading XML content efficiently, correctly and conveniently
  • Writing XML content efficiently, correctly and conveniently

Let's have a look at sample use cases to get an introduction of how StaxMate is typically used.

Writing XML content

Let's start with the use case that is probably simplest of the two: that of writing (aka generating) XML content. Content can come from variety of sources; here we consider the case where we just want to write explicit content (another common case would be to write content read earlier, but let's reserve that for an advanced example).

The first step we need to do is to create a StaxMate output factory:

Factory is completely reusable and thread-safe, so we will keep a reference to it.
The next step is to create the main-level output factory


Reading XML content

The first step on input side is similar to output side: that of creating the necessary StaxMate factory:


  • No labels