Why should I use JSON over XML ?

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , , , , , with Leave a comment on Why should I use JSON over XML ?

Why should I use JSON over XML ? Why JSON is given so importance these days ?

Many questions like these are asked many times by new developers. So, I decided to write this article. However last year I presented same topic and uploaded in SlideShare.

Before Winter12 release, for JSON related stuff we had to depend on external Libraries. However in Winter12, salesforce has added support for JSON natively on force.com plateform.  Also, on every release Salesforce is making required changes in JSON library to make it more stable and more usable. I have shared many topics on JSON in past, on which you can have a look. Continue reading “Why should I use JSON over XML ?”

Create SOAP message using Java

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , , with Leave a comment on Create SOAP message using Java

Step by Step Example of creating SOAP Message using core Java API

In this article, i am going to create the SOAP Message by using core Java Only. SOAP Stands for ” Simple Object Access Protocol”, which is used to exchange the structured information via Webservices.

SOAP Message consist of following three parts:

  1. SOAP-ENV:Envelope
  2. SOAP-ENV:Header
  3. SOAP-ENV:Body
SOAP Message Format for Web Services
SOAP Message Format for Web Services

Continue reading “Create SOAP message using Java”

Validate XML Schema Using DOM Parser and SAX Parser in JAVA Using Swing

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with 3 Comments on Validate XML Schema Using DOM Parser and SAX Parser in JAVA Using Swing

Validate XML Schema Using DOM Parser and SAX Parser in JAVA Using Swing

In this article, i am going to use the Swing for the UI purpose and for the XML validation against its schema i will use DOM parser as well as SAX Parser. previously we have already seen that how these parsers works in detail.

Application output will look like below snap:

Input Screen - XML Schema Validation in JAVA Using DOM and SAX Parser
Input Screen - XML Schema Validation in JAVA Using DOM and SAX Parser

Continue reading “Validate XML Schema Using DOM Parser and SAX Parser in JAVA Using Swing”

Difference between SAX and DOM Parsers

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with Leave a comment on Difference between SAX and DOM Parsers

What is the difference between SAX And DOM Parsers

In Previous articles we have discussed about JAXP in detail.

To summarize all, lets discuss difference between both approach.

Continue reading “Difference between SAX and DOM Parsers”

XML Tree Viewer using SAX Parser in JAVA with Jtree,JFileChooser component of Swing

XML Tree Viewer using SAX Parser in JAVA with Jtree,JFileChooser component of Swing, How to refresh Jtree when content changes , Expand or collapse JTree

I am going to create a utility application in JAVA for reading the XML document using SAX parser. The application will look like:

XML Tree Viewer using SAX Parser in JAVA
XML Tree Viewer using SAX Parser in JAVA

Continue reading “XML Tree Viewer using SAX Parser in JAVA with Jtree,JFileChooser component of Swing”

Read XML File using SAX Parser in JAVA

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with 1 Comment on Read XML File using SAX Parser in JAVA

Example of Reading XML File using SAX Parser in JAVA

We have already discussed about the DOM Parser of JAXP. This article will focus on Reading XML file using SAX Parser:

SAX Parser
SAX Parser

Continue reading “Read XML File using SAX Parser in JAVA”

Searching XML File using DOM Parser of JAXP

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with Leave a comment on Searching XML File using DOM Parser of JAXP

Example of Searching XML File using DOM Parser of JAXP

Until now, we have already seen two examples of DOM Parser provided by JAXP:

  1. Create XML file using DOM
  2. Traverse xml file

In this tutorial, we will learn how to search the XML file for particular node in DOM Parser

Continue reading “Searching XML File using DOM Parser of JAXP”

Traverse XML file using DOM Parser of JAXP

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with 1 Comment on Traverse XML file using DOM Parser of JAXP

Example of Traverse XML file using DOM Parser of JAXP

Check this post to get the idea about how to create XML document using DOM Parser and XSLT API.

In DOM Parser of JAXP, textContent() method of node does not give the text for that node. We must typecast the node to Element and then try this method.

See below code for implementation: Continue reading “Traverse XML file using DOM Parser of JAXP”

Create XML File using DOM Parser of JAXP and Transformation APIs

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , , , with 3 Comments on Create XML File using DOM Parser of JAXP and Transformation APIs

Example of Creating XML File using JAXP and Transformation APIs

We have already studied about :

  1. What is DOM and its structure
  2. JAXP for DOM Parsers

We will create a XML file using DOM parser and Transformation APIs in this article. Continue reading “Create XML File using DOM Parser of JAXP and Transformation APIs”