public final class Namespace extends Object implements Serializable, Comparable<Namespace>
Namespaces are interned and thus can be compared using ==
.
Modifier and Type | Field and Description |
---|---|
static Namespace |
ANY_NAMESPACE
Not a real namespace but may be used as a wildcard.
|
static Namespace |
CONFIGURATION
The "http://www.xmlmind.com/xmleditor/schema/configuration"
namespace.
|
static Namespace |
DOCBOOK
The "http://docbook.org/ns/docbook" namespace.
|
static Namespace |
DOCBOOK_TRANSCLUSION
The "http://docbook.org/ns/transclusion" namespace.
|
static Namespace |
FO
The "http://www.w3.org/1999/XSL/Format" namespace.
|
static Namespace |
MATHML
The "http://www.w3.org/1998/Math/MathML" namespace.
|
static Namespace |
NONE
Represents the absence of a namespace.
|
static Namespace |
RNG
The "http://relaxng.org/ns/structure/1.0" namespace.
|
static Namespace |
SCHEMATRON
The "http://purl.oclc.org/dsdl/schematron" namespace.
|
static Namespace |
SVG
The "http://www.w3.org/2000/svg" namespace.
|
String |
uri
The URI of this namespace.
|
static Namespace |
XHTML
The "http://www.w3.org/1999/xhtml" namespace.
|
static Namespace |
XI
The "http://www.w3.org/2001/XInclude" namespace.
|
static Namespace |
XI_LOCAL_ATTRIBUTES
The "http://www.w3.org/2001/XInclude/local-attributes"
namespace.
|
static Namespace |
XLINK
The "http://www.w3.org/1999/xlink" namespace.
|
static Namespace |
XML
The "http://www.w3.org/XML/1998/namespace" namespace.
|
static Namespace |
XMLNS
The "http://www.w3.org/2000/xmlns/" namespace.
|
static Namespace |
XSD
The "http://www.w3.org/2001/XMLSchema" namespace.
|
static Namespace |
XSI
The "http://www.w3.org/2001/XMLSchema-instance" namespace.
|
static Namespace |
XSLT
The "http://www.w3.org/1999/XSL/Transform" namespace.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Namespace other) |
boolean |
equals(Object other) |
static Namespace |
get(String uri)
Returns the namespace with specified URI.
|
static Namespace |
get(String uri,
String usualPrefix)
Same as
get(String) but at the same time declares
specified prefix as being the usual prefix of returned namespace. |
String |
getUsualPrefix()
Returns the prefix usually associated with is namespace.
|
int |
hashCode() |
String |
toString()
Returns the URI of the namespace.
|
public static final Namespace NONE
public static final Namespace XML
public static final Namespace XMLNS
public static final Namespace XHTML
public static final Namespace XSLT
public static final Namespace FO
public static final Namespace XSD
public static final Namespace XSI
public static final Namespace XI
public static final Namespace XI_LOCAL_ATTRIBUTES
public static final Namespace SVG
public static final Namespace MATHML
public static final Namespace XLINK
public static final Namespace DOCBOOK
public static final Namespace DOCBOOK_TRANSCLUSION
public static final Namespace RNG
public static final Namespace SCHEMATRON
Note that the namespace of pre-ISO Schematron is "http://www.ascc.net/xml/schematron".
public static final Namespace ANY_NAMESPACE
public static final Namespace CONFIGURATION
public final String uri
public static Namespace get(String uri)
The empty string is used as the pseudo-URI of NONE
.
Namespace objects are interned (like symbols in a symbol table) and
therefore can be compared using ==
rather than
equals
.
uri
- the URI of the namespace.
In principle, a namespace name must be either the empty string
(no namespace) or an absolute IRI reference (Internationalized
Resource Identifiers) but this is not checked here.
Example of actual yet invalid namespace name: WebDAV's
"DAV:
".
public static Namespace get(String uri, String usualPrefix)
get(String)
but at the same time declares
specified prefix as being the usual prefix of returned namespace.uri
- the URI of the namespaceusualPrefix
- the usual prefix of the namespace;
may be null
getUsualPrefix()
public String getUsualPrefix()
"xlink"
for XLINK
.
Returns null
if there is no usual prefix.public String toString()
public int compareTo(Namespace other)
compareTo
in interface Comparable<Namespace>