-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Basic types for representing XML -- -- Basic types for representing XML @package xml-types @version 0.3 -- | Basic types for representing XML. -- -- The idea is to have a full set of appropriate types, which various XML -- libraries can share. Instead of having equivalent-but-incompatible -- types for every binding, parser, or client, they all share the same -- types can can thus interoperate easily. -- -- This library contains complete types for most parts of an XML -- document, including the prologue, node tree, and doctype. Some basic -- combinators are included for common tasks, including traversing the -- node tree and filtering children. module Data.XML.Types data Document Document :: Prologue -> Element -> [Miscellaneous] -> Document documentPrologue :: Document -> Prologue documentRoot :: Document -> Element documentEpilogue :: Document -> [Miscellaneous] data Prologue Prologue :: [Miscellaneous] -> Maybe Doctype -> [Miscellaneous] -> Prologue prologueBefore :: Prologue -> [Miscellaneous] prologueDoctype :: Prologue -> Maybe Doctype prologueAfter :: Prologue -> [Miscellaneous] data Instruction Instruction :: Text -> Text -> Instruction instructionTarget :: Instruction -> Text instructionData :: Instruction -> Text data Miscellaneous MiscInstruction :: Instruction -> Miscellaneous MiscComment :: Text -> Miscellaneous data Node NodeElement :: Element -> Node NodeInstruction :: Instruction -> Node NodeContent :: Content -> Node NodeComment :: Text -> Node data Element Element :: Name -> [(Name, [Content])] -> [Node] -> Element elementName :: Element -> Name elementAttributes :: Element -> [(Name, [Content])] elementNodes :: Element -> [Node] data Content ContentText :: Text -> Content -- | For pass-through parsing ContentEntity :: Text -> Content -- | A fully qualified name. -- -- Prefixes are not semantically important; they are included only to -- simplify pass-through parsing. When comparing names with Eq or -- Ord methods, prefixes are ignored. -- -- The IsString instance supports Clark notation; see -- http://www.jclark.com/xml/xmlns.htm and -- http://infohost.nmt.edu/tcc/help/pubs/pylxml/etree-QName.html. -- Use the OverloadedStrings language extension for very simple -- Name construction: -- --
--   myname :: Name
--   myname = "{http://example.com/ns/my-namespace}my-name"
--   
data Name Name :: Text -> Maybe Text -> Maybe Text -> Name nameLocalName :: Name -> Text nameNamespace :: Name -> Maybe Text namePrefix :: Name -> Maybe Text -- | Note: due to the incredible complexity of DTDs, this type only -- supports external subsets. I've tried adding internal subset types, -- but they quickly gain more code than the rest of this module put -- together. -- -- It is possible that some future version of this library might support -- internal subsets, but I am no longer actively working on adding them. data Doctype Doctype :: Text -> Maybe ExternalID -> Doctype doctypeName :: Doctype -> Text doctypeID :: Doctype -> Maybe ExternalID data ExternalID SystemID :: Text -> ExternalID PublicID :: Text -> Text -> ExternalID -- | Some XML processing tools are incremental, and work in terms of events -- rather than node trees. The Event type allows a document to be -- fully specified as a sequence of events. -- -- Event-based XML libraries include: -- -- data Event EventBeginDocument :: Event EventEndDocument :: Event EventBeginDoctype :: Text -> (Maybe ExternalID) -> Event EventEndDoctype :: Event EventInstruction :: Instruction -> Event EventBeginElement :: Name -> [(Name, [Content])] -> Event EventEndElement :: Name -> Event EventContent :: Content -> Event EventComment :: Text -> Event EventCDATA :: Text -> Event isElement :: Node -> [Element] isInstruction :: Node -> [Instruction] isContent :: Node -> [Content] isComment :: Node -> [Text] isNamed :: Name -> Element -> [Element] elementChildren :: Element -> [Element] elementContent :: Element -> [Content] elementText :: Element -> [Text] nodeChildren :: Node -> [Node] nodeContent :: Node -> [Content] nodeText :: Node -> [Text] hasAttribute :: Name -> Element -> [Element] hasAttributeText :: Name -> (Text -> Bool) -> Element -> [Element] attributeContent :: Name -> Element -> Maybe [Content] attributeText :: Name -> Element -> Maybe Text instance Show Instruction instance Eq Instruction instance Ord Instruction instance Show Miscellaneous instance Eq Miscellaneous instance Show Content instance Eq Content instance Show Name instance Show Element instance Eq Element instance Show Node instance Eq Node instance Show ExternalID instance Eq ExternalID instance Ord ExternalID instance Show Doctype instance Eq Doctype instance Ord Doctype instance Show Prologue instance Eq Prologue instance Show Document instance Eq Document instance Show Event instance Eq Event instance Typeable Event instance Typeable ExternalID instance Typeable Doctype instance IsString Name instance Ord Name instance Eq Name instance Typeable Name instance Typeable Content instance Typeable Element instance Typeable Node instance Typeable Miscellaneous instance Typeable Instruction instance Typeable Prologue instance Typeable Document