-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A fast DOM parser for a subset of XML
--
-- Fast DOM parser for XML with no support for entities, CDATA sections
-- nor namespaces.
@package tinyXml
@version 0.1.0.2
-- | This module contains types and functions that are mostly intended for
-- the test suite, and should be considered internal for all other
-- purposes
module Text.Xml.Tiny.Internal
-- | A parsed XML node
data Node
Node :: !(Vector AttributeParseDetails) -> !(Vector ParseDetails) -> !ByteString -> !ParseDetails -> Node
-- | All the attributes in the document
[attributesV] :: Node -> !(Vector AttributeParseDetails)
-- | All the nodes in the document
[nodesV] :: Node -> !(Vector ParseDetails)
-- | The document bytes
[source] :: Node -> !ByteString
-- | Details for this node
[slices] :: Node -> !ParseDetails
-- | A parsed XML attribute
data Attribute
Attribute :: !ByteString -> Attribute
[attributeName, attributeValue] :: Attribute -> !ByteString
data ParseDetails
ParseDetails :: {-# UNPACK #-} !Slice -> {-# UNPACK #-} !Slice -> {-# UNPACK #-} !Slice -> {-# UNPACK #-} !Slice -> {-# UNPACK #-} !Slice -> ParseDetails
-- | bytestring slice
[name] :: ParseDetails -> {-# UNPACK #-} !Slice
-- | bytestring slice
[inner] :: ParseDetails -> {-# UNPACK #-} !Slice
-- | bytestring slice
[outer] :: ParseDetails -> {-# UNPACK #-} !Slice
-- | ParseDetailsAttribute slice
[attributes] :: ParseDetails -> {-# UNPACK #-} !Slice
-- | ParseDetails slice of children
[nodeContents] :: ParseDetails -> {-# UNPACK #-} !Slice
-- | An incompletely defined set of parse details
ProtoParseDetails :: !Slice -> !Int32 -> ParseDetails
-- | bytestring slice
-- | ParseDetailsAttribute slice
[name, attributes] :: ParseDetails -> !Slice
[innerStart, outerStart] :: ParseDetails -> !Int32
data AttributeParseDetails
AttributeParseDetails :: {-# UNPACK #-} !Slice -> {-# UNPACK #-} !Slice -> AttributeParseDetails
[nameA] :: AttributeParseDetails -> {-# UNPACK #-} !Slice
[value] :: AttributeParseDetails -> {-# UNPACK #-} !Slice
data Slice
Slice :: !Int32 -> Slice
[offset, length] :: Slice -> !Int32
fromOpen :: Config => Integral a => a -> Slice
fromOpenClose :: Config => (Integral a1, Integral a) => a -> a1 -> Slice
-- | Apply a slice to a foreign ptr of word characters and wrap as a
-- bytestring
fromIndexPtr :: Config => Slice -> ForeignPtr Word8 -> ByteString
empty :: Slice
-- | Inclusive
start :: Config => Slice -> Int32
-- | Non inclusive
end :: Config => Slice -> Int32
take :: Config => Integral a => a -> Slice -> Slice
drop :: Config => Integral t => t -> Slice -> Slice
null :: Config => Slice -> Bool
-- | Apply a slice to a vector
vector :: Config => Storable a => Slice -> Vector a -> [a]
-- | Apply a slice to a bytestring
render :: Config => Slice -> ByteString -> ByteString
-- | Returns a list of indexes
toList :: Config => Slice -> [Int]
newtype SrcLoc
SrcLoc :: Int -> SrcLoc
data Error
Error :: ErrorType -> CallStack -> Error
data ErrorType
UnterminatedComment :: SrcLoc -> ErrorType
UnterminatedTag :: String -> SrcLoc -> ErrorType
ClosingTagMismatch :: String -> SrcLoc -> ErrorType
JunkAtTheEnd :: Slice -> SrcLoc -> ErrorType
UnexpectedEndOfStream :: ErrorType
BadAttributeForm :: SrcLoc -> ErrorType
BadTagForm :: SrcLoc -> ErrorType
UnfinishedComment :: SrcLoc -> ErrorType
Garbage :: SrcLoc -> ErrorType
InvalidNullName :: SrcLoc -> ErrorType
instance GHC.Show.Show Text.Xml.Tiny.Internal.ErrorType
instance GHC.Show.Show Text.Xml.Tiny.Internal.SrcLoc
instance GHC.Show.Show Text.Xml.Tiny.Internal.AttributeParseDetails
instance GHC.Classes.Eq Text.Xml.Tiny.Internal.AttributeParseDetails
instance GHC.Show.Show Text.Xml.Tiny.Internal.ParseDetails
instance GHC.Show.Show Text.Xml.Tiny.Internal.Attribute
instance GHC.Classes.Eq Text.Xml.Tiny.Internal.Attribute
instance GHC.Show.Show Text.Xml.Tiny.Internal.Slice
instance GHC.Classes.Ord Text.Xml.Tiny.Internal.Slice
instance GHC.Classes.Eq Text.Xml.Tiny.Internal.Slice
instance Foreign.Storable.Storable Text.Xml.Tiny.Internal.Slice
instance Foreign.Storable.Storable Text.Xml.Tiny.Internal.ParseDetails
instance Foreign.Storable.Storable Text.Xml.Tiny.Internal.AttributeParseDetails
instance GHC.Exception.Exception Text.Xml.Tiny.Internal.Error
instance GHC.Show.Show Text.Xml.Tiny.Internal.Error
-- | This module contains functions for parsing an XML document and
-- deconstructing the AST.
module Text.Xml.Tiny
-- | A parsed XML node
data Node
-- | The tag name
name :: Config => Node -> ByteString
-- | The content of the tag, excluding the tag itself
inner :: Config => Node -> ByteString
-- | The contents of the tag, including the tag itself
outer :: Config => Node -> ByteString
-- | Get the slices of a node, including both the content strings (as
-- Left, never blank) and the direct child nodes (as
-- Right). If you only want the child nodes, use children.
contents :: Config => Node -> [Either ByteString Node]
-- | Get the (line, col) coordinates of a node
location :: Config => Node -> (Int, Int)
-- | A parsed XML attribute
data Attribute
Attribute :: !ByteString -> Attribute
[attributeName, attributeValue] :: Attribute -> !ByteString
-- | Parse an XML bytestring, returning a root node with name "" and the
-- content AST, or an error. Note that the returned AST references the
-- input bytestring and will therefore keep it alive.
parse :: Config => ByteString -> Either Error Node
-- | Get the direct child nodes of this node.
children :: Node -> [Node]
-- | Get the direct children of this node which have a specific name.
childrenBy :: Config => Node -> ByteString -> [Node]
-- | The attributes in the tag, if any.
attributes :: Config => Node -> [Attribute]
-- | Get the first attribute of this node which has a specific name, if
-- there is one.
attributeBy :: Config => Node -> ByteString -> Maybe Attribute
newtype SrcLoc
SrcLoc :: Int -> SrcLoc
data Error
Error :: ErrorType -> CallStack -> Error
data ErrorType
UnterminatedComment :: SrcLoc -> ErrorType
UnterminatedTag :: String -> SrcLoc -> ErrorType
ClosingTagMismatch :: String -> SrcLoc -> ErrorType
JunkAtTheEnd :: Slice -> SrcLoc -> ErrorType
UnexpectedEndOfStream :: ErrorType
BadAttributeForm :: SrcLoc -> ErrorType
BadTagForm :: SrcLoc -> ErrorType
UnfinishedComment :: SrcLoc -> ErrorType
Garbage :: SrcLoc -> ErrorType
InvalidNullName :: SrcLoc -> ErrorType
-- | Returns the XML bytestring reconstructed from the parsed AST. For the
-- original XML, use outer
rerender :: Node -> ByteString
instance GHC.Show.Show Text.Xml.Tiny.Internal.Node