HaXml-1.25.14: Utilities for manipulating XML documents

Safe Haskell | None
Language | Haskell98

Text.XML.HaXml.Schema.Schema

Synopsis

- class SchemaType a where
  - parseSchemaType :: String -> XMLParser a
  - schemaTypeToXML :: String -> a -> [Content ()]
- class SimpleType a where
  - acceptingParser :: TextParser a
  - simpleTypeText :: a -> String
- class Extension t s where
  - supertype :: t -> s
- class Restricts t s | t -> s where
  - restricts :: t -> s
- class FwdDecl fd a | fd -> a
- getAttribute :: (SimpleType a, Show a) => String -> Element Posn -> Posn -> XMLParser a
- between :: PolyParse p => Occurs -> p a -> p [a]
- data Occurs = Occurs (Maybe Int) (Maybe Int)
- parseSimpleType :: SimpleType t => XMLParser t
- parseText :: XMLParser String
- data AnyElement
  - = (SchemaType a, Show a) => ANYSchemaType a
  - | UnconvertedANY (Content Posn)
- parseAnyElement :: XMLParser AnyElement
- data Content i
  - = CElem (Element i) i
  - | CString Bool CharData i
  - | CRef Reference i
  - | CMisc Misc i
- type XMLParser a = Parser (Content Posn) a
- posnElement :: [String] -> XMLParser (Posn, Element Posn)
- posnElementWith :: (String -> String -> Bool) -> [String] -> XMLParser (Posn, Element Posn)
- element :: [String] -> XMLParser (Element Posn)
- interior :: Element Posn -> XMLParser a -> XMLParser a
- text :: XMLParser String
- module Text.ParserCombinators.Poly
- module Text.Parse
- module Text.XML.HaXml.OneOfN
- toXMLElement :: String -> [[Attribute]] -> [[Content ()]] -> [Content ()]
- toXMLText :: String -> [Content ()]
- toXMLAnyElement :: AnyElement -> [Content ()]
- toXMLAttribute :: SimpleType a => String -> a -> [Attribute]
- addXMLAttributes :: [[Attribute]] -> [Content ()] -> [Content ()]

# Documentation

class SchemaType a where Source #

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

Methods

parseSchemaType :: String -> XMLParser a Source #

schemaTypeToXML :: String -> a -> [Content ()] Source #

#### Instances

Instances details

