hxt-7.1: A collection of tools for processing XML with Haskell.ContentsIndex
Text.XML.HXT.RelaxNG.DataTypeLibUtils
Description
exports helper functions for the integration of new datatype-libraries
Synopsis
checkString :: DatatypeName -> String -> Int -> Int -> ParamList -> Maybe String
checkNumeric :: DatatypeName -> String -> Int -> Int -> ParamList -> Maybe String
errorMsgEqual :: DatatypeName -> String -> String -> String
module Text.XML.HXT.DOM.Util
module Text.XML.HXT.RelaxNG.Utils
module Text.XML.HXT.RelaxNG.DataTypes
Documentation
checkString :: DatatypeName -> String -> Int -> Int -> ParamList -> Maybe String

Tests whether a "string" datatype value is between the lower and upper bound of the datatype and matches all parameters.

All tests are performed on the string value.

  • 1.parameter : datatype
  • 2.parameter : datatype value
  • 3.parameter : lower bound of the datatype range
  • 4.parameter : upper bound of the datatype range (-1 = no upper bound)
  • 5.parameter : list of parameters
  • return : Just "Errormessage" in case of an error, else Nothing
checkNumeric :: DatatypeName -> String -> Int -> Int -> ParamList -> Maybe String

Tests whether a "numeric" datatype value is between the lower and upper bound of the datatype and matches all parameters.

First, the string value is parsed into a numeric representation. If no error occur, all following tests are performed on the numeric value.

  • 1.parameter : datatype
  • 2.parameter : datatype value
  • 3.parameter : lower bound of the datatype range
  • 4.parameter : upper bound of the datatype range (-1 = no upper bound)
  • 5.parameter : list of parameters
  • return : Just "Errormessage" in case of an error, else Nothing
errorMsgEqual :: DatatypeName -> String -> String -> String

Error Message for the equality test of two datatype values

  • 1.parameter : datatype
  • 2.parameter : datatype value
  • 3.parameter : datatype value

example:

 errorMsgEqual "Int" "21" "42" -> "Datatype Int with value = 21 expected, but value = 42 found"
module Text.XML.HXT.DOM.Util
module Text.XML.HXT.RelaxNG.Utils
module Text.XML.HXT.RelaxNG.DataTypes
Produced by Haddock version 0.8