xml-basic-0.1.3.1: Basics for XML/HTML representation and processing

Safe HaskellSafe
LanguageHaskell98

Text.HTML.Basic.Tag

Description

We do not define a tag data type here, since this is too much bound to the particular use (e.g. list or tree structure). However we define a tag name and several

Synopsis

Documentation

newtype Name ident Source #

Constructors

Name 

Fields

Instances
Eq ident => Eq (Name ident) Source # 
Instance details

Defined in Text.XML.Basic.Tag

Methods

(==) :: Name ident -> Name ident -> Bool #

(/=) :: Name ident -> Name ident -> Bool #

Ord ident => Ord (Name ident) Source # 
Instance details

Defined in Text.XML.Basic.Tag

Methods

compare :: Name ident -> Name ident -> Ordering #

(<) :: Name ident -> Name ident -> Bool #

(<=) :: Name ident -> Name ident -> Bool #

(>) :: Name ident -> Name ident -> Bool #

(>=) :: Name ident -> Name ident -> Bool #

max :: Name ident -> Name ident -> Name ident #

min :: Name ident -> Name ident -> Name ident #

Show ident => Show (Name ident) Source # 
Instance details

Defined in Text.XML.Basic.Tag

Methods

showsPrec :: Int -> Name ident -> ShowS #

show :: Name ident -> String #

showList :: [Name ident] -> ShowS #

Tag ident => C (Name ident) Source # 
Instance details

Defined in Text.XML.Basic.Tag

Methods

fromString :: String -> Name ident Source #

toString :: Name ident -> String Source #

doctype :: Tag name => Name name Source #

Deprecated: use doctypeName instead

doctypeName :: Tag name => Name name Source #

cdata :: Tag name => Name name Source #

Deprecated: use cdataName instead

cdataName :: Tag name => Name name Source #

isEmpty :: Tag name => Name name -> Bool Source #

Check whether a HTML tag is empty.

isSloppy :: Tag name => Name name -> Bool Source #

Some tags, namely those for text styles like FONT, B, I, are used quite sloppily. That is, they are not terminated or not terminated in the right order. We close them implicitly, if another tag closes and ignore non-matching closing tags.

isInnerOf :: Tag name => Name name -> Name name -> Bool Source #

closes :: Tag name => Name name -> Name name -> Bool Source #

maybeMetaHTTPHeader :: (Tag name, Attribute name) => Name name -> [T name string] -> Maybe (string, string) Source #

maybeMetaEncoding :: (Tag name, Attribute name) => Name name -> [T name String] -> Maybe String Source #

A simple routine that does not check for valid syntax of the Content-Type specification.

In future we might use a distinct Encoding type instead of plain String.

maybeMetaCharset :: (Tag name, Attribute name) => Name name -> [T name string] -> Maybe string Source #

encodingFromContentType :: String -> String Source #

Extract charset from Content-Type declaration.

encodingFromContentType "text/html; charset=UTF-8" == "utf-8"

The routine does not perform any syntax check.