SchemaType AnyURI Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser AnyURI Source # schemaTypeToXML :: String -> AnyURI -> [Content ()] Source #
SchemaType Base64Binary Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Base64Binary Source # schemaTypeToXML :: String -> Base64Binary -> [Content ()] Source #
SchemaType Boolean Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Boolean Source # schemaTypeToXML :: String -> Boolean -> [Content ()] Source #
SchemaType Byte Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Byte Source # schemaTypeToXML :: String -> Byte -> [Content ()] Source #
SchemaType Date Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Date Source # schemaTypeToXML :: String -> Date -> [Content ()] Source #
SchemaType DateTime Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser DateTime Source # schemaTypeToXML :: String -> DateTime -> [Content ()] Source #
SchemaType Decimal Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Decimal Source # schemaTypeToXML :: String -> Decimal -> [Content ()] Source #
SchemaType Duration Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Duration Source # schemaTypeToXML :: String -> Duration -> [Content ()] Source #
SchemaType ENTITIES Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser ENTITIES Source # schemaTypeToXML :: String -> ENTITIES -> [Content ()] Source #
SchemaType ENTITY Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser ENTITY Source # schemaTypeToXML :: String -> ENTITY -> [Content ()] Source #
SchemaType GDay Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser GDay Source # schemaTypeToXML :: String -> GDay -> [Content ()] Source #
SchemaType GMonth Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser GMonth Source # schemaTypeToXML :: String -> GMonth -> [Content ()] Source #
SchemaType GMonthDay Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser GMonthDay Source # schemaTypeToXML :: String -> GMonthDay -> [Content ()] Source #
SchemaType GYear Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser GYear Source # schemaTypeToXML :: String -> GYear -> [Content ()] Source #
SchemaType GYearMonth Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser GYearMonth Source # schemaTypeToXML :: String -> GYearMonth -> [Content ()] Source #
SchemaType HexBinary Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser HexBinary Source # schemaTypeToXML :: String -> HexBinary -> [Content ()] Source #
SchemaType ID Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser ID Source # schemaTypeToXML :: String -> ID -> [Content ()] Source #
SchemaType IDREF Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser IDREF Source # schemaTypeToXML :: String -> IDREF -> [Content ()] Source #
SchemaType IDREFS Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser IDREFS Source # schemaTypeToXML :: String -> IDREFS -> [Content ()] Source #
SchemaType Language Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Language Source # schemaTypeToXML :: String -> Language -> [Content ()] Source #
SchemaType Long Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Long Source # schemaTypeToXML :: String -> Long -> [Content ()] Source #
SchemaType NCName Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NCName Source # schemaTypeToXML :: String -> NCName -> [Content ()] Source #
SchemaType NMTOKEN Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NMTOKEN Source # schemaTypeToXML :: String -> NMTOKEN -> [Content ()] Source #
SchemaType NMTOKENS Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NMTOKENS Source # schemaTypeToXML :: String -> NMTOKENS -> [Content ()] Source #
SchemaType NOTATION Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NOTATION Source # schemaTypeToXML :: String -> NOTATION -> [Content ()] Source #
SchemaType Name Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Name Source # schemaTypeToXML :: String -> Name -> [Content ()] Source #
SchemaType NegativeInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NegativeInteger Source # schemaTypeToXML :: String -> NegativeInteger -> [Content ()] Source #
SchemaType NonNegativeInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NonNegativeInteger Source # schemaTypeToXML :: String -> NonNegativeInteger -> [Content ()] Source #
SchemaType NonPositiveInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NonPositiveInteger Source # schemaTypeToXML :: String -> NonPositiveInteger -> [Content ()] Source #
SchemaType NormalizedString Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser NormalizedString Source # schemaTypeToXML :: String -> NormalizedString -> [Content ()] Source #
SchemaType PositiveInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser PositiveInteger Source # schemaTypeToXML :: String -> PositiveInteger -> [Content ()] Source #
SchemaType Short Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Short Source # schemaTypeToXML :: String -> Short -> [Content ()] Source #
SchemaType Time Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Time Source # schemaTypeToXML :: String -> Time -> [Content ()] Source #
SchemaType Token Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Token Source # schemaTypeToXML :: String -> Token -> [Content ()] Source #
SchemaType UnsignedByte Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser UnsignedByte Source # schemaTypeToXML :: String -> UnsignedByte -> [Content ()] Source #
SchemaType UnsignedInt Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser UnsignedInt Source # schemaTypeToXML :: String -> UnsignedInt -> [Content ()] Source #
SchemaType UnsignedLong Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser UnsignedLong Source # schemaTypeToXML :: String -> UnsignedLong -> [Content ()] Source #
SchemaType UnsignedShort Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser UnsignedShort Source # schemaTypeToXML :: String -> UnsignedShort -> [Content ()] Source #
SchemaType XsdString Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser XsdString Source # schemaTypeToXML :: String -> XsdString -> [Content ()] Source #
SchemaType AnyElement Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser AnyElement Source # schemaTypeToXML :: String -> AnyElement -> [Content ()] Source #
SchemaType Integer Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Integer Source # schemaTypeToXML :: String -> Integer -> [Content ()] Source #
SchemaType Double Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Double Source # schemaTypeToXML :: String -> Double -> [Content ()] Source #
SchemaType Float Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Float Source # schemaTypeToXML :: String -> Float -> [Content ()] Source #
SchemaType Int Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser Int Source # schemaTypeToXML :: String -> Int -> [Content ()] Source #

class SimpleType a where Source #

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.

Methods

acceptingParser :: TextParser a Source #

simpleTypeText :: a -> String Source #

#### Instances

Instances details

