XML Parser provides a way to access or modify data in an XML document. Java provides several options for parsing XML documents. Below are the different types of parsers that are commonly used for parsing XML documents.
Dom Parser – parses an XML document by loading the entire contents of the document and creating its complete hierarchical tree in memory.
SAX Parser – parses an XML document by event-based triggers. Does not load the full document into memory.
JDOM Analyzer – analyzes XML document similarly to DOM Analyzer, but in a simpler way.
StAX Parser – analyzes XML document similarly to SAX analyzer, but in a more efficient way.
XPath Analyzer – analyzes an XML document based on an expression and is widely used in conjunction with XSLT.
DOM4J Parser – a Java library for analyzing XML, XPath and XSLT using the Java Collections Framework. It provides support for DOM, SAX, and JAXP.
Dom Parser – analyzes an XML document by loading the entire contents of the document and creating its full hierarchical tree in memory.
SAX Parser – parses an XML document by event-based triggers. Does not load the full document into memory.
JDOM Analyzer – analyzes XML document similarly to DOM Analyzer, but in a simpler way.
StAX Parser – analyzes XML document similarly to SAX analyzer, but in a more efficient way.
XPath Analyzer – analyzes an XML document based on an expression and is widely used in conjunction with XSLT.
DOM4J Parser is a Java library for analyzing XML, XPath and XSLT using the Java Collections Framework. It provides support for DOM, SAX and JAXP.
JAXB and XSLT APIs are available to handle XML parsing in an object-oriented manner. We will look at each parser in detail in later chapters of this lesson.