xml-1.3.14: A simple XML library.

Safe Haskell | Safe-Inferred
Language | Haskell98

Text.XML.Light.Lexer

Synopsis

- class XmlSource s where
  - uncons :: s -> Maybe (Char, s)
- linenumber :: XmlSource s => Integer -> s -> LString
- data Scanner s = Scanner (Maybe (Char, s)) (s -> Maybe (Char, s))
- customScanner :: (s -> Maybe (Char, s)) -> s -> Scanner s
- type LChar = (Line, Char)
- type LString = [LChar]
- data Token
  - = TokStart Line QName [Attr] Bool
  - | TokEnd Line QName
  - | TokCRef String
  - | TokText CData
- tokens :: XmlSource source => source -> [Token]
- tokens' :: LString -> [Token]
- special :: LChar -> LString -> [Token]
- qualName :: LString -> (QName, LString)
- tag :: LString -> [Token]
- attribs :: LString -> ([Attr], Bool, [Token])
- attrib :: LString -> (Attr, LString)
- attr_val :: LString -> (String, LString)
- dropSpace :: LString -> LString
- string :: LString -> (String, LString)
- break' :: (a -> Bool) -> [(b, a)] -> ([a], [(b, a)])
- breakn :: (a -> Bool) -> [(b, a)] -> ([a], [(b, a)])
- decode_attr :: String -> String
- data Txt
  - = TxtBit String
  - | CRefBit String
- decode_text :: [Char] -> [Txt]
- cref_to_char :: [Char] -> Maybe Char
- num_esc :: String -> Maybe Char
- cvt_char :: Int -> Maybe Char

# Documentation

class XmlSource s where #

Methods

uncons :: s -> Maybe (Char, s) #

#### Instances

Instances details

XmlSource String # |
Instance details Defined in Text.XML.Light.Lexer Methods uncons :: String -> Maybe (Char, String) #
XmlSource ByteString # |
Instance details Defined in Text.XML.Light.Lexer Methods uncons :: ByteString -> Maybe (Char, ByteString) #
XmlSource ByteString # |
Instance details Defined in Text.XML.Light.Lexer Methods uncons :: ByteString -> Maybe (Char, ByteString) #
XmlSource Text # |
Instance details Defined in Text.XML.Light.Lexer Methods uncons :: Text -> Maybe (Char, Text) #
XmlSource Text # |
Instance details Defined in Text.XML.Light.Lexer Methods uncons :: Text -> Maybe (Char, Text) #
XmlSource (Scanner s) # |
Instance details Defined in Text.XML.Light.Lexer Methods uncons :: Scanner s -> Maybe (Char, Scanner s) #

linenumber :: XmlSource s => Integer -> s -> LString #

data Scanner s #

This type may be used to provide a custom scanning function for extracting characters.

Constructors

Scanner (Maybe (Char, s)) (s -> Maybe (Char, s)) |

#### Instances

Instances details

XmlSource (Scanner s) # |
Instance details Defined in Text.XML.Light.Lexer Methods uncons :: Scanner s -> Maybe (Char, Scanner s) #

customScanner :: (s -> Maybe (Char, s)) -> s -> Scanner s #

This type may be used to provide a custom scanning function for extracting characters.

type LChar = (Line, Char) #

type LString = [LChar] #

data Token #

Constructors

TokStart Line QName [Attr] Bool |
TokEnd Line QName |
TokCRef String |
TokText CData |

#### Instances

Instances details

Show Token # |
Instance details Defined in Text.XML.Light.Lexer Methods showsPrec :: Int -> Token -> ShowS # show :: Token -> String # showList :: [Token] -> ShowS #

tokens :: XmlSource source => source -> [Token] #

tokens' :: LString -> [Token] #

special :: LChar -> LString -> [Token] #

qualName :: LString -> (QName, LString) #

tag :: LString -> [Token] #

attribs :: LString -> ([Attr], Bool, [Token]) #

attrib :: LString -> (Attr, LString) #

attr_val :: LString -> (String, LString) #

dropSpace :: LString -> LString #

string :: LString -> (String, LString) #

Match the value for an attribute. For malformed XML we do our best to guess the programmer's intention.

break' :: (a -> Bool) -> [(b, a)] -> ([a], [(b, a)]) #

breakn :: (a -> Bool) -> [(b, a)] -> ([a], [(b, a)]) #

decode_attr :: String -> String #

data Txt #

Constructors

TxtBit String |
CRefBit String |

#### Instances

Instances details

Show Txt # |
Instance details Defined in Text.XML.Light.Lexer Methods showsPrec :: Int -> Txt -> ShowS # show :: Txt -> String # showList :: [Txt] -> ShowS #

decode_text :: [Char] -> [Txt] #

cref_to_char :: [Char] -> Maybe Char #

num_esc :: String -> Maybe Char #

cvt_char :: Int -> Maybe Char #