DOM4J Introduction and code example

Source: Internet
Author: User
Tags cdata xml cdata xpath

DOM4J is an open source XML parsing package produced by dom4j.org. DOM4J is an easy-to-use, open Source Library for Xml,xpath and XSLT. It is applied to the Java platform, with a Java collection framework and full support for Dom,sax and JAXP.

DOM4J Download jar Package: Http://downloads.sourceforge.net/dom4j/dom4j-1.6.1.jar

Jaxen (Support for XPath): Http://dist.codehaus.org/jaxen/distributions/jaxen-1.1.1.zip

1.DOM4J Main interface

The DOM4J main interface is defined in the ORG.DOM4J package.

-node defines polymorphic behavior for all XML nodes in the dom4j;

-branch defines a public behavior for nodes that can contain child nodes such as XML elements (element) and documents (docuemnts);

|-element defines XML elements;

|-document defines the XML document;

-documenttype defines the XML DOCTYPE declaration;

-entity defines XML entity;

-attribute defines the attributes of XML;

-processinginstruction defines XML processing instructions;

-characterdata is an identification excuse for identifying character-based nodes. such as Cdata,comment, Text;

|-CDATA Defines an XML CDATA region;

|-text defines an XML text node;

|-Comment defines the behavior of XML annotations;

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.