JDOM

from Wikipedia, the free encyclopedia
JDOM
Basic data

developer Jason Hunter, Rolf Lear
Current  version 2.0.6
(February 15, 2015)
operating system Cross-platform
programming language Java
category XML
License Open source (similar to the Apache license)
German speaking No
jdom.org (EN)

JDOM is a Java library for manipulating XML data. It is an alternative and supplement to the official Java API, was developed by Jason Hunter and Brett McLaughlin and is now an implemented API for working with XML in Java. For trademark reasons, it is not an acronym . JDOM integrates the advantages and APIs of SAX and DOM in one Java class.

Similar to the Document Object Model (abbr. DOM), an XML document is represented as a tree in the main memory, but JDOM was specially developed for Java. This is why Java classes are used - for example, in JDOM an XML node is not represented as a "node", but rather by a specific Java class.

JDOM offers the option of outputting the JDOM tree as a text document ("XMLOutputter", ie as an XML document), which is not part of the SAX standard and up to and including level 2 is not part of the DOM either. Furthermore, the the "SAXOutputter" can output the document in the form of SAX events as the parsing would be generated by the document SAX or convert the JDOM tree in a DOM tree ( "DOM Outputter").

JDOM classes

Document

This is the root object (and thus the entry point for navigation) of the JDOM tree, which contains the root element, the document type and processing instructions.

element

This class represents the information for elements (for example the parent element ("parent"), the element name ("name") and a list of the attributes ("attributes")).

Comment

Comments ("text") with the element containing the comment ("parent").

CDATA

Compiler-specific data.

Namespace

To be able to define namespaces for elements and attributes.

DocType

Holds the DocType declaration for the head of the XML data.

text

Character based content.

Other Java DOM implementations

  • dom4j is a versatile programming interface that provides an extended and extensive set of processing functions.
  • XOM (XML Object Model) is a fast programming interface that requires little memory.
  • Apache Crimson is a DOM parser from the Apache Software Foundation

See also

  • JAXP - Java API for XML Processing

literature

Web links

  1. The p_15424 Open Source Project on Open Hub: Languages ​​Page . In: Open Hub . (accessed on September 21, 2018).