Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. dom

Tag: dom

j
java March 29, 2022 by mkyong 2 comments

Java – Convert String to XML

This article shows how to convert a String to an XML document and an XML document back to a String in Java, using DOM parser and JDOM2 parser. 1. Convert String to XML (DOM Parser) 2. Convert String to XML (JDOM2 Parser) 3. Download Source Code 4. References 1. Convert String to XML (DOM Parser) […]

Read more Java – Convert String to XML
j
java February 16, 2021 by mkyong 1 comment

Pretty Print XML with Java Dom and XSLT

This article shows how to use Java DOM Parser + XSLT to format or pretty print a XML document. Table of contents 1. An XML file 2. Pretty Print XML via Transformer 3. Pretty Print XML via XSLT 4. Download Source Code 5. References P.S Tested with Java 11 1. An XML file staff-simple.xml <?xml […]

Read more Pretty Print XML with Java Dom and XSLT
j
java January 16, 2021 by mkyong 2 comments

Java DOM Parser XML and XSLT examples

With XSLT(Extensible Stylesheet Language Transformations), we can transform XML documents into other formats such as HTML. Table of contents 1. DOM Parser and Transformer 2. DOM example: XML + XSLT = HTML format 3. Download Source Code 4. References P.S Tested with Java 11 1. DOM Parser and Transformer We can use the TransformerFactory to […]

Read more Java DOM Parser XML and XSLT examples
java xml tutorials
java May 15, 2013 by mkyong 1 comment

How to count the depth of XML document (DOM Parser)

In the DOM parser, we can use a recursive loop of the child nodes to find or count the depth of the XML document. Table of contents 1. An XML file 2. DOM Parser + Recursive Loop 3. DOM Parser + Tree Walker 4. Download Source Code 5. References P.S Tested with Java 11. Note […]

Read more How to count the depth of XML document (DOM Parser)
j
java August 4, 2011 by mkyong 10 comments

How to modify XML file in Java – (DOM Parser)

This tutorial shows how to use the Java built-in DOM Parser to modify an XML file. Table of contents 1. The XML file, before and after 2. Dom Parser modify XML file 3. Download Source Code 4. References P.S Tested with Java 11. Note Please read DOM parse XML and DOM write XML. 1. The […]

Read more How to modify XML file in Java – (DOM Parser)
j
java August 4, 2011 by mkyong 2 comments

How to count XML elements in Java

This article shows how to use DOM parser, SAX parser, and XPath to count the number of a specified XML element in Java. Table of contents 1. An XML file 2. Count the XML elements (DOM Parser) 3. Count the XML elements (XPath) 4. Count the XML elements (SAX Parser) 5. Download Source Code 6. […]

Read more How to count XML elements in Java
j
java August 23, 2010 by mkyong 1 comment

Java – Convert XML to a properties file

This article shows how to convert an XML file to a properties file. Table of contents 1. Properties – Convert XML file to a properties file 2. DOM – Convert XML file to a properties file 3. Download Source Code 4. References P.S Tested with Java 11. 1. Properties – Convert XML file to a […]

Read more Java – Convert XML to a properties file
java xml tutorials
tutorials April 2, 2010 by mkyong 0 comments

Java XML Tutorial

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.

Read more Java XML Tutorial
j
java April 2, 2010 by mkyong 8 comments

How to write XML file in Java – (DOM Parser)

This tutorial shows how to use the Java built-in DOM APIs to write data to an XML file. Table of contents 1. Write XML to a file 2. Pretty Print XML 3. Write XML elements, attributes, comments CDATA, etc 4. DOM FAQs 4.1 How to disable the XML declaration? 4.2 How to change the XML […]

Read more How to write XML file in Java – (DOM Parser)
j
java December 6, 2008 by mkyong 18 comments

How to read XML file in Java – (DOM Parser)

This tutorial will show you how to use the Java built-in DOM parser to read an XML file. 1. What is Document Object Model (DOM) 2. Read or Parse a XML file 3. Read or Parse XML file (Unicode) 4. Parse Alexa API XML Response 5. Download Source Code 6. References Note The DOM Parser […]

Read more How to read XML file in Java – (DOM Parser)

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.

About
  • About Us
  • Code License
  • Privacy Policy
  • Terms Of Use
  • Contact Us
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
  • Maven Central
  • Docker Hub
  • Spring Guides
  • Quarkus Guides
  • Micronaut Guides
  • Martin Fowler
  • AskPython

© 2026 mkyong.com — Powered by WordPress

RSS