hxt-9.3.1.18: A collection of tools for processing XML with Haskell.

Copyright | Copyright (C) 2005 Uwe Schmidt
License | MIT
Maintainer | Uwe Schmidt (uwe@fh-wedel.de)
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell98

Text.XML.HXT.Arrow.Pickle.Schema

Description

Version : $Id$

Datatypes and functions for building a content model for XML picklers. A schema is part of every pickler and can be used to derive a corrensponding DTD (or Relax NG schema). This schema further enables checking the picklers.

Synopsis

- data Schema
  - = Any
  - | Seq {
    - sc_l :: [Schema]
    }
  - | Alt {
    - sc_l :: [Schema]
    }
  - | Rep {
    - sc_lb :: Int
    - sc_ub :: Int
    - sc_1 :: Schema
    }
  - | Element {
    - sc_n :: Name
    - sc_1 :: Schema
    }
  - | Attribute {
    - sc_n :: Name
    - sc_1 :: Schema
    }
  - | ElemRef {
    - sc_n :: Name
    }
  - | CharData {
    - sc_dt :: DataTypeDescr
    }
- type Name = String
- type Schemas = [Schema]
- data DataTypeDescr = DTDescr {
  - dtLib :: String
  - dtName :: String
  - dtParams :: Attributes
  }
- isScXsd :: (String -> Bool) -> Schema -> Bool
- isScFixed :: Schema -> Bool
- isScEnum :: Schema -> Bool
- isScElem :: Schema -> Bool
- isScAttr :: Schema -> Bool
- isScElemRef :: Schema -> Bool
- isScCharData :: Schema -> Bool
- isScSARE :: Schema -> Bool
- isScList :: Schema -> Bool
- isScOpt :: Schema -> Bool
- xsdParam :: String -> Schema -> String
- scDT :: String -> String -> Attributes -> Schema
- scDTxsd :: String -> Attributes -> Schema
- scString :: Schema
- scString1 :: Schema
- scFixed :: String -> Schema
- scEnum :: [String] -> Schema
- scNmtoken :: Schema
- scNmtokens :: Schema
- scEmpty :: Schema
- scSeq :: Schema -> Schema -> Schema
- scSeqs :: [Schema] -> Schema
- scNull :: Schema
- scAlt :: Schema -> Schema -> Schema
- scAlts :: [Schema] -> Schema
- scOption :: Schema -> Schema
- scList :: Schema -> Schema
- scList1 :: Schema -> Schema
- scOpt :: Schema -> Schema
- scRep :: Int -> Int -> Schema -> Schema
- scElem :: String -> Schema -> Schema
- scAttr :: String -> Schema -> Schema

# Documentation

data Schema Source #

The datatype for modelling the structure of an

Constructors

Any |
Seq |

Fields

- sc_l :: [Schema]

Alt |

Fields

- sc_l :: [Schema]

Rep |

Fields

- sc_lb :: Int
- sc_ub :: Int
- sc_1 :: Schema

Element |

Fields

- sc_n :: Name
- sc_1 :: Schema

Attribute |

Fields

- sc_n :: Name
- sc_1 :: Schema

ElemRef |

Fields

- sc_n :: Name

CharData |

Fields

- sc_dt :: DataTypeDescr

Instances

Eq Schema Source # |
Instance details Defined in Text.XML.HXT.Arrow.Pickle.Schema Methods (==) :: Schema -> Schema -> Bool Source # (/=) :: Schema -> Schema -> Bool Source #
Show Schema Source # |
Instance details Defined in Text.XML.HXT.Arrow.Pickle.Schema Methods showsPrec :: Int -> Schema -> ShowS Source # show :: Schema -> String Source # showList :: [Schema] -> ShowS Source #

type Name = String Source #

type Schemas = [Schema] Source #

data DataTypeDescr Source #

Constructors

DTDescr |

Fields

- dtLib :: String
- dtName :: String
- dtParams :: Attributes

Instances

Eq DataTypeDescr Source # |
Instance details Defined in Text.XML.HXT.Arrow.Pickle.Schema Methods (==) :: DataTypeDescr -> DataTypeDescr -> Bool Source # (/=) :: DataTypeDescr -> DataTypeDescr -> Bool Source #
Show DataTypeDescr Source # |
Instance details Defined in Text.XML.HXT.Arrow.Pickle.Schema Methods showsPrec :: Int -> DataTypeDescr -> ShowS Source # show :: DataTypeDescr -> String Source # showList :: [DataTypeDescr] -> ShowS Source #

isScXsd :: (String -> Bool) -> Schema -> Bool Source #

test: is schema a simple XML Schema datatype

isScFixed :: Schema -> Bool Source #

test: is type a fixed value attribute type

isScEnum :: Schema -> Bool Source #

isScElem :: Schema -> Bool Source #

isScAttr :: Schema -> Bool Source #

isScElemRef :: Schema -> Bool Source #

isScCharData :: Schema -> Bool Source #

isScSARE :: Schema -> Bool Source #

isScList :: Schema -> Bool Source #

isScOpt :: Schema -> Bool Source #

xsdParam :: String -> Schema -> String Source #

access an attribute of a descr of an atomic type

scDT :: String -> String -> Attributes -> Schema Source #

scDTxsd :: String -> Attributes -> Schema Source #

scString :: Schema Source #

scString1 :: Schema Source #

scFixed :: String -> Schema Source #

scEnum :: [String] -> Schema Source #

scNmtoken :: Schema Source #

scNmtokens :: Schema Source #

scEmpty :: Schema Source #

scSeq :: Schema -> Schema -> Schema Source #

scSeqs :: [Schema] -> Schema Source #

scNull :: Schema Source #

scAlt :: Schema -> Schema -> Schema Source #

scAlts :: [Schema] -> Schema Source #

scOption :: Schema -> Schema Source #

scList :: Schema -> Schema Source #

scList1 :: Schema -> Schema Source #

scOpt :: Schema -> Schema Source #

scRep :: Int -> Int -> Schema -> Schema Source #

scElem :: String -> Schema -> Schema Source #

scAttr :: String -> Schema -> Schema Source #