module Text.XML.HaXml.Util
(
docContent
, contentElem
, attrs
, tagTextContent
) where
import Text.XML.HaXml.Types
import Text.XML.HaXml.Verbatim
docContent :: i -> Document i -> Content i
docContent :: i -> Document i -> Content i
docContent i :: i
i (Document _ _ e :: Element i
e _) = Element i -> i -> Content i
forall i. Element i -> i -> Content i
CElem Element i
e i
i
contentElem :: Content i -> Element i
contentElem :: Content i -> Element i
contentElem (CElem e :: Element i
e _) = Element i
e
contentElem _ = [Char] -> Element i
forall a. HasCallStack => [Char] -> a
error "content is not a CElem"
attrs :: Element i -> [Attribute]
attrs :: Element i -> [Attribute]
attrs ( Elem _ attrs :: [Attribute]
attrs _ ) = [Attribute]
attrs
tagTextContent :: Content i -> [Char]
tagTextContent :: Content i -> [Char]
tagTextContent ((CElem (Elem _ _ cs :: [Content i]
cs) _)) = (Content i -> [Char]) -> [Content i] -> [Char]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap Content i -> [Char]
forall a. Verbatim a => a -> [Char]
verbatim [Content i]
cs