-- | Provides xhtml constructors for 'Text.XML.Light'.
module Text.HTML.Light (module L
                       ,cdata,cdata_raw
                       ,renderXHTML) where

import Text.XML.Light as L
import Text.HTML.Light.Attribute as L
import Text.HTML.Light.Constant as L
import Text.HTML.Light.Element as L

-- | Ordinary character data, subject to escaping.
cdata :: String -> Content
cdata s = Text (CData CDataText s Nothing)

-- | Raw character data, not subject to escaping.
cdata_raw :: String -> Content
cdata_raw s = Text (CData CDataRaw s Nothing)

-- | Render an xhtml element with the given document type.
renderXHTML :: DocType -> Element -> String
renderXHTML t e = concat [xml_1_0
                         ,t
                         ,showElement e]