Skip to content
Mkyong.com
Mkyong.com
  • Development Service
  • Spring Boot
  • Java 8
  • Contact

stax

How to write XML file in Java (StAX Writer)

May 5, 2021 by mkyong

This tutorial shows how to use the Streaming API for XML (StAX) writer to write data to an XML file. Table of contents 1. Write to XML (StAX Writer APIs) 2. Write to XML (StAX Cursor API – XMLStreamWriter) 3. Write to XML (StAX Iterator API – XMLEventWriter) 4. Write and pretty print XML content …

Read more

Categories java Tags java xml, stax, write file, write xml, xml parser Leave a comment

How to read XML file in Java (StAX Parser)

July 27, 2022April 28, 2021 by mkyong

This tutorial shows how to use the Streaming API for XML (StAX) parser to read or parse an XML document. Table of contents 1. What is StAX 1.1 Difference between SAX and StAX? 2. StAX Cursor API and Iterator API 2.1 StAX Cursor API 2.2 StAX Iterator API 2.3 which one? Cursor or Iterator APIs? …

Read more

Categories java Tags iterator, java xml, read xml, sax, stax, xml parser 2 Comments

Java XML Tutorial

July 29, 2022April 2, 2010 by mkyong

Java XML Tutorials with full example, including how to read, write and modify the xml file with DOM, SAX and JDOM parsers. And also how to convert object to / from XML via JAXB.

Categories tutorials Tags dom, java xml, jaxb, jdom, read xml, sax, stax, tutorials, write xml, xml, xml parser Leave a comment

Mkyong.com has provided Java and Spring tutorials, guides, and code snippets since 2008. All published articles are simple, easy to understand, and well-tested in our development environment.

Mkyong.com licenses all source code on this website under the MIT License.

Tools
  • Spring Framework
  • Quarkus Framework
  • Micronaut Framework
  • Oracle Java JDK
  • Eclipse Temurin JDK
  • OpenJDK JDK
  • Hibernate ORM
  • Maven Build Tool
  • Gradle Build Tool
  • Tomcat Application Server
  • Docker
Links
  • Spring Guides
  • Docker Hub
  • Maven Central
  • Keep A Changlog
  • Semantic Versioning
  • Hugging Face - Qwen
  • Martin Fowler
About
  • About Us
  • Code License
  • Privacy Policy
  • Terms Of Use
  • Contact Us
© 2026 Mkyong.com - Build with Love.