hxt-relaxng-9.1.5.5: The HXT RelaxNG validator

Safe Haskell | None
Language | Haskell98

Text.XML.HXT.RelaxNG.DataTypes

Synopsis

- relaxSchemaFile :: String
- relaxSchemaGrammarFile :: String
- a_numberOfErrors :: String
- a_relaxSimplificationChanges :: String
- a_output_changes :: String
- defineOrigName :: String
- type Env = [(String, XmlTree)]
- type PatternEnv = [(String, Pattern)]
- contextAttributes :: String
- contextAttributesDefault :: String
- contextBaseAttr :: String
- type OldName = String
- type NewName = String
- type NamePair = (OldName, NewName)
- type RefList = [NamePair]
- type DatatypeEqual = DatatypeName -> String -> Context -> String -> Context -> Maybe String
- type DatatypeAllows = DatatypeName -> ParamList -> String -> Context -> Maybe String
- type DatatypeLibraries = [DatatypeLibrary]
- type DatatypeLibrary = (Uri, DatatypeCheck)
- type DatatypeName = String
- type ParamName = String
- type AllowedParams = [ParamName]
- type AllowedDatatypes = [(DatatypeName, AllowedParams)]
- data DatatypeCheck = DTC {
  - dtAllowsFct :: DatatypeAllows
  - dtEqualFct :: DatatypeEqual
  - dtAllowedTypes :: AllowedDatatypes
  }
- type Uri = String
- type LocalName = String
- type ParamList = [(LocalName, String)]
- type Prefix = String
- type Context = (Uri, [(Prefix, Uri)])
- type Datatype = (Uri, LocalName)
- showDatatype :: Datatype -> String
- data NameClass
  - = AnyName
  - | AnyNameExcept NameClass
  - | Name Uri LocalName
  - | NsName Uri
  - | NsNameExcept Uri NameClass
  - | NameClassChoice NameClass NameClass
  - | NCError String
- data Pattern
  - = NotAllowed ErrMessage
  - | Empty
  - | Text
  - | Element NameClass Pattern
  - | Attribute NameClass Pattern
  - | Choice Pattern Pattern
  - | Interleave Pattern Pattern
  - | Group Pattern Pattern
  - | After Pattern Pattern
  - | OneOrMore Pattern
  - | Data Datatype ParamList
  - | DataExcept Datatype ParamList Pattern
  - | List Pattern
  - | Value Datatype String Context
- data Pattern'
  - = NotAllowed'
  - | Empty'
  - | Text'
  - | Element'
  - | Attribute'
  - | Data'
  - | DataExcept'
  - | List'
  - | Value'
  - | OneOrMore'
  - | Interleave'
  - | Group'
  - | After'
  - | Choice'
- ord' :: Pattern -> Pattern'
- equiv :: Pattern -> Pattern -> Bool
- gt :: Pattern -> Pattern -> Bool
- data ErrMessage = ErrMsg ErrLevel [String]
- type ErrLevel = Int
- notAllowed :: String -> Pattern
- notAllowed1 :: String -> Pattern
- notAllowed2 :: String -> Pattern
- notAllowedN :: ErrLevel -> String -> Pattern
- mergeNotAllowed :: Pattern -> Pattern -> Pattern
- choice :: Pattern -> Pattern -> Pattern
- group :: Pattern -> Pattern -> Pattern
- oneOrMore :: Pattern -> Pattern
- interleave :: Pattern -> Pattern -> Pattern
- after :: Pattern -> Pattern -> Pattern
- data ContentType
  - = CTEmpty
  - | CTComplex
  - | CTSimple
  - | CTNone

# Documentation

relaxSchemaFile :: String #

relaxSchemaGrammarFile :: String #

a_numberOfErrors :: String #

a_relaxSimplificationChanges :: String #

a_output_changes :: String #

defineOrigName :: String #

type Env = [(String, XmlTree)] #

type PatternEnv = [(String, Pattern)] #

contextAttributes :: String #

Start of a context attribute value (see also: `simplificationStep1`)

The value is always followed by the original attribute name and value

contextAttributesDefault :: String #

contextBaseAttr :: String #

Start of base uri attribute value (see also: `simplificationStep1` in Text.XML.HXT.RelaxNG.Simplification)

type OldName = String #

type NewName = String #

type NamePair = (OldName, NewName) #

type RefList = [NamePair] #

type DatatypeEqual = DatatypeName -> String -> Context -> String -> Context -> Maybe String #

Type of all datatype libraries functions that tests whether a XML instance value matches a value-pattern.

Returns Just "errorMessage" in case of an error else Nothing.

type DatatypeAllows = DatatypeName -> ParamList -> String -> Context -> Maybe String #

Type of all datatype libraries functions that tests whether a XML instance value matches a data-pattern.

Returns Just "errorMessage" in case of an error else Nothing.

type DatatypeLibraries = [DatatypeLibrary] #

List of all supported datatype libraries

type DatatypeLibrary = (Uri, DatatypeCheck) #

Each datatype library is identified by a URI.

type DatatypeName = String #

type ParamName = String #

type AllowedParams = [ParamName] #

List of all supported params for a datatype

type AllowedDatatypes = [(DatatypeName, AllowedParams)] #

List of all supported datatypes and there allowed params

data DatatypeCheck #

The Constructor exports the list of supported datatypes for a library. It also exports the specialized datatype library functions to validate a XML instance value with respect to a datatype.

Constructors

DTC |

Fields

- dtAllowsFct :: DatatypeAllows

  function to test whether a value matches a data-pattern

