Method
valueFor(attribute:inElement:)
Resolves the value of a named attribute on an element.
func valueFor(attribute name: String, inElement e: XMLElement) -> String?
Parameters
name-
The attribute name to look up.
e-
The element whose attributes should be searched.
Return Value
The attribute value, or nil when no matching attribute exists.
Discussion
This performs a linear scan across the element’s attributes and returns the first matching name.