xml-basic-0.1.2: 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 Source #

Minimal complete definition

fromString, toString

Methods

fromString :: String -> name Source #

toString :: name -> String Source #

Instances

Attribute ident => C (Name ident) Source # 

Methods

fromString :: String -> Name ident Source #

toString :: Name ident -> String Source #

Tag ident => C (Name ident) Source # 

Methods

fromString :: String -> Name ident Source #

toString :: Name ident -> String Source #

class Ord ident => Tag ident where Source #

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 Source #

tagToString :: ident -> String Source #

convenience functions

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

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