@@ -16,6 +16,7 @@ module Text.XML.Lens (
1616 -- ** Names
1717 , name
1818 , el
19+ , ell
1920 -- ** Attributes
2021 , attributeIs
2122 , attributeSatisfies
@@ -45,6 +46,9 @@ module Text.XML.Lens (
4546 -- * Lenses for 'Instruction'
4647 , _instructionTarget
4748 , _instructionData
49+ -- * Reexports
50+ , module Control.Lens
51+ , module Text.XML
4852 ) where
4953import Text.XML
5054import Control.Lens
@@ -136,7 +140,7 @@ attribute n = attrs . at n
136140-- | Traverse itself with its all children.
137141entire :: Traversal' Element Element
138142entire f e@(Element _ _ ns) = com <$> f e <*> traverse (_Element (entire f)) ns where
139− com (Element n a _) ns = Element n a ns
143+ com (Element n a _) = Element n a
140144
141145-- | Traverse elements which has the specified name.
142146el :: Name -> Traversal' Element Element
@@ -144,6 +148,12 @@ el n f s
144148 | elementName s == n = f s
145149 | otherwise = pure s
146150
151+-- | Traverse elements which has the specified *local* name.
152+ell :: Text -> Traversal' Element Element
153+ell n f s
154+ | nameLocalName (elementName s) == n = f s
155+ | otherwise = pure s
156+
147157attributeSatisfies :: Name -> (Text -> Bool) -> Traversal' Element Element
148158attributeSatisfies n p = filtered (maybe False p . preview (attrs . ix n))
149159