SimpleType AnyURI Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser AnyURI Source # simpleTypeText :: AnyURI -> String Source #
SimpleType Base64Binary Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Base64Binary Source # simpleTypeText :: Base64Binary -> String Source #
SimpleType Byte Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Byte Source # simpleTypeText :: Byte -> String Source #
SimpleType Date Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Date Source # simpleTypeText :: Date -> String Source #
SimpleType DateTime Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser DateTime Source # simpleTypeText :: DateTime -> String Source #
SimpleType Decimal Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Decimal Source # simpleTypeText :: Decimal -> String Source #
SimpleType Duration Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Duration Source # simpleTypeText :: Duration -> String Source #
SimpleType ENTITIES Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser ENTITIES Source # simpleTypeText :: ENTITIES -> String Source #
SimpleType ENTITY Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser ENTITY Source # simpleTypeText :: ENTITY -> String Source #
SimpleType GDay Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser GDay Source # simpleTypeText :: GDay -> String Source #
SimpleType GMonth Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser GMonth Source # simpleTypeText :: GMonth -> String Source #
SimpleType GMonthDay Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser GMonthDay Source # simpleTypeText :: GMonthDay -> String Source #
SimpleType GYear Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser GYear Source # simpleTypeText :: GYear -> String Source #
SimpleType GYearMonth Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser GYearMonth Source # simpleTypeText :: GYearMonth -> String Source #
SimpleType HexBinary Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser HexBinary Source # simpleTypeText :: HexBinary -> String Source #
SimpleType ID Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser ID Source # simpleTypeText :: ID -> String Source #
SimpleType IDREF Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser IDREF Source # simpleTypeText :: IDREF -> String Source #
SimpleType IDREFS Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser IDREFS Source # simpleTypeText :: IDREFS -> String Source #
SimpleType Language Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Language Source # simpleTypeText :: Language -> String Source #
SimpleType Long Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Long Source # simpleTypeText :: Long -> String Source #
SimpleType NCName Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NCName Source # simpleTypeText :: NCName -> String Source #
SimpleType NMTOKEN Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NMTOKEN Source # simpleTypeText :: NMTOKEN -> String Source #
SimpleType NMTOKENS Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NMTOKENS Source # simpleTypeText :: NMTOKENS -> String Source #
SimpleType NOTATION Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NOTATION Source # simpleTypeText :: NOTATION -> String Source #
SimpleType Name Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Name Source # simpleTypeText :: Name -> String Source #
SimpleType NegativeInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NegativeInteger Source # simpleTypeText :: NegativeInteger -> String Source #
SimpleType NonNegativeInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NonNegativeInteger Source # simpleTypeText :: NonNegativeInteger -> String Source #
SimpleType NonPositiveInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NonPositiveInteger Source # simpleTypeText :: NonPositiveInteger -> String Source #
SimpleType NormalizedString Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser NormalizedString Source # simpleTypeText :: NormalizedString -> String Source #
SimpleType PositiveInteger Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser PositiveInteger Source # simpleTypeText :: PositiveInteger -> String Source #
SimpleType Short Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Short Source # simpleTypeText :: Short -> String Source #
SimpleType Time Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Time Source # simpleTypeText :: Time -> String Source #
SimpleType Token Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Token Source # simpleTypeText :: Token -> String Source #
SimpleType UnsignedByte Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser UnsignedByte Source # simpleTypeText :: UnsignedByte -> String Source #
SimpleType UnsignedInt Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser UnsignedInt Source # simpleTypeText :: UnsignedInt -> String Source #
SimpleType UnsignedLong Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser UnsignedLong Source # simpleTypeText :: UnsignedLong -> String Source #
SimpleType UnsignedShort Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser UnsignedShort Source # simpleTypeText :: UnsignedShort -> String Source #
SimpleType XsdString Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser XsdString Source # simpleTypeText :: XsdString -> String Source #
SimpleType Integer Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Integer Source # simpleTypeText :: Integer -> String Source #
SimpleType Bool Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Bool Source # simpleTypeText :: Bool -> String Source #
SimpleType Double Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Double Source # simpleTypeText :: Double -> String Source #
SimpleType Float Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Float Source # simpleTypeText :: Float -> String Source #
SimpleType Int Source # |
Instance details Defined in Text.XML.HaXml.Schema.PrimitiveTypes Methods acceptingParser :: TextParser Int Source # simpleTypeText :: Int -> String Source #

