What's the relationship between Jaxp and dom4j?

Source: Internet
Author: User
Tags interface net first row xml parser
Dom
JAXP is a specification that is proposed by sun to define how to parse and transform an interface to an XML document, which has reached 1.3 in the current version, and the parser and converter can be changed in a variety of ways, depending on the resolution transformation vendor independence. This is, in itself, a boon for application development. But the current use of JAXP at home is not as widespread as it might be, and it is due to a certain market reason (the need for support for different versions of the JVM).

Now more applications using DOM4J and Jdom, the operation of the interface is more simple.

Personally, dom4j (Jdom) is not strictly an XML parser, and the bottom line is a concrete implementation that conforms to the JAXP specification, and DOM4J's documentation shows that you can work with JAXP to use a parser and converter that JAXP has already config.

In Dom4j's latest release 1.5.2, due to licensing issues, the internal process of implementing the parser Aelfred2 is more dependent on the underlying Crimson.jar or Xerces.jar, both of which follow the JAXP specification.

The specific knowledge is still under study.

A discussion of this with www.JavaGarden.net:

.--------------------------------------------------------------------.| Session start:2005 Year April 6                                              | | participants:                                                         | |     (SN) Afor (toafu@msn.com)                                            | |     ..... April 18, Einstein's 50 Anniversary Memorial Day (IP) www. Javagarden.net (turbochen@163.com) |. --------------------------------------------------------------------. [16:39:28] (SN) Afor:           http://blog.csdn.net/toafu/ ARCHIVE/2005/04/06/338337.ASPX[16:39:34] (SN) Afor: I understand, right? [16:41:57] Turbo, A bea:good[16:42:52] (SN) Afor:           But how can I find out how it is associated with JAXP when I use dom4j directly? When there are two in the classpath. [16:46:18] Turbo, a BEA:JAXP not have a few factory, that is, from the beginning. [16:47:06] (SN) Afor: But I did not see what dom4j to do with these few factory? [16:48:24] Turbo, a BEA: I remember seeing it on one of the articles, like starting with factory, passing in a class or something like that .            the specific method of what you have to check. [16:49:08] (SN) Afor: Is it related to dom4j? [16:49:41] Turbo, A bea: You should remember how the JDBC driver was loaded, similar to the principle. [16:50:37] (SN) Afor: In order to find a few paths under the loading of the class [16:51:23] Turbo, A bea: No, is Drivermanager.forname ("classname");            a similar way. [16:51:32] (SN) Afor: to [16:53:52] (SN) Afor:  &NBsp;         It is not understood that DOM4J is an implementation that does not comply with the JAXP specification, the same as the XML parser that follows the JAXP specification simply because the DOM4            J offers a very simple interface for wide application [16:55:49] Turbo, A bea: I think it's dom4j. Follow the JAXP specification and extend it to make the API easier to use.            I didn't actually use dom4j, but I know it works a lot better than the JAXP DOM API .            I developed a full use of JAXP DOM API before, and it's verbose to take an element code. [16:56:40] Turbo, a BEA: and Jdom is the cut-end failure to comply with the JAXP specification [16:56:52] Turbo, a BEA: not easy to transplant. [16:57:14] (SN) Afor:           good. What I want to know is that if both the dom4j and Jaxp APIs are classpath, if you can implement the Jaxp interface directly, the bottom          What does the    layer achieve with dom4j? [17:00:08] Turbo, A Bea:how does dom4j relate to DOM?            DOM is a quite large language independent API. DOM4J is a           simpler, lightweight API which is OPtimised for the java           making extensive use of the Java 2 plat Form such as the           Java 2 collections.                        Though dom4j fully supports the DOM standard allowing both            APIs to be used easily together. [17:00:19] Turbo, a BEA: The above section is the content of the DOM4J FAQ [17:00:57] Turbo, a bea:dom4j fully supports the DOM standard            allowing both APIs to be used easily together. [17:01:07] Turbo, A BEA: The most critical of this sentence [17:01:52] (SN) Afor: Not quite sure what it means [17:02:28] (SN) Afor: What does both mean? [17:02:49] Turbo, a bea: Should mean dom4j and dom[17:03:05] Turbo, a bea:together proves this [17:03:10] (SN) Afor: Oh? [17:04:53] Turbo, a bea: Look at this again: dom4j works and any SAX parser Via           JAXP. [17:05:37] (SN) Afor: Well, I'd like to know how it work with, or how we fused dom4j and jaxp[17:05:40] Turbo, when we wrote in the code, A bea: This means that as long as it is a sax that conforms to the JAXP specification Parser can be used as dom4j sax           parser. [17:07:00] (SN) Afor: That's right. [17:08:04] (SN) Afor: That means dom4j and JAXP are tied, but dom4j is not a norm, is it? [17:08:58] Turbo, a bea: I think Jaxp is the norm, And dom4j is the extension of the specification. [17:09:35] (SN) Afor: While Xerces is the implementation of the specification [17:09:55] Turbo, a bea: Yes. [17:10:21] (SN) Afor: is JAXP not directly supporting XPath, so ease of use is less than dom4j[ 17:10:35] Turbo, a BEA: In fact, the initial implementation of JAXP was donated by Apache, [17:10:47] (SN) Afor: So the XML parser is Apache's [17:10:59] Turbo, a BEA: It's not fully implemented XPat h, I do not know how the implementation of JAVA5. [17:11:10] Turbo, a bea: Yes. [17:11:29] (SN) Afor: New 1.3 support JAVA5, hehe [17:11:36] (SN) Afor: OK, thanks for the advice [17:13:40] Turbo, a BEA: &NB sp;         http://www.pconline.com.cn/pcedu/empolder/wz/xml/0412/50976            2_1.html[17:13:52] Turbo, a BEA: This article can be seen, but not all the letter. [17:14:04] (SN) Afor: ok,3ks[17:17:50] Turbo, A bea:           http://www.54bk.com/more.asp?name=captain&id= 1887           This article will see how they relate. [17:19:36] (SN) Afor: dom4j Application- > dom4j API-> xerces/crimson parser            dom4j application-> dom4j API-> Alfred2 parser [17:20:01] (SN) Afor: dom4j defaults to the first row of parsers [17:20:09] Turbo, a bea:apache's Xerces/crimson parser is the core, [ 17:20:15] (SN) Afor: Well [17:20:24] Turbo, a BEA: All other types of APIs use these parsers. [17:20:34] (SN) Afor: Alfred2 has removed [Afor] Turbo, a bea in dom4j[17:20:44] (SN) 1.5.2:17:20:56: Yes [17:22:12] (SN) Afor            so there is no specification and implementation relationship between JAXP and dom4j, DOM4J uses the Apache parser, which implements the JAXP specification, to parse the xm           L document. [17:22:24] (SN) Afor: The sensory contours are becoming clearer [17:22:36] Turbo, a BEA: While JAXP defines interfaces, including Dom and sax interfaces. [17:22:54] Turbo, a bea: Then JAXP also has its own DOM and sax implementations. [17:23:16] (SN) Afor: That is JAXP ri[17:24:07] (SN) Afor: It was made by sun. Sun defines the JAXP specification, and then implements its own set of APIs, and the parser uses Apache's [17:24:45] (SN) Afor: dom4j is an API that is not compliant with the JAXP specification, and the parser is also in Apache [17:25:42] ( SN) Afor:           dom4j Document Description: When Jaxp's jar is in the classpath, The parser used by DOM4J is selected according to the JAXP configuration. [17:27:09] Turbo, A bea: So ' work with JAXP ' means parser that conform to the JAXP specification. [17:28:09] (SN) Afor: Yes, work with XML parsers obeying 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.