Safe Haskell | Safe-Inferred |
---|
- (|||) :: (a -> Bool) -> (a -> Bool) -> a -> Bool
- xsd :: Name -> QName
- xsdTag :: String -> Content Posn -> Bool
- type XsdParser a = Parser (Content Posn) a
- posnElementWith :: (Content Posn -> Bool) -> [String] -> XsdParser (Posn, Element Posn)
- xsdElement :: Name -> XsdParser (Element Posn)
- anyElement :: XsdParser (Element Posn)
- allChildren :: XsdParser a -> XsdParser a
- interiorWith :: (Content Posn -> Bool) -> XsdParser a -> Element Posn -> XsdParser a
- attribute :: QName -> TextParser a -> Element Posn -> XsdParser a
- namespaceAttrs :: Element Posn -> XsdParser [Namespace]
- matchNamespace :: String -> Attribute -> Bool
- tidy :: t -> Result x a -> Result t a
- targetPrefix :: Maybe TargetNamespace -> [Namespace] -> Maybe String
- lookupBy :: (a -> Bool) -> [a] -> Maybe a
- qual :: Maybe TargetNamespace -> [Namespace] -> String -> String -> QName
- schema :: Parser (Content Posn) Schema
- annotation :: XsdParser Annotation
- definiteAnnotation :: XsdParser Annotation
- qform :: TextParser QForm
- final :: TextParser Final
- block :: TextParser Block
- schemaItem :: (String -> String -> QName) -> XsdParser SchemaItem
- include :: XsdParser SchemaItem
- import_ :: XsdParser SchemaItem
- redefine :: (String -> String -> QName) -> XsdParser SchemaItem
- simpleType :: (String -> String -> QName) -> XsdParser SimpleType
- aFacet :: XsdParser Facet
- facet :: String -> FacetType -> XsdParser Facet
- complexType :: (String -> String -> QName) -> XsdParser ComplexType
- complexItem :: (String -> String -> QName) -> XsdParser ComplexItem
- particle :: (String -> String -> QName) -> XsdParser Particle
- particleAttrs :: (String -> String -> QName) -> XsdParser ParticleAttrs
- choiceOrSeq :: (String -> String -> QName) -> XsdParser ChoiceOrSeq
- group_ :: (String -> String -> QName) -> XsdParser Group
- elementEtc :: (String -> String -> QName) -> XsdParser ElementEtc
- any_ :: XsdParser Any
- anyAttr :: XsdParser AnyAttr
- attributeGroup :: (String -> String -> QName) -> XsdParser AttrGroup
- elementDecl :: (String -> String -> QName) -> XsdParser ElementDecl
- nameAndType :: (String -> String -> QName) -> Element Posn -> XsdParser NameAndType
- attributeDecl :: (String -> String -> QName) -> XsdParser AttributeDecl
- occurs :: Element Posn -> XsdParser Occurs
- uniqueKeyOrKeyRef :: (String -> String -> QName) -> XsdParser UniqueKeyOrKeyRef
- unique :: XsdParser Unique
- key :: XsdParser Key
- keyRef :: (String -> String -> QName) -> XsdParser KeyRef
- selector :: XsdParser Selector
- field_ :: XsdParser Field
- uri :: TextParser String
- string :: TextParser String
- bool :: TextParser Bool
- use :: TextParser Use
- processContents :: TextParser ProcessContents
- qname :: (String -> String -> QName) -> TextParser QName
- name :: TextParser Name
Documentation
xsdTag :: String -> Content Posn -> BoolSource
Predicate for comparing against an XSD-qualified name. (Also accepts unqualified names, but this is probably a bit too lax. Doing it right would require checking to see whether the current schema module's default namespace is XSD or not.)
type XsdParser a = Parser (Content Posn) aSource
We need a Parser monad for reading from a sequence of generic XML Contents into specific datatypes that model the structure of XSD descriptions. This is a specialisation of the polyparse combinators, fixing the input token type.
posnElementWith :: (Content Posn -> Bool) -> [String] -> XsdParser (Posn, Element Posn)Source
Get the next content element, checking that it matches some criterion given by the predicate. (Skips over comments and whitespace, rejects text and refs. Also returns position of element.) The list of strings argument is for error reporting - it usually represents a list of expected tags.
xsdElement :: Name -> XsdParser (Element Posn)Source
Get the next content element, checking that it has the required tag belonging to the XSD namespace.
anyElement :: XsdParser (Element Posn)Source
Get the next content element, whatever it is.
allChildren :: XsdParser a -> XsdParser aSource
Grab and parse any and all children of the next element.
interiorWith :: (Content Posn -> Bool) -> XsdParser a -> Element Posn -> XsdParser aSource
Run an XsdParser on the child contents of the given element (i.e. not in the current monadic content sequence), filtering the children before parsing, and checking that the contents are exhausted, before returning the calculated value within the current parser context.
attribute :: QName -> TextParser a -> Element Posn -> XsdParser aSource
Check for the presence (and value) of an attribute in the given element. Absence results in failure.
namespaceAttrs :: Element Posn -> XsdParser [Namespace]Source
Grab any attributes that declare a locally-used prefix for a specific namespace.
matchNamespace :: String -> Attribute -> BoolSource
Predicate for whether an attribute belongs to a given namespace.
targetPrefix :: Maybe TargetNamespace -> [Namespace] -> Maybe StringSource
Given a URI for a targetNamespace, and a list of Namespaces, tell me the prefix corresponding to the targetNamespace.
qual :: Maybe TargetNamespace -> [Namespace] -> String -> String -> QNameSource
Turn a qualified attribute value (two strings) into a qualified name (QName), but excluding the case where the namespace prefix corresponds to the targetNamespace of the current schema document.
annotation :: XsdParser AnnotationSource
Parse a (possibly missing) xsd:annotation element.
definiteAnnotation :: XsdParser AnnotationSource
Parse a definitely-occurring xsd:annotation element.
qform :: TextParser QFormSource
Parse a FormDefault attribute.
final :: TextParser FinalSource
Parse a Final or Block attribute.
schemaItem :: (String -> String -> QName) -> XsdParser SchemaItemSource
Parse a schema item (just under the toplevel xsd:schema)
include :: XsdParser SchemaItemSource
Parse an xsd:include.
import_ :: XsdParser SchemaItemSource
Parse an xsd:import.
redefine :: (String -> String -> QName) -> XsdParser SchemaItemSource
Parse a xsd:redefine.
simpleType :: (String -> String -> QName) -> XsdParser SimpleTypeSource
Parse a xsd:simpleType decl.
complexType :: (String -> String -> QName) -> XsdParser ComplexTypeSource
Parse a xsd:complexType decl.
complexItem :: (String -> String -> QName) -> XsdParser ComplexItemSource
Parse the alternative contents of a xsd:complexType decl.
particleAttrs :: (String -> String -> QName) -> XsdParser ParticleAttrsSource
Parse a particle decl with optional attributes.
choiceOrSeq :: (String -> String -> QName) -> XsdParser ChoiceOrSeqSource
Parse an xsd:all, xsd:choice, or xsd:sequence decl.
elementEtc :: (String -> String -> QName) -> XsdParser ElementEtcSource
Parse an xsd:element, xsd:group, xsd:all, xsd:choice, xsd:sequence or xsd:any.
anyAttr :: XsdParser AnyAttrSource
Parse an xsd:anyAttribute.
attributeGroup :: (String -> String -> QName) -> XsdParser AttrGroupSource
Parse an xsd:attributegroup.
elementDecl :: (String -> String -> QName) -> XsdParser ElementDeclSource
Parse an xsd:element decl.
nameAndType :: (String -> String -> QName) -> Element Posn -> XsdParser NameAndTypeSource
Parse name and type attributes.
attributeDecl :: (String -> String -> QName) -> XsdParser AttributeDeclSource
Parse an xsd:attribute decl.
occurs :: Element Posn -> XsdParser OccursSource
Parse an occurrence range from attributes of given element.
uniqueKeyOrKeyRef :: (String -> String -> QName) -> XsdParser UniqueKeyOrKeyRefSource
Parse a xsd:unique, xsd:key, or xsd:keyref.
unique :: XsdParser UniqueSource
Parse a xsd:unique.
selector :: XsdParser SelectorSource
Parse a xsd:selector.
uri :: TextParser StringSource
Text parser for a URI (very simple, non-validating, probably incorrect).
string :: TextParser StringSource
Text parser for an arbitrary string consisting of possibly multiple tokens.
Parse a use attribute value, i.e. required, optional, or prohibited
processContents :: TextParser ProcessContentsSource
Parse a processContents attribute, i.e. skip, lax, or strict.
qname :: (String -> String -> QName) -> TextParser QNameSource
Parse an attribute value that should be a QName.
Parse an attribute value that should be a simple Name.