summaryrefslogtreecommitdiff
path: root/src/Text/XML/HaXml/Schema/Parse.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/XML/HaXml/Schema/Parse.hs')
-rw-r--r--src/Text/XML/HaXml/Schema/Parse.hs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/Text/XML/HaXml/Schema/Parse.hs b/src/Text/XML/HaXml/Schema/Parse.hs
index d3acfc2..d9e0336 100644
--- a/src/Text/XML/HaXml/Schema/Parse.hs
+++ b/src/Text/XML/HaXml/Schema/Parse.hs
@@ -253,6 +253,19 @@ schemaItem qual = oneOf'
, ("xsd:attributeGroup", fmap AttributeGroup (attributeGroup qual))
, ("xsd:group", fmap SchemaGroup (group_ qual))
-- , ("xsd:notation", notation)
+-- sigh
+ , ("xs:include", include)
+ , ("xs:import", import_)
+ , ("xs:redefine", (redefine qual))
+ , ("xs:annotation", fmap Annotation definiteAnnotation)
+ --
+ , ("xs:simpleType", fmap Simple (simpleType qual))
+ , ("xs:complexType", fmap Complex (complexType qual))
+ , ("xs:element", fmap SchemaElement (elementDecl qual))
+ , ("xs:attribute", fmap SchemaAttribute (attributeDecl qual))
+ , ("xs:attributeGroup", fmap AttributeGroup (attributeGroup qual))
+ , ("xs:group", fmap SchemaGroup (group_ qual))
+ -- , ("xs:notation", notation)
]
-- | Parse an <xsd:include>.
@@ -321,7 +334,7 @@ simpleType q = do
`apply` (return Restriction1 `apply` particle q)
restrictType a b = return (RestrictType a b)
`apply` (optional (simpleType q))
- `apply` many aFacet
+ `apply` many1 aFacet
aFacet :: XsdParser Facet
aFacet = foldr onFail (fail "Could not recognise simpleType Facet")
@@ -598,7 +611,10 @@ uri = string
-- | Text parser for an arbitrary string consisting of possibly multiple tokens.
string :: TextParser String
-string = fmap concat $ many word
+string = fmap concat $ many (space `onFail` word)
+
+space :: TextParser String
+space = many1 $ satisfy isSpace
-- | Parse a textual boolean, i.e. "true", "false", "0", or "1"
bool :: TextParser Bool