HaXml-1.25.5: 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 #

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 #

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

Instances

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

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.

Methods

acceptingParser :: TextParser a #

simpleTypeText :: a -> String #

Instances

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

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 Methods showsPrec :: Int -> Occurs -> ShowS # show :: Occurs -> String # showList :: [Occurs] -> ShowS #
Semigroup Occurs # |
Instance details Defined in Text.XML.HaXml.Schema.TypeConversion Methods (<>) :: Occurs -> Occurs -> Occurs # sconcat :: NonEmpty Occurs -> Occurs # stimes :: Integral b => b -> Occurs -> Occurs #
Monoid Occurs # |
Instance details Defined in Text.XML.HaXml.Schema.TypeConversion Methods mempty :: Occurs # mappend :: Occurs -> Occurs -> Occurs # mconcat :: [Occurs] -> Occurs #

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.

Constructors

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

Instances

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

parseAnyElement :: XMLParser AnyElement #

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.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 ()] #

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.