Copyright | (c) Niklas Broberg 2008-2013 |
---|---|
License | BSD-style (see the file LICENSE.txt) |
Maintainer | Niklas Broberg, niklas.broberg@gmail.com |
Stability | experimental |
Portability | Haskell 98 |
Safe Haskell | Safe |
Language | Haskell98 |
HSP.XML
Description
Datatypes and type classes comprising the basic model behind the scenes of Haskell Server Pages tags.
Synopsis
- data XML
- = Element NSName Attributes Children
- | CDATA Bool Text
- data XMLMetaData = XMLMetaData {
- doctype :: (Bool, Text)
- contentType :: Text
- preferredRenderer :: XML -> Builder
- type Namespace = Maybe Text
- type NSName = (Namespace, Text)
- type Attributes = [Attribute]
- type Children = [XML]
- pcdata :: Text -> XML
- cdata :: Text -> XML
- newtype Attribute = MkAttr (NSName, AttrValue)
- data AttrValue
- attrVal :: Text -> AttrValue
- pAttrVal :: Text -> AttrValue
- renderXML :: XML -> Text
- isElement :: XML -> Bool
- isCDATA :: XML -> Bool
- fromStringLit :: String -> Text
The XML
datatype
The XML datatype representation. Is either an Element or CDATA.
Constructors
Element NSName Attributes Children | |
CDATA Bool Text |
Instances
Show XML Source # | |
(Functor m, Monad m) => XMLGenerator (HSPT XML m) Source # | |
Defined in HSP.Monad | |
(Functor m, Monad m) => XMLGen (HSPT XML m) Source # | |
Defined in HSP.Monad Associated Types type XMLType (HSPT XML m) Source # type StringType (HSPT XML m) Source # data ChildType (HSPT XML m) Source # data AttributeType (HSPT XML m) Source # Methods genElement :: Name (StringType (HSPT XML m)) -> [XMLGenT (HSPT XML m) [AttributeType (HSPT XML m)]] -> [XMLGenT (HSPT XML m) [ChildType (HSPT XML m)]] -> XMLGenT (HSPT XML m) (XMLType (HSPT XML m)) Source # genEElement :: Name (StringType (HSPT XML m)) -> [XMLGenT (HSPT XML m) [AttributeType (HSPT XML m)]] -> XMLGenT (HSPT XML m) (XMLType (HSPT XML m)) Source # xmlToChild :: XMLType (HSPT XML m) -> ChildType (HSPT XML m) Source # pcdataToChild :: StringType (HSPT XML m) -> ChildType (HSPT XML m) Source # | |
(Functor m, Monad m) => AppendChild (HSPT XML m) XML Source # | |
(Functor m, Monad m) => SetAttr (HSPT XML m) XML Source # | |
(Monad m, Functor m) => EmbedAsAttr (HSPT XML m) Attribute Source # | |
(Functor m, Monad m) => EmbedAsChild (HSPT XML m) () Source # | |
(Functor m, Monad m) => EmbedAsChild (HSPT XML m) Char Source # | |
(Functor m, Monad m) => EmbedAsChild (HSPT XML m) Text Source # | |
(Functor m, Monad m) => EmbedAsChild (HSPT XML m) Text Source # | |
(Functor m, Monad m) => EmbedAsChild (HSPT XML m) String Source # | |
(Functor m, Monad m) => EmbedAsChild (HSPT XML m) XML Source # | |
(Functor m, Monad m) => EmbedAsChild (HSPT XML m) [XML] Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text ()) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text ()) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Int) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Int) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Bool) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Bool) Source # | |
(Monad m, Functor m) => EmbedAsAttr (HSPT XML m) (Attr Text Char) Source # | |
(Monad m, Functor m) => EmbedAsAttr (HSPT XML m) (Attr Text Char) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Text) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Text) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Text) Source # | |
(Functor m, Monad m) => EmbedAsAttr (HSPT XML m) (Attr Text Text) Source # | |
type XMLType (HSPT XML m) Source # | |
type StringType (HSPT XML m) Source # | |
Defined in HSP.Monad | |
newtype ChildType (HSPT XML m) Source # | |
newtype AttributeType (HSPT XML m) Source # | |
data XMLMetaData Source #
The XMLMetaData datatype
Specify the DOCTYPE, content-type, and preferred render for XML data.
See also: setMetaData
and withMetaData
Constructors
XMLMetaData | |
Fields
|
type Attributes = [Attribute] Source #
The Attribute type
Represents an attribue value.
Functions
fromStringLit :: String -> Text Source #