SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

JDOM / NOTES</>↗
JDOM26 May 2009

How do I get XML element’s text content in JDOM?

package org.kodejava.jdom; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; import java.io.IOException; import java.io.StringReader; public class JDOMElementTextContent { public static void main(String[] args) { String xml = """ <root> <paragraph> Lorem ipsum dolor sit amet, consectetur adipisicing \ elit, sed do eiusmod tempor incididunt ut labore et \ dolore magna aliqua. Ut enim ad minim […]

Wayan · 2 min read
JDOM / NOTES</>↗
JDOM23 May 2009

How do I get XML attribute as an integer value in JDOM?

In this example you can see how we can read xml attribute value as an integer value instead of string. JDOM provides method such as getIntValue(), getLongValue(), getFloatValue(), getDoubleValue() to get numerical values. For boolean value we can use the getBooleanValue() method. package org.kodejava.jdom; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; import java.io.IOException; import […]

Wayan · 1 min read
JDOM / NOTES</>↗
JDOM21 May 2009

How do I add and remove elements from XML document in JDOM?

The List returned by the getChildren() method call is a java.util.List. Any modification to the List object immediately reflected in the backing document. This make the manipulation of the XML document easy. You can also see how we can add a new Element to the document by calling the addContent() method. package org.kodejava.jdom; import org.jdom2.Document; […]

Wayan · 3 min read
JDOM / NOTES</>↗
JDOM18 May 2009

How do I navigate the XML elements tree in JDOM?

package org.kodejava.jdom; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; import java.io.ByteArrayInputStream; import java.io.IOException; import java.text.MessageFormat; import java.util.List; public class JDOMTraversingElement { public static void main(String[] args) { String xml = """ <root> <country name="Japan" capital="Tokyo"/> <country name="France" capital="Paris"/> <country name="Italy" capital=...

Wayan · 2 min read
CORE API / NOTES</>↗
Core API15 May 2009

How do I generate UUID / GUID in Java?

UUID / GUID (Universally / Globally Unique Identifier) is frequently use in programming. Some of its usage are for creating random file names, session id in web application, transaction id and for record’s primary keys in database replacing the sequence or auto generated number. To generate UUID in Java we can use the java.util.UUID class. […]

Wayan · 2 min read
JSP / NOTES</>↗
JSP14 May 2009

How do I write and read object from HTTP Session?

In this post you will learn how to write and read object from HTTP Session in JavaServer Page. The first example that we are looking at is using the classic JSP scriptlet, this is a very old way to work with JSP, but it is good for you to know a history. We write a […]

Wayan · 3 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.