module Text.XmlHtml (
Document(..),
Node(..),
DocType(..),
ExternalID(..),
InternalSubset(..),
Encoding(..),
RenderOptions(..),
AttrSurround(..),
AttrResolveInternalQuotes(..),
isTextNode,
isComment,
isElement,
tagName,
getAttribute,
hasAttribute,
setAttribute,
nodeText,
childNodes,
childElements,
childElementsTag,
childElementTag,
descendantNodes,
descendantElements,
descendantElementsTag,
descendantElementTag,
parseXML,
parseHTML,
render,
renderWithOptions,
defaultRenderOptions,
XMLR.renderXmlFragment,
XMLR.renderXmlFragmentWithOptions,
HTML.renderHtmlFragment,
HTML.renderHtmlFragmentWithOptions,
renderDocType
) where
import Blaze.ByteString.Builder (Builder)
import Data.ByteString (ByteString)
import Text.XmlHtml.Common
import Text.XmlHtml.TextParser
import qualified Text.XmlHtml.XML.Parse as XML
import qualified Text.XmlHtml.XML.Render as XMLR
import qualified Text.XmlHtml.HTML.Parse as HTML
import qualified Text.XmlHtml.HTML.Render as HTML
parseXML :: String
-> ByteString
-> Either String Document
parseXML :: String -> ByteString -> Either String Document
parseXML = forall a.
(Encoding -> Parser a) -> String -> ByteString -> Either String a
parse Encoding -> Parser Document
XML.docFragment
parseHTML :: String
-> ByteString
-> Either String Document
parseHTML :: String -> ByteString -> Either String Document
parseHTML = forall a.
(Encoding -> Parser a) -> String -> ByteString -> Either String a
parse Encoding -> Parser Document
HTML.docFragment
renderWithOptions :: RenderOptions -> Document -> Builder
renderWithOptions :: RenderOptions -> Document -> Builder
renderWithOptions RenderOptions
opts (XmlDocument Encoding
e Maybe DocType
dt [Node]
ns) = RenderOptions -> Encoding -> Maybe DocType -> [Node] -> Builder
XMLR.renderWithOptions RenderOptions
opts Encoding
e Maybe DocType
dt [Node]
ns
renderWithOptions RenderOptions
opts (HtmlDocument Encoding
e Maybe DocType
dt [Node]
ns) = RenderOptions -> Encoding -> Maybe DocType -> [Node] -> Builder
HTML.renderWithOptions RenderOptions
opts Encoding
e Maybe DocType
dt [Node]
ns
render :: Document -> Builder
render :: Document -> Builder
render Document
doc = RenderOptions -> Document -> Builder
renderWithOptions RenderOptions
defaultRenderOptions Document
doc
renderDocType :: Encoding -> Maybe DocType -> Builder
renderDocType :: Encoding -> Maybe DocType -> Builder
renderDocType = Encoding -> Maybe DocType -> Builder
XMLR.docTypeDecl