A name in an xml document.
Names are composed of two components. A (possibly-empty) namespace along with
a local name.
Names are unique and will be represented with singleton objects. This means
that equality can be computed very quickly with a simple reference equality
check.
In the case of <foo>
the namespace will be empty and the local name
will be "foo"
.
In the case of <ns0:foo xmlns:ns0="http://foo.com"/>
the namespace
will be "http://foo.com"
and the local name will be "foo".
XML names also have an 'expanded' form that is equivalent to the non-standard
QName
format used by java. Specifically, it has the form: "{" +
getNamespace() + "}" + getLocalName(). This can be used when interoping with
other java XML libraries.
Methods
Method | Return type | Brief description |
---|---|---|
getLocalName() | String | Returns the local portion of this XML name. |
getNamespace() | String | Returns the namespace portion of this XML name. |
Detailed documentation
getLocalName()
Returns the local portion of this XML name.
Return
String
— the local portion of this Xml name
getNamespace()
Returns the namespace portion of this XML name.
Return
String
— the namespace portion of this XML name