পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Wednesday, January 25, 2017

Apache Xerces - DOM Parser Overview

The Document Object Model is an official recommendation of the World Wide Web Consortium (W3C). It defines an interface that enables programs to access and update the style, structure,and contents of XML documents. XML parsers that support the DOM implement that interface.

When to use?

You should use a DOM parser when:
  • You need to know a lot about the structure of a document
  • You need to move parts of the document around (you might want to sort certain elements, for example)
  • You need to use the information in the document more than once

What you get?

When you parse an XML document with a DOM parser, you get back a tree structure that contains all of the elements of your document. The DOM provides a variety of functions you can use to examine the contents and structure of the document.

Advantages

The DOM is a common interface for manipulating document structures. One of its design goals is that Java code written for one DOM-compliant parser should run on any other DOM-compliant parser without changes.

DOM interfaces

The DOM defines several Java interfaces. Here are the most common interfaces:
  • Node - The base datatype of the DOM.
  • Element - The vast majority of the objects you'll deal with are Elements.
  • Attr Represents an attribute of an element.
  • Text The actual content of an Element or Attr.
  • Document Represents the entire XML document. A Document object is often referred to as a DOM tree.

Common DOM methods

When you are working with the DOM, there are several methods you'll use often:
  • Document.getDocumentElement() - Returns the root element of the document.
  • Node.getFirstChild() - Returns the first child of a given Node.
  • Node.getLastChild() - Returns the last child of a given Node.
  • Node.getNextSibling() - These methods return the next sibling of a given Node.
  • Node.getPreviousSibling() - These methods return the previous sibling of a given Node.
  • Node.getAttribute(attrName) - For a given Node, returns the attribute with the requested name.

No comments:

Post a Comment