Home » Element

Tag Archives: Element

Create XML File in Java using JDOM parser example

In this tutorial we are going to see how to create an XML File in Java using JDOM parser. If you’ve read the previous tutorial on JDOM parser about modifying an XML File you might have a very clear aspect on what this tutorial is all about. Basically we are going to create a root Element and some new child ...

Read More »

Modify XML File in Java using JDOM parser example

In the previous tutorial we show how to read an XML File using JDOM parser. In this tutorial we are going to see how to modify the contents of an XML File.                     This is the XML File we are going to use for the demonstration. testFile.xml: <?xml version="1.0" encoding="UTF-8" standalone="no"?><company> ...

Read More »

Create XML File in Java using DOM parser example

In this tutorial we are going to see how to create XML File in Java using DOM parser. The basic idea is very simple. You construct the DOM object with the tree structure you want in the memory, and then you use a Transformer and a StreamResult in order to write the DOM object to a stream, in our case ...

Read More »

Modify XML File in Java using DOM parser example

With this tutorial we shall show you you can read and modify the contents of an XML File using a DOM parser. The basic idea is pretty straight forward. You read the XML File and use a DOM parser to parse it and construct the DOM object in the memory. Then you can just select any item you want from ...

Read More »

Read XML File in Java using DOM parser example

In this tutorial we are going to see how to use the built in Java DOM parser in order to parse an XML file into a DOM Object As you might know, the DOM object has the classic Tree Structure with nodes, elements, attributes etc… Remember that DOM parser reads the XML file and constructs the DOM object in the ...

Read More »