Partially validates the QName, throwing an exception if found not valid.
Partially validates the QName, 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 QName itself is returned.
Qualified name. See http://www.w3.org/TR/xml-names11/. It is the combination of an optional prefix and a mandatory local part. It is not like a
QName
in Java, which is more like what yaidom calls an expanded name.There are 2 types of
QName
s:QNames are meaningless outside their scope, which resolves the
QName
as an eu.cdevreeze.yaidom.core.EName.Typical usage may lead to an explosion of different QName objects that are equal. Therefore, application code is encouraged to define and use constants for frequently used QNames. For example, for the XML Schema namespace:
In this example, the QName constant names are in upper camel case, starting with the prefix, followed by the local part, and ending with suffix "QName".
Implementation note: It was tried as alternative implementation to define the QName subclasses as (Scala 2.10) value classes. The QName would then wrap the qualified name as string representation (with or without prefix). One cost would be that parsing the (optional) prefix and the local name would occur far more frequently. Another cost would be that the alternative implementation would not directly express that a QName is a combination of an optional prefix and a local part. Therefore that alternative implementation has been abandoned.