Namespaces

JDOM's Namespace class, shown in Example 15.17, represents a namespace attached to an element or an attribute. Each namespace has a URI. If the namespace is not a default namespace, then it also has a prefix. Otherwise, the prefix is the empty string.

Example 15.17. The JDOM Namespace Class
 package org.jdom; public final class Namespace { // Common namespaces public static final Namespace NO_NAMESPACE; public static final Namespace XML_NAMESPACE; // Factory methods public static Namespace getNamespace(String prefix, String uri); public static Namespace getNamespace(String uri); // Getter methods public String getPrefix(); public String getURI(); // Utility methods public boolean equals(Object o); public String toString(); public int ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.