Home » Document

Tag Archives: Document

JAX-WS Web Service Example

In this example we shall learn implementing JAX-WS Web Service. JAX-WS are the API’s provided by Java for implementing Web Service. Here, we shall start by learning what web services are, their architecture, followed by implementation of server and client. We shall also learn the different variants of XML Web Service and the WSDL file which is the contract that ...

Read More »

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 »

Count XML Elements in Java using DOM parser example

In this example we are going to see how to count elements with specific tag names using a DOM parser in Java. Basically all you have to do in order to count elements in an XML elements is: Open and parse an XML Document using a DocumentBuilder Use Document.getElementsByTagName that will return a list with nodes. Simply print out the ...

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 »