xml-conduit - Text.XML.Cursor  

Select attributes on the current element (or nothing if it is not an element). XPath: the attribute axis contains the attributes of the context node; the axis will be empty unless the context node is an element

Note that this is not strictly an Axis, but will work with most combinators.

The return list of the generalised axis contains as elements lists of Content elements, each full list representing an attribute value.

xml-conduit - Text.XML.Cursor  

Select only those element nodes containing the given attribute key/value pair.

attr :: Name -> Lens' Element (Maybe Text)

xml-html-conduit-lens - Text.Xml.Lens  

Traverse node attributes with a specific name

>>> let doc = "" :: TL.Text
>>> doc ^.. xml...attr "qux".traverse
["quux","xyzzy"]
>>> doc ^.. xml...attr "bar"
[Just "baz",Nothing]
>>> doc & xml...attr "qux".traverse %~ Text.reverse
""
>>> doc & xml.ix 1.attr "bar" ?~ "bazzy"
""

xml-enumerator - Text.XML.Cursor  

Select attributes on the current element (or nothing if it is not an element). XPath: the attribute axis contains the attributes of the context node; the axis will be empty unless the context node is an element

Note that this is not strictly an Axis, but will work with most combinators.

The return list of the generalised axis contains as elements lists of Content elements, each full list representing an attribute value.

xml-enumerator - Text.XML.Cursor  

Select only those element nodes containing the given attribute key/value pair.

attrs :: IndexedTraversal' Name Element Text

xml-html-conduit-lens - Text.Xml.Lens  

Traverse node attributes

>>> let doc = "" :: TL.Text
>>> doc ^.. xml...attrs.indices (has (name.unpacked.prefixed "qu"))
["zap","xyzzy"]
>>> doc & xml...attrs %~ Text.toUpper
""
attributed :: Fold (Map Name Text) a -> Traversal' Element Element

xml-html-conduit-lens - Text.Xml.Lens  

Select nodes by attributes' values

>>> let doc = "4711" :: TL.Text
>>> doc ^.. xml...attributed (ix "bar".only "baz").text
["4","11"]
>>> doc ^? xml...attributed (folded.to Text.length.only 4).text
Just "7"
attributeIs :: Name -> Text -> Traversal' Element Element