{-# LANGUAGE OverloadedStrings #-} module EventUtil where import Control.Monad import Data.XML.Types as XML getStreamName (EventBeginElement name _) = name isEventBeginElement (EventBeginElement {}) = True isEventBeginElement _ = False isEventEndElement (EventEndElement {}) = True isEventEndElement _ = False -- Note: This function ignores name space qualification elementAttrs expected (EventBeginElement name attrs) | nameLocalName name==expected = return attrs elementAttrs _ _ = mzero streamP name = Name name (Just "http://etherx.jabber.org/streams") (Just "stream") attr name value = (name,[ContentText value])