Overview of the packages JAXP

Source: Internet
Author: User
Tags xslt

The Sax and Dom APIs are defined by the XML-DEV group and by the W3C, respectively. The libraries that define those APIs are as follows:

    • Javax. xml. parsers: The JAXP APIs, which provide a common interface for different vendors 'sax and Dom parsers.

    • Org. W3C. Dom: DefinesDocumentClass (a DOM) as well as classes for all the components of a Dom.

    • Org. xml. Sax: Defines the basic sax APIs.

    • Javax. xml. Transform: Defines the XSLT APIs that let you transform XML into other forms.

    • Javax. xml. Stream: Provides Stax-specific transformation APIs.

The Simple API for XML (SAX) is the event-driven, serial-access mechanic that does element-by-Element Processing. the API for this level reads and writes XML to a data repository or the web. for server-side and high-performance applications, you will want to fully understand this level. but for every applications, a minimal understanding will suffice.

The dom api is generally an easier API to use. it provides a familiar tree structure of objects. you can use the dom api to manipulate the hierarchy of application objects it encapsulates. the dom api is ideal for interactive applications because the entire object model is present in memory, where it can be accessed and manipulated by the user.

On the other hand, constructing the DOM requires reading the entire XML structure and holding the object tree in memory, so it is much more CPU-and memory-intensive. for that reason, the sax API tends to be preferred for server-side applications and data filters that do not require an in-memory representation of the data.

The XSLT APIs defined inJavax. xml. TransformLet you write XML data to a file or convert it into other forms. as shown in the XSLT section of this tutorial, you can even use it in conjunction with the sax APIs to convert legacy data to XML.

Finally, the Stax APIs defined inJavax. xml. StreamProvide a streaming Java technology-based, event-driven, pull-parsing API for reading and writing XML documents. Stax offers a simpler programming model than Sax and more efficient memory management than Dom.

Overview of the packages JAXP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.