- dtEqualFct :: DatatypeEqual

  function to test whether a value matches a value-pattern

- dtAllowedTypes :: AllowedDatatypes

  list of all supported params for a datatype

type Uri = String #

type LocalName = String #

type ParamList = [(LocalName, String)] #

List of parameters; each parameter is a pair consisting of a local name and a value.

type Prefix = String #

type Context = (Uri, [(Prefix, Uri)]) #

A Context represents the context of an XML element. It consists of a base URI and a mapping from prefixes to namespace URIs.

type Datatype = (Uri, LocalName) #

A Datatype identifies a datatype by a datatype library name and a local name.

showDatatype :: Datatype -> String #

data NameClass #

Represents a name class

Constructors

AnyName |
AnyNameExcept NameClass |
Name Uri LocalName |
NsName Uri |
NsNameExcept Uri NameClass |
NameClassChoice NameClass NameClass |
NCError String |

#### Instances

Instances details

Show NameClass # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods showsPrec :: Int -> NameClass -> ShowS # show :: NameClass -> String # showList :: [NameClass] -> ShowS #
Eq NameClass # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods (==) :: NameClass -> NameClass -> Bool # (/=) :: NameClass -> NameClass -> Bool #
Ord NameClass # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods compare :: NameClass -> NameClass -> Ordering # (<) :: NameClass -> NameClass -> Bool # (<=) :: NameClass -> NameClass -> Bool # (>) :: NameClass -> NameClass -> Bool # (>=) :: NameClass -> NameClass -> Bool # max :: NameClass -> NameClass -> NameClass # min :: NameClass -> NameClass -> NameClass #

data Pattern #

Represents a pattern after simplification

Constructors

NotAllowed ErrMessage |
Empty |
Text |
Element NameClass Pattern |
Attribute NameClass Pattern |
Choice Pattern Pattern |
Interleave Pattern Pattern |
Group Pattern Pattern |
After Pattern Pattern |
OneOrMore Pattern |
Data Datatype ParamList |
DataExcept Datatype ParamList Pattern |
List Pattern |
Value Datatype String Context |

#### Instances

Instances details

Show Pattern # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods showsPrec :: Int -> Pattern -> ShowS # show :: Pattern -> String # showList :: [Pattern] -> ShowS #

data Pattern' #

Constructors

NotAllowed' |
Empty' |
Text' |
Element' |
Attribute' |
Data' |
DataExcept' |
List' |
Value' |
OneOrMore' |
Interleave' |
Group' |
After' |
Choice' |

#### Instances

Instances details

Eq Pattern' # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods (==) :: Pattern' -> Pattern' -> Bool # (/=) :: Pattern' -> Pattern' -> Bool #
Ord Pattern' # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods compare :: Pattern' -> Pattern' -> Ordering # (<) :: Pattern' -> Pattern' -> Bool # (<=) :: Pattern' -> Pattern' -> Bool # (>) :: Pattern' -> Pattern' -> Bool # (>=) :: Pattern' -> Pattern' -> Bool # max :: Pattern' -> Pattern' -> Pattern' # min :: Pattern' -> Pattern' -> Pattern' #

ord' :: Pattern -> Pattern' #

equiv :: Pattern -> Pattern -> Bool #

gt :: Pattern -> Pattern -> Bool #

data ErrMessage #

Constructors

ErrMsg ErrLevel [String] |

#### Instances

Instances details

Show ErrMessage # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods showsPrec :: Int -> ErrMessage -> ShowS # show :: ErrMessage -> String # showList :: [ErrMessage] -> ShowS #

type ErrLevel = Int #

notAllowed :: String -> Pattern #

smart constructor for NotAllowed

notAllowed1 :: String -> Pattern #

notAllowed2 :: String -> Pattern #

notAllowedN :: ErrLevel -> String -> Pattern #

mergeNotAllowed :: Pattern -> Pattern -> Pattern #

merge error messages

If error levels are different, the more important is taken, if level is 2 (max level) both error messages are taken else the 1. error mesage is taken

choice :: Pattern -> Pattern -> Pattern #

smart constructor for Choice

nexted choices are transformed into a sorted list

group :: Pattern -> Pattern -> Pattern #

smart constructor for Group

oneOrMore :: Pattern -> Pattern #

smart constructor for OneOrMore

interleave :: Pattern -> Pattern -> Pattern #

smart constructor for Interleave

nested interleaves are transformed into a sorted list

after :: Pattern -> Pattern -> Pattern #

smart constructor for After

data ContentType #

Possible content types of a Relax NG pattern. (see also chapter 7.2 in Relax NG specification)

Constructors

CTEmpty |
CTComplex |
CTSimple |
CTNone |

#### Instances

Instances details

Show ContentType # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods showsPrec :: Int -> ContentType -> ShowS # show :: ContentType -> String # showList :: [ContentType] -> ShowS #
Eq ContentType # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods (==) :: ContentType -> ContentType -> Bool # (/=) :: ContentType -> ContentType -> Bool #
Ord ContentType # |
Instance details Defined in Text.XML.HXT.RelaxNG.DataTypes Methods compare :: ContentType -> ContentType -> Ordering # (<) :: ContentType -> ContentType -> Bool # (<=) :: ContentType -> ContentType -> Bool # (>) :: ContentType -> ContentType -> Bool # (>=) :: ContentType -> ContentType -> Bool # max :: ContentType -> ContentType -> ContentType # min :: ContentType -> ContentType -> ContentType #