class Extension t s where Source #

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 Source #

class Restricts t s | t -> s where Source #

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 Source #

class FwdDecl fd a | fd -> a Source #

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 Source #

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] Source #

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

data Occurs Source #

Constructors

Occurs (Maybe Int) (Maybe Int) |

#### Instances

Instances details

Monoid Occurs Source # |
Instance details Defined in Text.XML.HaXml.Schema.TypeConversion Methods mempty :: Occurs Source # mappend :: Occurs -> Occurs -> Occurs Source # mconcat :: [Occurs] -> Occurs Source #
Semigroup Occurs Source # |
Instance details Defined in Text.XML.HaXml.Schema.TypeConversion Methods (<>) :: Occurs -> Occurs -> Occurs Source # sconcat :: NonEmpty Occurs -> Occurs Source # stimes :: Integral b => b -> Occurs -> Occurs Source #
Show Occurs Source # |
Instance details Defined in Text.XML.HaXml.Schema.XSDTypeModel Methods showsPrec :: Int -> Occurs -> ShowS Source # show :: Occurs -> String Source # showList :: [Occurs] -> ShowS Source #
Eq Occurs Source # |
Instance details Defined in Text.XML.HaXml.Schema.XSDTypeModel Methods (==) :: Occurs -> Occurs -> Bool Source # (/=) :: Occurs -> Occurs -> Bool Source #

parseSimpleType :: SimpleType t => XMLParser t Source #

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 Source #

Parse the textual part of mixed content

data AnyElement Source #

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

Constructors

(SchemaType a, Show a) => ANYSchemaType a |
UnconvertedANY (Content Posn) |

#### Instances

Instances details

SchemaType AnyElement Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods parseSchemaType :: String -> XMLParser AnyElement Source # schemaTypeToXML :: String -> AnyElement -> [Content ()] Source #
Show AnyElement Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods showsPrec :: Int -> AnyElement -> ShowS Source # show :: AnyElement -> String Source # showList :: [AnyElement] -> ShowS Source #
Eq AnyElement Source # |
Instance details Defined in Text.XML.HaXml.Schema.Schema Methods (==) :: AnyElement -> AnyElement -> Bool Source # (/=) :: AnyElement -> AnyElement -> Bool Source #

parseAnyElement :: XMLParser AnyElement Source #

data Content i Source #

Constructors

CElem (Element i) i |
CString Bool CharData i | bool is whether whitespace is significant
CRef Reference i |
CMisc Misc i |

#### Instances

Instances details

Functor Content Source # |
Instance details Defined in Text.XML.HaXml.Types Methods fmap :: (a -> b) -> Content a -> Content b Source # (<$) :: a -> Content b -> Content a Source #
Verbatim (Content i) Source # |
Instance details Defined in Text.XML.HaXml.Verbatim Methods verbatim :: Content i -> String Source #
Show i => Show (Content i) Source # |
Instance details Defined in Text.XML.HaXml.Types Methods showsPrec :: Int -> Content i -> ShowS Source # show :: Content i -> String Source # showList :: [Content i] -> ShowS Source #
Eq (Content i) Source # |
Instance details Defined in Text.XML.HaXml.Types Methods (==) :: Content i -> Content i -> Bool Source # (/=) :: Content i -> Content i -> Bool Source #

type XMLParser a = Parser (Content Posn) a Source #

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) Source #

A specialisation of `posnElementWith (==)`.

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

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) Source #

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 Source #

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 Source #

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

module Text.ParserCombinators.Poly

module Text.Parse

module Text.XML.HaXml.OneOfN

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

toXMLText :: String -> [Content ()] Source #

toXMLAnyElement :: AnyElement -> [Content ()] Source #

toXMLAttribute :: SimpleType a => String -> a -> [Attribute] Source #

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

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.