-- ------------------------------------------------------------

{- |
   Module     : Text.XML.HXT.Arrow.ParserInterface
   Copyright  : Copyright (C) 2010 Uwe Schmidt
   License    : MIT

   Maintainer : Uwe Schmidt (uwe@fh-wedel.de)
   Stability  : stable
   Portability: portable

   interface to the HXT XML and DTD parsers
-}

-- ------------------------------------------------------------

module Text.XML.HXT.Arrow.ParserInterface
    ( module Text.XML.HXT.Arrow.ParserInterface )
where

import Control.Arrow.ArrowList

import Text.XML.HXT.DOM.Interface
import Text.XML.HXT.Arrow.XmlArrow

import qualified Text.XML.HXT.Parser.HtmlParsec          as HP
import qualified Text.XML.HXT.Parser.XmlParsec           as XP
import qualified Text.XML.HXT.Parser.XmlDTDParser        as DP

-- ------------------------------------------------------------

parseXmlDoc                     :: ArrowXml a => a (String, String) XmlTree
parseXmlDoc :: a (String, String) XmlTree
parseXmlDoc                     =  (String -> String -> [XmlTree]) -> a (String, String) XmlTree
forall (a :: * -> * -> *) b c d.
ArrowList a =>
(b -> c -> [d]) -> a (b, c) d
arr2L String -> String -> [XmlTree]
XP.parseXmlDocument

parseXmlDTDPart                 :: ArrowXml a => a (String, XmlTree) XmlTree
parseXmlDTDPart :: a (String, XmlTree) XmlTree
parseXmlDTDPart                 =  (String -> XmlTree -> [XmlTree]) -> a (String, XmlTree) XmlTree
forall (a :: * -> * -> *) b c d.
ArrowList a =>
(b -> c -> [d]) -> a (b, c) d
arr2L String -> XmlTree -> [XmlTree]
XP.parseXmlDTDPart

xreadCont                       :: ArrowXml a => a String XmlTree
xreadCont :: a String XmlTree
xreadCont                       =  (String -> [XmlTree]) -> a String XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL String -> [XmlTree]
XP.xread

xreadDoc                        :: ArrowXml a => a String XmlTree
xreadDoc :: a String XmlTree
xreadDoc                        =  (String -> [XmlTree]) -> a String XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL String -> [XmlTree]
XP.xreadDoc

parseXmlEntityEncodingSpec
  , parseXmlDocEncodingSpec
  , removeEncodingSpec          :: ArrowXml a => a XmlTree XmlTree

parseXmlDocEncodingSpec :: a XmlTree XmlTree
parseXmlDocEncodingSpec         =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL XmlTree -> [XmlTree]
XP.parseXmlDocEncodingSpec
parseXmlEntityEncodingSpec :: a XmlTree XmlTree
parseXmlEntityEncodingSpec      =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL XmlTree -> [XmlTree]
XP.parseXmlEntityEncodingSpec

removeEncodingSpec :: a XmlTree XmlTree
removeEncodingSpec              =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL XmlTree -> [XmlTree]
XP.removeEncodingSpec

parseXmlDTDdeclPart             :: ArrowXml a => a XmlTree XmlTree
parseXmlDTDdeclPart :: a XmlTree XmlTree
parseXmlDTDdeclPart             =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL XmlTree -> [XmlTree]
DP.parseXmlDTDdeclPart

parseXmlDTDdecl                 :: ArrowXml a => a XmlTree XmlTree
parseXmlDTDdecl :: a XmlTree XmlTree
parseXmlDTDdecl                 =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL XmlTree -> [XmlTree]
DP.parseXmlDTDdecl

parseXmlDTDEntityValue          :: ArrowXml a => a XmlTree XmlTree
parseXmlDTDEntityValue :: a XmlTree XmlTree
parseXmlDTDEntityValue          =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL XmlTree -> [XmlTree]
DP.parseXmlDTDEntityValue

parseXmlEntityValueAsContent    :: ArrowXml a => String -> a XmlTree XmlTree
parseXmlEntityValueAsContent :: String -> a XmlTree XmlTree
parseXmlEntityValueAsContent    =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL ((XmlTree -> [XmlTree]) -> a XmlTree XmlTree)
-> (String -> XmlTree -> [XmlTree]) -> String -> a XmlTree XmlTree
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> XmlTree -> [XmlTree]
XP.parseXmlEntityValueAsContent

parseXmlEntityValueAsAttrValue  :: ArrowXml a => String -> a XmlTree XmlTree
parseXmlEntityValueAsAttrValue :: String -> a XmlTree XmlTree
parseXmlEntityValueAsAttrValue  =  (XmlTree -> [XmlTree]) -> a XmlTree XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL ((XmlTree -> [XmlTree]) -> a XmlTree XmlTree)
-> (String -> XmlTree -> [XmlTree]) -> String -> a XmlTree XmlTree
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> XmlTree -> [XmlTree]
XP.parseXmlEntityValueAsAttrValue

-- ------------------------------------------------------------

parseHtmlDoc                    :: ArrowList a => a (String, String) XmlTree
parseHtmlDoc :: a (String, String) XmlTree
parseHtmlDoc                    = (String -> String -> [XmlTree]) -> a (String, String) XmlTree
forall (a :: * -> * -> *) b c d.
ArrowList a =>
(b -> c -> [d]) -> a (b, c) d
arr2L String -> String -> [XmlTree]
HP.parseHtmlDocument

hread                           :: ArrowList a => a String XmlTree
hread :: a String XmlTree
hread                           = (String -> [XmlTree]) -> a String XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL   String -> [XmlTree]
HP.parseHtmlContent

hreadDoc                        :: ArrowList a => a String XmlTree
hreadDoc :: a String XmlTree
hreadDoc                        = (String -> [XmlTree]) -> a String XmlTree
forall (a :: * -> * -> *) b c. ArrowList a => (b -> [c]) -> a b c
arrL ((String -> [XmlTree]) -> a String XmlTree)
-> (String -> [XmlTree]) -> a String XmlTree
forall a b. (a -> b) -> a -> b
$ String -> String -> [XmlTree]
HP.parseHtmlDocument String
"string"

-- ------------------------------------------------------------