Questions tagged [jdom]

JDOM is an open source library for working with a Java representation of an XML document. JDOM provides a way to represent that document for easy and efficient reading, manipulation, and writing. It has a straightforward API, is a lightweight and fast, and is optimized for the Java programmer.

JDOM is an open source library (hosted on gitub) for working with a Java representation of an XML document. JDOM provides a way to represent that document for easy and efficient reading, manipulation, and writing.

The major features of JDOM that make it easier to use are:

  • it has a straightforward API
  • it is lightweight and fast (relative to other in-memory models)
  • the in-memory model of the document is always well-formed.
  • it is optimized for the Java programmer.
    • It uses standard Java collection structures instead of some other form of containers
    • All Collections are correctly typed using Java Generics
    • It provides simple and high-performance access to XML Parsers and 'outputters'
    • it integrates well with data that is read from, or written to SAX, DOM, and StAX API's

While SAX (and sometimes DOM and StAX) can be used to build JDOM documents, the JDOM API is not like those. Still, JDOM is able to interface well with programs that expect SAX, StAX, or DOM input, or expect JDOM to provide such output.

JDOM is not a wrapper for the W3C's DOM, or another version of DOM. JDOM is a Java-based "document object model" for XML files. JDOM serves the same purpose as DOM, but is easier to use.

JDOM is not an XML parser (like Xerces). It is a document object model that uses XML parsers to build documents. JDOM's SAXBuilder class for example uses the SAX events generated by an XML parser to build a JDOM tree. The default XML parser used by JDOM is the JAXP-selected parser, but JDOM can use nearly any parser.

JDOM 2.0.0 was released in 2012 and introduced full support for Java Generics and an improved XPath interface as well as many other features.

JDOM 1.1.3 is still supported and even runs on Java 1.1.2

485 questions
-1
votes
2 answers

Jdom parser not recognizing special character attributes

problem in parsing special character attributes using jdom ex < tag xml:lang="123" > this case getAttributes() method return null is there any solution to fix this.
Aswan
  • 5,085
  • 10
  • 46
  • 70
-2
votes
1 answer

Null pointer exception in an XML parsing story system with a java based combat system and a nimbus GUI

I currently have two halves of a video game; a storyboard system that reads in a scene from an XML file then displays a description of the scene and a list of choices that the player interacts with, and a combat system that works in a similar way…
SteZer0
  • 1
  • 3
-2
votes
1 answer

Convert xml to JSON in java servlet

I have to call a perl script from a java servlet which returns an xml file. Then the java servlet converts the xml to json using jdom. So far, I've been successful in getting the xml. I tried a lot in vain to create the json using jdom. Any help…
Trozan
  • 89
  • 2
  • 11
-3
votes
1 answer

How to parse an Xml which contains the field with an new line using java parsers

How to parse an Xml which contains the field with an new line as it is using java parsers. https://nithesh/testing dfsgndfisfgsdgsdgsfggsfgsdfgs rfk/ffsgsdgfdssg32afaaaaffasa …
Nithesh
  • 31
  • 8
-3
votes
3 answers

Include external Library like JDOM in a JAR file

Possible Duplicate: Easiest way to merge a release into one jar-file I made a simple project with 4 classes. It uses the JDOM library and I included it in my classpath. When i make a JAR File, putting in 4 classes and a manifest, I get this…
REmaxer
  • 1
  • 3
1 2 3
32
33