Shorthand for filterChildElems(p)
.
Shorthand for attributeOption(expandedName)
.
Shorthand for attributeOption(expandedName)
.
Shorthand for filterElemsOrSelf(p)
.
Shorthand for findTopmostElemsOrSelf(p)
.
Returns the value of the attribute with the given expanded name, and throws an exception otherwise.
Returns the value of the attribute with the given expanded name, and throws an exception otherwise.
Returns the QName value of the attribute with the given expanded name, and throws an exception otherwise
Returns the QName value of the attribute with the given expanded name, and throws an exception otherwise
Returns the QName value of the attribute with the given expanded name, if any, wrapped in an Option
.
Returns the QName value of the attribute with the given expanded name, if any, wrapped in an Option
.
If the attribute exists, but its value is not a QName, an exception is thrown.
Returns the resolved QName value (as EName) of the attribute with the given expanded name, and throws an exception otherwise
Returns the resolved QName value (as EName) of the attribute with the given expanded name, and throws an exception otherwise
Returns the resolved QName value (as EName) of the attribute with the given expanded name, if any, wrapped in an Option
.
Returns the resolved QName value (as EName) of the attribute with the given expanded name, if any, wrapped in an Option
.
None is returned if the attribute does not exist. If the QName value cannot be resolved given the scope of the element,
an exception is thrown.
Returns the value of the attribute with the given expanded name, if any, wrapped in an Option
.
Returns the value of the attribute with the given expanded name, if any, wrapped in an Option
.
The attributes of the element as mapping from QNames to values
The attributes of the element as mapping from QNames to values
Returns the comment children
Returns the child elements obeying the given predicate.
Returns the descendant elements obeying the given predicate.
Returns the descendant-or-self elements obeying the given predicate.
Returns the descendant-or-self elements obeying the given predicate. This method could be defined as:
def filterElemsOrSelf(p: E => Boolean): immutable.IndexedSeq[E] = Vector(this).filter(p) ++ (this.findAllChildElems flatMap (_.filterElemsOrSelf(p)))
It can be proven that the result is equivalent to findAllElemsOrSelf filter p
.
Core method that returns all child elements, in the correct order.
Core method that returns all child elements, in the correct order. Other operations can be defined in terms of this one.
Returns all descendant elements (not including this element).
Returns this element followed by all descendant elements (that is, the descendant-or-self elements).
Returns the first found attribute value of an attribute with the given local name, if any, wrapped in an Option
.
Returns the first found attribute value of an attribute with the given local name, if any, wrapped in an Option
.
Because of differing namespaces, it is possible that more than one such attribute exists, although this is not often the case.
Returns the first found child element obeying the given predicate, if any, wrapped in an Option
.
Finds the child element with the given Path.Entry
(where this element is the root), if any, wrapped in an Option
.
Finds the child element with the given Path.Entry
(where this element is the root), if any, wrapped in an Option
.
Returns the first found (topmost) descendant element obeying the given predicate, if any, wrapped in an Option
.
Returns the first found (topmost) descendant-or-self element obeying the given predicate, if any, wrapped in an Option
.
Finds the element with the given Path
(where this element is the root), if any, wrapped in an Option
.
Finds the element with the given Path
(where this element is the root), if any, wrapped in an Option
.
This method must be very efficient, which depends on the efficiency of method findChildElemByPathEntry
.
Returns the descendant elements obeying the given predicate that have no ancestor obeying the predicate.
Returns the descendant-or-self elements obeying the given predicate, such that no ancestor obeys the predicate.
Returns the descendant-or-self elements obeying the given predicate, such that no ancestor obeys the predicate. This method could be defined as:
def findTopmostElemsOrSelf(p: E => Boolean): immutable.IndexedSeq[E] = if (p(this)) Vector(this) else (this.findAllChildElems flatMap (_.findTopmostElemsOrSelf(p)))
Returns the single child element obeying the given predicate, and throws an exception otherwise.
Returns (the equivalent of) findChildElemByPathEntry(entry).get
Returns (the equivalent of) findChildElemByPathEntry(entry).get
Returns (the equivalent of) findElemOrSelfByPath(path).get
Returns (the equivalent of) findElemOrSelfByPath(path).get
The local name, that is, the local part of the EName
The local name, that is, the local part of the EName
Returns XmlStringUtils.normalizeString(text)
.
Returns XmlStringUtils.normalizeString(text)
.
The QName of the element
The QName of the element
Returns the "resolved attributes".
Returns the "resolved attributes". Note that there is no guarantee that the attributes names can be resolved!
Returns the resolved name of the element.
Returns the resolved name of the element. Note that there is no guarantee that the element name can be resolved!
Returns the scope of the element.
Returns the scope of the element. Note that there is no guarantee that this scope is complete!
Returns the concatenation of the texts of text children, including whitespace and CData.
Returns the concatenation of the texts of text children, including whitespace and CData. Non-text children are ignored. If there are no text children, the empty string is returned.
Returns QName(text.trim)
Returns QName(text.trim)
Returns the equivalent of scope.resolveQNameOption(textAsQName).get
Returns the equivalent of scope.resolveQNameOption(textAsQName).get
Returns the text children
Returns text.trim
.
Returns text.trim
.
Wrapper around
scala.xml.Elem
, conforming to the eu.cdevreeze.yaidom.queryapi.ElemApi API.See the documentation of the mixed-in query API trait(s) for more details on the uniform query API offered by this class.
Keep in mind that the
HasENameApi
specific part of the API is a broken abstraction. If the wrapped Scala XML element misses some namespace declarations for used element or attribute names, these element and/or attribute names cannot be resolved, and exceptions are thrown when querying for them! TheElemApi
part of the API does not suffer from this broken abstraction, so is less dangerous to use.The wrapper instances are very light-weight, and typically very short-lived. On the other hand, each query may create many wrapper instances for the query results. By design, the only state of each wrapper instance is the wrapped Scala XML Elem.