Introduction to JAXP and Difference between JAXP and JAXB

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , , , with 3 Comments on Introduction to JAXP and Difference between JAXP and JAXB

Introduction to JAXP (JAVA API for XML Processing), SAX (Simple API for XML Parsing),Extensible Style sheet language transformation (XSLT)

Previous article was about the introduction to DOM. in this article i will focus on concept of handling XML data using DOM Parser in JAXP.

The Java API for XML Processing (JAXP) is for processing XML data using applications written in the Java programming language. JAXP leverages the parser standards Simple API for XML Parsing (SAX) and Document Object Model (DOM) so that you can choose to parse your data as a stream of events or to build an object representation of it. JAXP also supports the Extensible Stylesheet Language Transformations (XSLT) standard, giving you control over the presentation of the data and enabling you to convert the data to other XML documents or to other formats, such as HTML.

XML Processing in JAVA using DOM :
The Document Object Model (DOM) is a set of interfaces defined by the W3C DOM Working Group. It describes facilities for a programmatic representation of a parsed XML (or HTML) document.

XML Processing using DOM in JAXP
XML Processing using DOM in JAXP

Continue reading “Introduction to JAXP and Difference between JAXP and JAXB”

DOM – Document Object Module

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with 3 Comments on DOM – Document Object Module

What is DOM in JAVA. DOM stands for Document Object Module

According to the DOM, everything in an XML document is a node.
The DOM says:

  • The entire document is a document node
  • Every XML element is an element node
  • The text in the XML elements are text nodes
  • Every attribute is an attribute node
  • Comments are comment nodes

Continue reading “DOM – Document Object Module”

XML Parsing Error: no element found

Author posted by Jitendra on Posted on under category Categories ASP.NET, Tech Tips and tagged as Tags , with 3 Comments on XML Parsing Error: no element found

Few Days ago, i found strange error like “XML Parsing Error: no element found“.

I was unable to find the exact root cause. Most of the times it happens if you are missing any closing tag in your ASPZ application. I checked my complete page and reconfirmed but error still persist.

somehow i found that ASP.NET treat the response of page as XML document and that’s why we receive XML Parsing Error: no element found error.

so explicitly i set the response type of my page as text/HTML. Response.ContentType = “text/HTML”.

And this line tells the ASPX that page is HTML, not XML.