Given an optional prefix, creates a javax.xml.namespace.QName
from this EName
Given an optional prefix, creates a QName
from this EName
The String
representation, in the format of the javax.xml.namespace.QName.toString
method
The String
representation, in the format of the javax.xml.namespace.QName.toString
method
Partially validates the EName, throwing an exception if found not valid.
Partially validates the EName, throwing an exception if found not valid. If not found invalid, returns this.
It is the responsibility of the user of this class to call this method, if needed. Fortunately, this method facilitates method chaining, because the EName itself is returned.
Expanded name. See http://www.w3.org/TR/xml-names11/. It has a localPart and an optional namespace URI. Semantically like a
QName
in Java, but not keeping the prefix.To get an eu.cdevreeze.yaidom.core.EName from a eu.cdevreeze.yaidom.core.QName, the latter needs to be resolved against a eu.cdevreeze.yaidom.core.Scope.
The short class name illustrates that expanded names are at least as important as qualified names, and should be equally easy to construct (using the companion object).
Typical usage may lead to an explosion of different EName objects that are equal. Therefore, application code is encouraged to define and use constants for frequently used ENames. For example, for the XML Schema namespace (and analogous to the XLink constants in yaidom):
In this example, the EName constant names are in upper camel case, starting with the ("preferred") prefix, followed by the local part, and ending with suffix "EName".
Implementation note: It was tried as alternative implementation to define EName as (Scala 2.10) value class. The EName would then wrap the expanded name as string representation (in James Clark notation). One cost would be that parsing the (optional) namespace URI and the local name would occur far more frequently. Another cost would be that the alternative implementation would not directly express that an EName is a combination of an optional namespace URI and a local part. Therefore that alternative implementation has been abandoned.