HaXml-1.25.5: Utilities for manipulating XML documents

Safe HaskellNone
LanguageHaskell98

Text.XML.HaXml.Schema.Schema

Synopsis

Documentation

class SchemaType a where #

A SchemaType promises to interconvert between a generic XML content tree and a Haskell value, according to the rules of XSD.

Instances
SchemaType Double # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Float # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Int # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Integer # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType PositiveInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType UnsignedByte # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType UnsignedShort # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType UnsignedInt # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType UnsignedLong # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NonNegativeInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Byte # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Short # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Long # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NegativeInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NonPositiveInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NMTOKENS # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NMTOKEN # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType ENTITIES # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType ENTITY # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType IDREFS # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType IDREF # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType ID # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NCName # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Name # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Language # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Token # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NormalizedString # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType GMonth # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType GDay # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType GMonthDay # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType GYear # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType GYearMonth # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Date # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Time # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType DateTime # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Duration # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Decimal # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType NOTATION # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType AnyURI # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType HexBinary # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Base64Binary # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType XsdString # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType Boolean # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

SchemaType AnyElement # 
Instance details

Defined in Text.XML.HaXml.Schema.Schema

class SimpleType a where #

Ultimately, an XML parser will find some plain text as the content of a simpleType, which will need to be parsed. We use a TextParser, because values of simpleTypes can also be given elsewhere, e.g. as attribute values in an XSD definition, e.g. to restrict the permissible values of the simpleType. Such restrictions are therefore implemented as layered parsers.

Instances
SimpleType Bool # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Double # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Float # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Int # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Integer # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType PositiveInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType UnsignedByte # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType UnsignedShort # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType UnsignedInt # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType UnsignedLong # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NonNegativeInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Byte # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Short # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Long # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NegativeInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NonPositiveInteger # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NMTOKENS # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NMTOKEN # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType ENTITIES # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType ENTITY # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType IDREFS # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType IDREF # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType ID # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NCName # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Name # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Language # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Token # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NormalizedString # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType GMonth # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType GDay # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType GMonthDay # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType GYear # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType GYearMonth # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Date # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Time # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType DateTime # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Duration # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Decimal # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType NOTATION # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType AnyURI # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType HexBinary # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType Base64Binary # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

SimpleType XsdString # 
Instance details

Defined in Text.XML.HaXml.Schema.PrimitiveTypes

class Extension t s where #

A type t can extend another type s by the addition of extra elements and/or attributes. s is therefore the supertype of t.

Methods

supertype :: t -> s #

class Restricts t s | t -> s where #

A type t can restrict another type s, that is, t admits fewer values than s, but all the values t does admit also belong to the type s.

Methods

restricts :: t -> s #

class FwdDecl fd a | fd -> a #

A trick to enable forward-declaration of a type that will be defined properly in another module, higher in the dependency graph. fd is a dummy type e.g. the empty data FwdA, where a is the proper data A, not yet available.

getAttribute :: (SimpleType a, Show a) => String -> Element Posn -> Posn -> XMLParser a #

Generated parsers will use getAttribute as a convenient wrapper to lift a SchemaAttribute parser into an XMLParser.

between :: PolyParse p => Occurs -> p a -> p [a] #

Between is a list parser that tries to ensure that any range specification (min and max elements) is obeyed when parsing.

data Occurs #

Constructors

Occurs (Maybe Int) (Maybe Int) 
Instances
Eq Occurs # 
Instance details

Defined in Text.XML.HaXml.Schema.XSDTypeModel

Methods

(==) :: Occurs -> Occurs -> Bool #

(/=) :: Occurs -> Occurs -> Bool #

Show Occurs # 
Instance details

Defined in Text.XML.HaXml.Schema.XSDTypeModel

Semigroup Occurs # 
Instance details

Defined in Text.XML.HaXml.Schema.TypeConversion

Monoid Occurs # 
Instance details

Defined in Text.XML.HaXml.Schema.TypeConversion

parseSimpleType :: SimpleType t => XMLParser t #

Given a TextParser for a SimpleType, make it into an XMLParser, i.e. consuming textual XML content as input rather than a String.

parseText :: XMLParser String #

Parse the textual part of mixed content

data AnyElement #

The xsd:any type. Parsing will always produce an UnconvertedANY.

data Content i #

Constructors

CElem (Element i) i 
CString Bool CharData i

bool is whether whitespace is significant

CRef Reference i 
CMisc Misc i 
Instances
Functor Content # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

fmap :: (a -> b) -> Content a -> Content b #

(<$) :: a -> Content b -> Content a #

Eq (Content i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Content i -> Content i -> Bool #

(/=) :: Content i -> Content i -> Bool #

Show i => Show (Content i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> Content i -> ShowS #

show :: Content i -> String #

showList :: [Content i] -> ShowS #

Verbatim (Content i) # 
Instance details

Defined in Text.XML.HaXml.Verbatim

Methods

verbatim :: Content i -> String #

type XMLParser a = Parser (Content Posn) a #

We need a parsing monad for reading generic XML Content into specific datatypes. This is a specialisation of the Text.ParserCombinators.Poly ones, where the input token type is fixed as XML Content.

posnElement :: [String] -> XMLParser (Posn, Element Posn) #

A specialisation of posnElementWith (==).

posnElementWith :: (String -> String -> Bool) -> [String] -> XMLParser (Posn, Element Posn) #

Get the next content element, checking that it has one of the required tags, using the given matching function. (Skips over comments and whitespace, rejects text and refs. Also returns position of element.)

element :: [String] -> XMLParser (Element Posn) #

Get the next content element, checking that it has one of the required tags. (Skips over comments and whitespace, rejects text and refs.)

interior :: Element Posn -> XMLParser a -> XMLParser a #

Run an XMLParser on the contents of the given element (i.e. not on the current monadic content sequence), checking that the contents are exhausted, before returning the calculated value within the current parser context.

text :: XMLParser String #

text is a counterpart to element, parsing text content if it exists. Adjacent text and references are coalesced.

module Text.Parse

toXMLElement :: String -> [[Attribute]] -> [[Content ()]] -> [Content ()] #

addXMLAttributes :: [[Attribute]] -> [Content ()] -> [Content ()] #

For a ComplexType that is an extension of a SimpleType, it is necessary to convert the value to XML first, then add in the extra attributes that constitute the extension.