Text.XML.Enumerator.Resolved
Contents
- data Document = Document {}
- data Prologue = Prologue {}
- data Instruction = Instruction {}
- data Miscellaneous
- data Node
- data Element = Element {
- elementName :: Name
- elementAttributes :: [(Name, Text)]
- elementNodes :: [Node]
- data Name = Name {}
- data Doctype = Doctype {}
- data ExternalID
- type DecodeEntities = Text -> Content
- decodeEntities :: DecodeEntities
- readFile :: FilePath -> DecodeEntities -> IO (Either SomeException Document)
- readFile_ :: FilePath -> DecodeEntities -> IO Document
- parseLBS :: ByteString -> DecodeEntities -> Either SomeException Document
- parseLBS_ :: ByteString -> DecodeEntities -> Document
- parseEnum :: Monad m => Enumerator ByteString m Document -> DecodeEntities -> m (Either SomeException Document)
- parseEnum_ :: Monad m => Enumerator ByteString m Document -> DecodeEntities -> m Document
- fromEvents :: Monad m => Iteratee Event m Document
- data UnresolvedEntityException = UnresolvedEntityException (Set Text)
- writeFile :: FilePath -> Document -> IO ()
- writePrettyFile :: FilePath -> Document -> IO ()
- renderLBS :: Document -> ByteString
- prettyLBS :: Document -> ByteString
- renderBytes :: MonadIO m => Document -> Enumerator ByteString m a
- prettyBytes :: MonadIO m => Document -> Enumerator ByteString m a
- toXMLDocument :: Document -> Document
- fromXMLDocument :: Document -> Either (Set Text) Document
- toXMLNode :: Node -> Node
- fromXMLNode :: Node -> Either (Set Text) Node
- toXMLElement :: Element -> Element
- fromXMLElement :: Element -> Either (Set Text) Element
Data types
Constructors
Document | |
Fields |
Constructors
NodeElement Element | |
NodeInstruction Instruction | |
NodeContent Text | |
NodeComment Text |
Constructors
Element | |
Fields
|
data Name
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"
Constructors
Name | |
Fields
|
data Doctype
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.
Constructors
Doctype | |
Fields
|
data ExternalID
Instances
Parsing
type DecodeEntities = Text -> ContentSource
decodeEntities :: DecodeEntitiesSource
Default implementation of DecodeEntities
: handles numeric entities and
the five standard character entities (lt, gt, amp, quot, apos).
readFile :: FilePath -> DecodeEntities -> IO (Either SomeException Document)Source
parseLBS_ :: ByteString -> DecodeEntities -> DocumentSource
parseEnum :: Monad m => Enumerator ByteString m Document -> DecodeEntities -> m (Either SomeException Document)Source
parseEnum_ :: Monad m => Enumerator ByteString m Document -> DecodeEntities -> m DocumentSource
data UnresolvedEntityException Source
Constructors
UnresolvedEntityException (Set Text) |
Rendering
writePrettyFile :: FilePath -> Document -> IO ()Source
Pretty prints via prettyBytes
.
prettyLBS :: Document -> ByteStringSource
Pretty prints via prettyBytes
.
renderBytes :: MonadIO m => Document -> Enumerator ByteString m aSource
prettyBytes :: MonadIO m => Document -> Enumerator ByteString m aSource
Conversion
toXMLElement :: Element -> ElementSource