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

Safe HaskellSafe
LanguageHaskell98

Text.XML.Basic.Name

Contents

Description

We provide a type class for tag and attribute names. Instances can be names that preserve case, names with lowercase letters as canonical representation.

Synopsis

types and classes

class Ord name => C name where #

Minimal complete definition

fromString, toString

Methods

fromString :: String -> name #

toString :: name -> String #

Instances

Attribute ident => C (Name ident) # 

Methods

fromString :: String -> Name ident #

toString :: Name ident -> String #

Tag ident => C (Name ident) # 

Methods

fromString :: String -> Name ident #

toString :: Name ident -> String #

class Ord ident => Tag ident where #

We need to distinguish between tag names and attribute names, because DOCTYPE as tag name must be written upper case, whereas as attribute name it may be written either way.

Minimal complete definition

tagFromString, tagToString

Methods

tagFromString :: String -> ident #

tagToString :: ident -> String #

Instances

Tag T # 
Tag T # 
Tag T # 

class Ord ident => Attribute ident where #

Minimal complete definition

attributeFromString, attributeToString

Methods

attributeFromString :: String -> ident #

attributeToString :: ident -> String #

convenience functions

match :: C name => String -> name -> Bool #

matchAny :: C name => [String] -> name -> Bool #