git.iko.soy/typeable/xsd-parser
on fb680f3 help sign in
7 files changed+181−307
since splitsnapshots
unifiedsplit
src/Xsd.hs+1−1 src/Xsd/Parser.hs+30−81 src/Xsd/Types.hs+18−53 test/Spec.hs+13−15 xsd-parser.cabal+1−1 xsts-test/Main.hs+23−61 xsts.md+95−95
src/Xsd.hs+1−1
@@ -113,7 +113,7 @@ xsdToSchema xsd = Schema
113113 go res [] = res
114114 go (ts, es) (c:cs) = case c of
115115 ChildType n t -> go ((n, t):ts, es) cs
116− ChildElement (Inline e) -> go (ts, (elementName e, e):es) cs
116+ ChildElement e -> go (ts, (elementName e, e):es) cs
117117 _ -> go (ts, es) cs
118118
119119fetchXsd :: URI -> IO Xsd
src/Xsd/Parser.hs+30−81
@@ -48,7 +48,7 @@ parseChild :: Cursor -> P (Maybe Xsd.Child)
4848parseChild c = do
4949 name <- getElementName c
5050 case name of
51− "element" -> Just . Xsd.ChildElement <$> parseElementOrRef c
51+ "element" -> Just . Xsd.ChildElement <$> parseElement c
5252 "simpleType" -> Just <$> parseTopSimpleType c
5353 "complexType" -> Just <$> parseTopComplexType c
5454 "include" -> Just . Xsd.ChildInclude <$> parseInclude c
@@ -81,12 +81,6 @@ parseImport c = do
8181 , Xsd.importNamespace = namespace
8282 }
8383
84−parseElementOrRef :: Cursor -> P (Xsd.RefOr Xsd.Element)
85−parseElementOrRef c = do
86− case anAttribute "ref" c of
87− Nothing -> Xsd.Inline <$> parseElement c
88− Just ref -> Xsd.Ref <$> makeQName c ref
89−
9084parseElement :: Cursor -> P Xsd.Element
9185parseElement c = handleNamespaces c $ do
9286 name <- theAttribute "name" c
@@ -160,19 +154,18 @@ parseSimpleType c = do
160154 unionAxis <- makeElemAxis "union"
161155 case (c $/ restrictionAxis, c $/ listAxis, c $/ unionAxis) of
162156 ([e], [], []) -> Xsd.AtomicType
163− <$> parseSimpleRestriction e
157+ <$> parseRestriction e
164158 <*> parseAnnotations c
165159 ([], [l], []) -> Xsd.ListType
166160 <$> parseList l
167161 <*> parseAnnotations c
168− ([], [], [u]) -> Xsd.UnionType
169− <$> parseUnion u
170− <*> parseAnnotations c
162+ -- TODO implement me
163+ ([], [], [_]) -> parseError c "Not implemented: union"
171164 _ -> parseError c "Expected exactly of of restriction, list or union"
172165
173166-- | Restriction for simple type
174−parseSimpleRestriction :: Cursor -> P Xsd.SimpleRestriction
175−parseSimpleRestriction c = do
167+parseRestriction :: Cursor -> P Xsd.Restriction
168+parseRestriction c = do
176169 -- XXX: generalaze RefOr parsing
177170 tp <- case anAttribute "base" c of
178171 Nothing -> do
@@ -185,9 +178,9 @@ parseSimpleRestriction c = do
185178
186179 constraints <- parseConstrains c
187180
188− return Xsd.SimpleRestriction
189− { Xsd.simpleRestrictionBase = tp
190− , Xsd.simpleRestrictionConstraints = constraints
181+ return Xsd.Restriction
182+ { Xsd.restrictionBase = tp
183+ , Xsd.restrictionConstraints = constraints
191184 }
192185
193186parseConstrains :: Cursor -> P [Xsd.Constraint]
@@ -208,15 +201,6 @@ parseList c =
208201 _ -> parseError c "Multiple types"
209202 Just t -> Xsd.Ref <$> makeQName c t
210203
211−parseUnion :: Cursor -> P [Xsd.RefOr Xsd.SimpleType]
212−parseUnion c =
213− case anAttribute "memberTypes" c of
214− Just list ->
215− mapM (fmap Xsd.Ref . makeQName c) (Text.splitOn " " list)
216− Nothing -> do
217− simpleTypeAxis <- makeElemAxis "simpleType"
218− mapM (fmap Xsd.Inline . parseSimpleType) (c $/ simpleTypeAxis)
219−
220204parseComplexType :: Cursor -> P Xsd.ComplexType
221205parseComplexType c = do
222206 annotations <- parseAnnotations c
@@ -247,29 +231,14 @@ parsePlainContent c = do
247231 }
248232
249233parseSimpleContent :: Cursor -> P Xsd.SimpleContent
250−parseSimpleContent c = do
251− restrictionAxis <- makeElemAxis "restriction"
252− extenstionAxis <- makeElemAxis "extension"
253− case (c $/ restrictionAxis, c $/ extenstionAxis) of
254− ([r], []) -> Xsd.SimpleContentRestriction <$> parseSimpleRestriction r
255− ([], [e]) -> Xsd.SimpleContentExtension <$> parseSimpleExtension e
256− _ -> parseError c "Expected one of restriction or extension"
257−
258−parseSimpleExtension :: Cursor -> P Xsd.SimpleExtension
259−parseSimpleExtension c = handleNamespaces c $ do
260− base <- theAttribute "base" c >>= makeQName c
261− attributes <- parseAttributes c
262− return Xsd.SimpleExtension
263− { Xsd.simpleExtensionBase = base
264− , Xsd.simpleExtensionAttributes = attributes
265− }
234+parseSimpleContent c = parseError c "not implemented"
266235
267236parseComplexContent :: Cursor -> P Xsd.ComplexContent
268237parseComplexContent c = do
269238 restrictionAxis <- makeElemAxis "restriction"
270239 extenstionAxis <- makeElemAxis "extension"
271240 case (c $/ restrictionAxis, c $/ extenstionAxis) of
272− ([r], []) -> Xsd.ComplexContentRestriction <$> parseComplexRestriction r
241+ ([r], []) -> parseError r "not implemented"
273242 ([], [e]) -> Xsd.ComplexContentExtension <$> parseComplexExtension e
274243 _ -> parseError c "Expected one of restriction or extension"
275244
@@ -284,17 +253,6 @@ parseComplexExtension c = handleNamespaces c $ do
284253 , Xsd.complexExtensionAttributes = attributes
285254 }
286255
287−parseComplexRestriction :: Cursor -> P Xsd.ComplexRestriction
288−parseComplexRestriction c = handleNamespaces c $ do
289− base <- theAttribute "base" c >>= makeQName c
290− attributes <- parseAttributes c
291− model <- parseModelGroup c
292− return Xsd.ComplexRestriction
293− { Xsd.complexRestrictionBase = base
294− , Xsd.complexRestrictionModel = model
295− , Xsd.complexRestrictionAttributes = attributes
296− }
297−
298256parseModelGroup :: Cursor -> P (Maybe Xsd.ModelGroup)
299257parseModelGroup c = do
300258 sequenceAxis <- makeElemAxis "sequence"
@@ -317,10 +275,10 @@ parseAll :: Cursor -> P Xsd.ModelGroup
317275parseAll c = Xsd.All <$> parseElements c
318276
319277-- | Get all child elements
320−parseElements :: Cursor -> P [Xsd.RefOr Xsd.Element]
278+parseElements :: Cursor -> P [Xsd.Element]
321279parseElements c = do
322280 elementAxis <- makeElemAxis "element"
323− mapM parseElementOrRef (c $/ elementAxis)
281+ mapM parseElement (c $/ elementAxis)
324282
325283parseAttributes :: Cursor -> P [Xsd.Attribute]
326284parseAttributes c = do
@@ -329,33 +287,24 @@ parseAttributes c = do
329287
330288parseAttribute :: Cursor -> P Xsd.Attribute
331289parseAttribute c = do
290+ name <- theAttribute "name" c >>= makeTargetQName
332291 use <- parseUseAttribute c
333− case (anAttribute "name" c, anAttribute "ref" c) of
334− (Just n, Nothing) -> do
335− name <- makeTargetQName n
336− tp <- case anAttribute "type" c of
337− Nothing -> do
338− simpleTypeAxis <- makeElemAxis "simpleType"
339− case c $/ simpleTypeAxis of
340− [s] -> Xsd.Inline <$> parseSimpleType s
341− [] -> return (Xsd.Ref anySimpleType)
342− _ -> parseError c "Multiple simple types"
343− Just t -> Xsd.Ref <$> makeQName c t
344− return $ Xsd.InlineAttribute $ Xsd.AttributeInline
345− { Xsd.attributeInlineName = name
346− , Xsd.attributeInlineUse = use
347− , Xsd.attributeInlineType = tp
348− }
349− (Nothing, Just r) -> do
350− ref <- makeQName c r
351− return $ Xsd.RefAttribute $ Xsd.AttributeRef
352− { Xsd.attributeRefRef = ref
353− , Xsd.attributeRefUse = use
354− }
355− _ -> parseError c "Should be either name or ref"
356− where
357− anySimpleType =
358− Xsd.QName (Just (Xsd.Namespace Xsd.schemaNamespace)) "anySimpleType"
292+
293+ -- XXX: generalaze RefOr parsing
294+ tp <- case anAttribute "type" c of
295+ Nothing -> do
296+ simpleTypeAxis <- makeElemAxis "simpleType"
297+ case c $/ simpleTypeAxis of
298+ [s] -> Xsd.Inline <$> parseSimpleType s
299+ [] -> parseError c "Attribute should have type"
300+ _ -> parseError c "Multiple simple types"
301+ Just t -> Xsd.Ref <$> makeQName c t
302+
303+ return Xsd.Attribute
304+ { Xsd.attrName = name
305+ , Xsd.attrUse = use
306+ , Xsd.attrType = tp
307+ }
359308
360309parseUseAttribute :: Cursor -> P Xsd.Use
361310parseUseAttribute c = case anAttribute "use" c of
src/Xsd/Types.hs+18−53
@@ -6,23 +6,18 @@ module Xsd.Types
66, Child(..)
77, Type(..)
88, SimpleType(..)
9+, Restriction(..)
910, Constraint(..)
1011, ComplexType(..)
1112, Content(..)
1213, PlainContent(..)
1314, SimpleContent(..)
14−, SimpleExtension(..)
15−, SimpleRestriction(..)
1615, ComplexContent(..)
1716, ComplexExtension(..)
18−, ComplexRestriction(..)
1917, RefOr(..)
20−, refOr
2118, Element(..)
2219, MaxOccurs(..)
2320, Attribute(..)
24−, AttributeRef(..)
25−, AttributeInline(..)
2621, Annotation(..)
2722, Use(..)
2823, ModelGroup(..)
@@ -53,7 +48,7 @@ newtype Namespace = Namespace
5348 deriving (Show, Eq, Ord)
5449
5550data Child
56− = ChildElement (RefOr Element)
51+ = ChildElement Element
5752 | ChildType QName Type
5853 | ChildImport Import
5954 | ChildInclude Include
@@ -93,9 +88,9 @@ data Include = Include
9388 deriving (Show, Eq)
9489
9590data SimpleType
96− = AtomicType SimpleRestriction [Annotation]
91+ = AtomicType Restriction [Annotation]
9792 | ListType (RefOr SimpleType) [Annotation]
98− | UnionType [RefOr SimpleType] [Annotation]
93+ -- TODO: also union
9994 deriving (Show, Eq)
10095
10196data ComplexType = ComplexType
@@ -119,7 +114,7 @@ data PlainContent = PlainContent
119114
120115data ComplexContent
121116 = ComplexContentExtension ComplexExtension
122− | ComplexContentRestriction ComplexRestriction
117+ | ComplexContentRestriction -- TODO: implement me
123118 deriving (Show, Eq)
124119
125120data ComplexExtension = ComplexExtension
@@ -129,39 +124,20 @@ data ComplexExtension = ComplexExtension
129124 }
130125 deriving (Show, Eq)
131126
132−data ComplexRestriction = ComplexRestriction
133− { complexRestrictionBase :: QName
134− , complexRestrictionModel :: Maybe ModelGroup
135− , complexRestrictionAttributes :: [Attribute]
136− }
137− deriving (Show, Eq)
138−
139−data SimpleContent
140− = SimpleContentExtension SimpleExtension
141− | SimpleContentRestriction SimpleRestriction
127+-- TODO: implement me
128+data SimpleContent = SimpleContent
142129 deriving (Show, Eq)
143130
144131data ModelGroup
145− = Sequence [RefOr Element]
146− | Choice [RefOr Element]
147− | All [RefOr Element]
148− deriving (Show, Eq)
149−
150−data Attribute
151− = RefAttribute AttributeRef
152− | InlineAttribute AttributeInline
153− deriving (Show, Eq)
154−
155−data AttributeInline = AttributeInline
156− { attributeInlineName :: QName
157− , attributeInlineType :: RefOr SimpleType
158− , attributeInlineUse :: Use
159− }
132+ = Sequence [Element]
133+ | Choice [Element]
134+ | All [Element]
160135 deriving (Show, Eq)
161136
162−data AttributeRef = AttributeRef
163− { attributeRefRef :: QName
164− , attributeRefUse :: Use
137+data Attribute = Attribute
138+ { attrName :: QName
139+ , attrType :: RefOr SimpleType
140+ , attrUse :: Use
165141 }
166142 deriving (Show, Eq)
167143
@@ -171,16 +147,10 @@ data Use
171147 | Required
172148 deriving (Show, Eq)
173149
174−data SimpleRestriction = SimpleRestriction
175− { simpleRestrictionBase :: RefOr SimpleType
176− -- XXX: could simpleRestrictionBase be an inline type? Probably not.
177− , simpleRestrictionConstraints :: [Constraint]
178− }
179− deriving (Show, Eq)
180−
181−data SimpleExtension = SimpleExtension
182− { simpleExtensionBase :: QName
183− , simpleExtensionAttributes :: [Attribute]
150+data Restriction = Restriction
151+ { restrictionBase :: RefOr SimpleType
152+ -- XXX: could restrictionBase be an inline type? Probably not.
153+ , restrictionConstraints :: [Constraint]
184154 }
185155 deriving (Show, Eq)
186156
@@ -190,11 +160,6 @@ data RefOr t
190160 | Inline t
191161 deriving (Show, Eq)
192162
193−refOr :: (QName -> a) -> (t -> a) -> RefOr t -> a
194−refOr f g ref = case ref of
195− Ref name -> f name
196− Inline t -> g t
197−
198163data Constraint
199164 = Enumeration Text
200165 deriving (Show, Eq)
test/Spec.hs+13−15
@@ -6,7 +6,6 @@ module Spec
66where
77
88import Data.Text (Text)
9−import Data.Maybe
109import Data.Either
1110import Data.Map (Map)
1211import qualified Data.Map as Map
@@ -91,7 +90,7 @@ spec = do
9190 Xsd.AtomicType restriction _ = t
9291 res `shouldSatisfy` isRight
9392 tpName `shouldBe` (Xsd.QName Nothing "str")
94− Xsd.simpleRestrictionBase restriction `shouldBe`
93+ Xsd.restrictionBase restriction `shouldBe`
9594 Xsd.Ref (Xsd.QName (Just (Xsd.Namespace "something")) "string")
9695
9796 context "when restriction contains enumerations" $ do
@@ -115,7 +114,7 @@ spec = do
115114 Xsd.AtomicType restriction _ = t
116115 res `shouldSatisfy` isRight
117116 tpName `shouldBe` (Xsd.QName Nothing "str")
118− Xsd.simpleRestrictionConstraints restriction `shouldBe`
117+ Xsd.restrictionConstraints restriction `shouldBe`
119118 [ Xsd.Enumeration "value1"
120119 , Xsd.Enumeration "value2"
121120 ]
@@ -138,10 +137,10 @@ spec = do
138137 fmap Xsd.children res
139138 Xsd.AtomicType restriction' _ = t
140139 Xsd.Inline (Xsd.AtomicType restriction _) =
141− Xsd.simpleRestrictionBase restriction'
140+ Xsd.restrictionBase restriction'
142141 res `shouldSatisfy` isRight
143142 tpName `shouldBe` (Xsd.QName Nothing "str")
144− Xsd.simpleRestrictionBase restriction `shouldBe`
143+ Xsd.restrictionBase restriction `shouldBe`
145144 Xsd.Ref (Xsd.QName (Just (Xsd.Namespace "something")) "string")
146145
147146 context "when base refers to an unbound prefix" $ do
@@ -200,11 +199,11 @@ spec = do
200199 Right [Xsd.ChildType tpName (Xsd.TypeComplex t)] =
201200 fmap Xsd.children res
202201 Xsd.ContentPlain plain = Xsd.complexContent t
203− [Xsd.InlineAttribute attr] = Xsd.plainContentAttributes plain
202+ [attr] = Xsd.plainContentAttributes plain
204203 res `shouldSatisfy` isRight
205204 tpName `shouldBe` Xsd.QName Nothing "person"
206− Xsd.attributeInlineName attr `shouldBe` Xsd.QName Nothing "firstName"
207− Xsd.attributeInlineType attr `shouldBe`
205+ Xsd.attrName attr `shouldBe` Xsd.QName Nothing "firstName"
206+ Xsd.attrType attr `shouldBe`
208207 Xsd.Ref (Xsd.QName (Just (Xsd.Namespace "something")) "string")
209208
210209 context "when attribute type is inlined" $ do
@@ -226,11 +225,10 @@ spec = do
226225 Right [Xsd.ChildType _ (Xsd.TypeComplex t)] =
227226 fmap Xsd.children res
228227 Xsd.ContentPlain plain = Xsd.complexContent t
229− [Xsd.InlineAttribute attr] = Xsd.plainContentAttributes plain
230− Xsd.Inline (Xsd.AtomicType restriction _) =
231− Xsd.attributeInlineType attr
228+ [attr] = Xsd.plainContentAttributes plain
229+ Xsd.Inline (Xsd.AtomicType restriction _) = Xsd.attrType attr
232230 res `shouldSatisfy` isRight
233− Xsd.simpleRestrictionBase restriction `shouldBe`
231+ Xsd.restrictionBase restriction `shouldBe`
234232 Xsd.Ref (Xsd.QName (Just (Xsd.Namespace "something")) "string")
235233
236234 context "when it contains a sequence" $ do
@@ -261,8 +259,8 @@ spec = do
261259 Xsd.ContentPlain plain = Xsd.complexContent t
262260 Just (Xsd.Sequence elems) = Xsd.plainContentModel plain
263261 res `shouldSatisfy` isRight
264− mapMaybe (Xsd.refOr (const Nothing) (Just . Xsd.elementName)) elems
265− `shouldBe` map (Xsd.QName Nothing) ["firstName", "lastName"]
262+ map Xsd.elementName elems `shouldBe`
263+ map (Xsd.QName Nothing) ["firstName", "lastName"]
266264
267265 context "when it contains complexContent" $ do
268266 context "when it's an extenstion" $ do
@@ -307,7 +305,7 @@ spec = do
307305 ]
308306 ]
309307 res = Xsd.parse Xsd.defaultConfig doc
310− Right [Xsd.ChildElement (Xsd.Inline e)] = fmap Xsd.children res
308+ Right [Xsd.ChildElement e] = fmap Xsd.children res
311309 res `shouldSatisfy` isRight
312310 Xsd.elementName e `shouldBe`
313311 Xsd.QName Nothing "person"
xsd-parser.cabal+1−1
@@ -24,7 +24,7 @@ library
2424 , Xsd.Parser
2525
2626 -- Other library packages from which modules are imported.
27− build-depends: base >=4.12 && < 5
27+ build-depends: base ^>=4.12.0.0
2828 , bytestring
2929 , containers
3030 , lens >= 4.13
xsts-test/Main.hs+23−61
@@ -19,10 +19,9 @@ import Text.XML.Cursor
1919import qualified Xsd
2020
2121data Stat = Stat
22− { statTotal :: Int
22+ { statTestSet :: Text
23+ , statTotal :: Int
2324 , statSucceeded :: Int
24− , statValidFailed :: Int
25− , statInvalidSucceeded :: Int
2625 }
2726 deriving (Show)
2827
@@ -35,29 +34,27 @@ okRef :: IORef Int
3534okRef = unsafePerformIO (newIORef 0)
3635
3736{-# NOINLINE statsRef #-}
38−statsRef :: IORef [(Text, Stat)]
37+statsRef :: IORef [Stat]
3938statsRef = unsafePerformIO (newIORef [])
4039
41−dumpResults :: [(Text, Stat)] -> IO ()
40+dumpResults :: [Stat] -> IO ()
4241dumpResults stats = IO.withFile "xsts.md" IO.WriteMode $ \h -> do
4342 IO.hPutStrLn h "This table is generated automatically by `xsts` test."
4443 IO.hPutStrLn h "It contains number of xsd files successfully parsed."
4544 IO.hPutStrLn h "Note that we don't currently attempt to validate xml files"
4645 IO.hPutStrLn h "against the schemata."
4746 IO.hPutStrLn h ""
48− IO.hPutStrLn h "Test set | Total tests | Passed tests | Invalid passed | Valid failed"
49− IO.hPutStrLn h "--- | --- | --- | --- | ---"
50− forM_ stats $ \(name, s) -> do
47+ IO.hPutStrLn h "Test set | Total tests | Passed tests"
48+ IO.hPutStrLn h "--- | --- | ---"
49+ forM_ stats $ \s -> do
5150 IO.hPutStrLn h $ mconcat
52− [ Text.unpack name, " | "
51+ [ Text.unpack (statTestSet s), " | "
5352 , show (statTotal s), " | "
54− , show (statSucceeded s), " | "
55− , show (statInvalidSucceeded s), " | "
56− , show (statValidFailed s)
53+ , show (statSucceeded s)
5754 ]
5855
5956expectedFailures :: Int
60−expectedFailures = 3513
57+expectedFailures = 5080
6158
6259main :: IO ()
6360main = do
@@ -93,59 +90,24 @@ runTestSet path = do
9390 results <- mapM (runTestGroup dir) (c $/ laxElement "testGroup")
9491 let
9592 stat = Stat
96− { statTotal = (sum . map statTotal) results
97− , statSucceeded = (sum . map statSucceeded) results
98− , statValidFailed = (sum . map statValidFailed) results
99− , statInvalidSucceeded = (sum . map statInvalidSucceeded) results
93+ { statTestSet = name
94+ , statTotal = (sum . map fst) results
95+ , statSucceeded = (sum . map snd) results
10096 }
101− modifyIORef' statsRef ((name, stat) :)
97+ modifyIORef' statsRef (stat :)
10298 where
10399 dir = takeDirectory path
104100
105−runTestGroup :: FilePath -> Cursor -> IO Stat
101+runTestGroup :: FilePath -> Cursor -> IO (Int, Int)
106102runTestGroup dir c = do
107103 name <- theAttribute c "name"
108104 results <- mapM (runSchemaTest dir name) (aChild c "schemaTest")
109105 case join results of
110− Nothing -> return Stat
111− { statTotal = 0
112− , statSucceeded = 0
113− , statValidFailed = 0
114− , statInvalidSucceeded = 0
115− }
116− Just ValidSucceeded -> return Stat
117− { statTotal = 1
118− , statSucceeded = 1
119− , statValidFailed = 0
120− , statInvalidSucceeded = 0
121− }
122− Just ValidFailed -> return Stat
123− { statTotal = 1
124− , statSucceeded = 0
125− , statValidFailed = 1
126− , statInvalidSucceeded = 0
127− }
128− Just InvalidSucceeded -> return Stat
129− { statTotal = 1
130− , statSucceeded = 0
131− , statValidFailed = 0
132− , statInvalidSucceeded = 1
133− }
134− Just InvalidFailed -> return Stat
135− { statTotal = 1
136− , statSucceeded = 1
137− , statValidFailed = 0
138− , statInvalidSucceeded = 0
139− }
140−
141−data Result
142− = InvalidFailed
143− | InvalidSucceeded
144− | ValidFailed
145− | ValidSucceeded
146− deriving (Show)
106+ Nothing -> return (0, 0)
107+ Just True -> return (1, 1)
108+ Just False -> return (1, 0)
147109
148−runSchemaTest :: FilePath -> Text -> Cursor -> IO (Maybe Result)
110+runSchemaTest :: FilePath -> Text -> Cursor -> IO (Maybe Bool)
149111runSchemaTest dir groupName c = do
150112 path <- do
151113 c' <- theChild c "schemaDocument"
@@ -164,21 +126,21 @@ runSchemaTest dir groupName c = do
164126 case (res, valid) of
165127 (Left _, False) -> do
166128 modifyIORef' okRef succ
167− return (Just InvalidFailed)
129+ return (Just True)
168130 (Right _, True) -> do
169131 modifyIORef' okRef succ
170− return (Just ValidSucceeded)
132+ return (Just True)
171133 (Right _, False) -> do
172134 modifyIORef' errRef succ
173135 putStrLn $ "invalid xsd passed: " <> Text.unpack groupName
174136 <> " (" <> dir </> Text.unpack path <> ")"
175− return (Just InvalidSucceeded)
137+ return (Just False)
176138 (Left err, True) -> do
177139 modifyIORef' errRef succ
178140 putStrLn $ "valid xsd didn't pass: " <> Text.unpack groupName
179141 <> " (" <> dir </> Text.unpack path <> ")"
180142 <> ": " <> show (err :: SomeException)
181− return (Just ValidFailed)
143+ return (Just False)
182144
183145anAttribute :: Cursor -> Text -> Maybe Text
184146anAttribute c name = case c $| laxAttribute name of
xsts.md+95−95
@@ -3,98 +3,98 @@ It contains number of xsd files successfully parsed.
33Note that we don't currently attempt to validate xml files
44against the schemata.
55
6−Test set | Total tests | Passed tests | Invalid passed | Valid failed
7−--- | --- | --- | --- | ---
8−yearMonthDuration | 25 | 13 | 12 | 0
9−XSImportReference | 1 | 0 | 1 | 0
10−XPathDefaultNSonKeyKeyRefUnique | 13 | 13 | 0 | 0
11−XML11Support | 11 | 11 | 0 | 0
12−wildcard | 17 | 15 | 2 | 0
13−VC | 6 | 6 | 0 | 0
14−unsignedIntegers | 8 | 8 | 0 | 0
15−UnitsLength | 8 | 6 | 2 | 0
16−union | 19 | 14 | 5 | 0
17−CTA | 6 | 6 | 0 | 0
18−TypeAlternativeTests | 23 | 16 | 7 | 0
19−time | 1 | 1 | 0 | 0
20−TargetNS | 2 | 2 | 0 | 0
21−substitutionGroup | 5 | 3 | 2 | 0
22−rf-whiteSpace | 2 | 2 | 0 | 0
23−RestrictionOfComplexTypes | 13 | 9 | 4 | 0
24−RegularExpression | 8 | 8 | 0 | 0
25−PopenContent | 24 | 16 | 8 | 0
26−list | 2 | 1 | 1 | 0
27−IdentityConstraint | 12 | 6 | 6 | 0
28−ID_IDREF | 77 | 57 | 20 | 0
29−gMonth | 1 | 0 | 1 | 0
30−gDay | 1 | 1 | 0 | 0
31−gMonthDay | 1 | 1 | 0 | 0
32−gYear | 1 | 1 | 0 | 0
33−gYearMonth | 1 | 1 | 0 | 0
34−float | 2 | 2 | 0 | 0
35−explicitTimezone | 18 | 14 | 4 | 0
36−EDCWildcard | 2 | 2 | 0 | 0
37−double | 2 | 2 | 0 | 0
38−DefaultFixed | 5 | 5 | 0 | 0
39−defaultAttributesApply | 17 | 14 | 3 | 0
40−dayTimeDuration | 24 | 12 | 12 | 0
41−dateTimeStamp | 28 | 11 | 17 | 0
42−date | 1 | 1 | 0 | 0
43−CyclicDependencies_Redefine_Include_Import_Override | 5 | 0 | 5 | 0
44−constraintsOnAttribute | 16 | 6 | 10 | 0
45−ConditionalInclusion | 3 | 2 | 1 | 0
46−assertion | 51 | 50 | 1 | 0
47−Assert | 35 | 35 | 0 | 0
48−anyAttribute | 9 | 7 | 2 | 0
49−allGroup | 9 | 7 | 2 | 0
50−IRI | 1 | 1 | 0 | 0
51−substitution-groups | 6 | 6 | 0 | 0
52−Zone | 9 | 5 | 4 | 0
53−Zone | 20 | 15 | 5 | 0
54−XmlVersions | 13 | 13 | 0 | 0
55−Wild | 84 | 63 | 21 | 0
56−VC | 24 | 19 | 4 | 1
57−TargetNS | 4 | 2 | 2 | 0
58−Subsgroup | 6 | 3 | 3 | 0
59−Simple | 58 | 17 | 41 | 0
60−Override | 30 | 21 | 9 | 0
61−Open | 51 | 37 | 14 | 0
62−Missing | 6 | 4 | 2 | 0
63−Id | 32 | 30 | 2 | 0
64−CTA | 44 | 33 | 11 | 0
65−Complex | 25 | 19 | 6 | 0
66−Assert | 34 | 34 | 0 | 0
67−All | 62 | 26 | 34 | 2
68−BoeingXSDTestCases | 6 | 6 | 0 | 0
69−MS-Wildcards2006-07-15 | 315 | 218 | 97 | 0
70−MS-SimpleType2006-07-15 | 333 | 210 | 123 | 0
71−MS-Schema2006-07-15 | 124 | 56 | 61 | 7
72−MS-Regex2006-07-15 | 2590 | 1988 | 602 | 0
73−MS-Particles2006-07-15 | 855 | 561 | 293 | 1
74−MS-Notations2006-07-15 | 116 | 38 | 78 | 0
75−MS-ModelGroups2006-07-15 | 391 | 215 | 176 | 0
76−MS-IdentityConstraint2006-07-15 | 844 | 621 | 223 | 0
77−MS-Group2006-07-15 | 218 | 138 | 80 | 0
78−MS-Errata102006-07-15 | 19 | 15 | 4 | 0
79−MS-Element2006-07-15 | 355 | 263 | 92 | 0
80−MS-DataTypes2006-07-15 | 2247 | 1491 | 752 | 4
81−MS-ComplexType2006-07-15 | 550 | 311 | 239 | 0
82−MS-Attribute2006-07-15 | 279 | 165 | 114 | 0
83−MS-AttributeGroup2006-07-15 | 114 | 63 | 51 | 0
84−MS-Annotations2006-07-15 | 80 | 51 | 27 | 2
85−MS-Additional2006-07-15 | 253 | 202 | 45 | 6
86−Wildcard | 26 | 22 | 4 | 0
87−Schema | 6 | 6 | 0 | 0
88−SType | 138 | 131 | 7 | 0
89−Notation | 13 | 8 | 5 | 0
90−MGroupDef | 19 | 8 | 11 | 0
91−MGroup | 40 | 24 | 16 | 0
92−IdConstrDefs | 27 | 21 | 6 | 0
93−ElemDecl | 227 | 171 | 56 | 0
94−CType | 31 | 25 | 6 | 0
95−AttrUse | 4 | 3 | 1 | 0
96−AttrDecl | 83 | 78 | 5 | 0
97−AGroupDef | 13 | 6 | 7 | 0
98−suntest | 52 | 30 | 22 | 0
99−NIST2004-01-14 | 3953 | 3953 | 0 | 0
100−introspection | 1 | 0 | 0 | 1
6+Test set | Total tests | Passed tests
7+--- | --- | ---
8+yearMonthDuration | 25 | 9
9+XSImportReference | 1 | 1
10+XPathDefaultNSonKeyKeyRefUnique | 13 | 11
11+XML11Support | 11 | 11
12+wildcard | 17 | 9
13+VC | 6 | 5
14+unsignedIntegers | 8 | 8
15+UnitsLength | 8 | 7
16+union | 19 | 6
17+CTA | 6 | 4
18+TypeAlternativeTests | 23 | 9
19+time | 1 | 1
20+TargetNS | 2 | 0
21+substitutionGroup | 5 | 2
22+rf-whiteSpace | 2 | 2
23+RestrictionOfComplexTypes | 13 | 11
24+RegularExpression | 8 | 8
25+PopenContent | 24 | 13
26+list | 2 | 1
27+IdentityConstraint | 12 | 7
28+ID_IDREF | 77 | 44
29+gMonth | 1 | 0
30+gDay | 1 | 1
31+gMonthDay | 1 | 1
32+gYear | 1 | 1
33+gYearMonth | 1 | 1
34+float | 2 | 2
35+explicitTimezone | 18 | 6
36+EDCWildcard | 2 | 2
37+double | 2 | 2
38+DefaultFixed | 5 | 2
39+defaultAttributesApply | 17 | 14
40+dayTimeDuration | 24 | 8
41+dateTimeStamp | 28 | 7
42+date | 1 | 1
43+CyclicDependencies_Redefine_Include_Import_Override | 5 | 0
44+constraintsOnAttribute | 16 | 10
45+ConditionalInclusion | 3 | 2
46+assertion | 51 | 42
47+Assert | 35 | 25
48+anyAttribute | 9 | 7
49+allGroup | 9 | 8
50+IRI | 1 | 0
51+substitution-groups | 6 | 0
52+Zone | 9 | 5
53+Zone | 20 | 16
54+XmlVersions | 13 | 13
55+Wild | 84 | 52
56+VC | 24 | 9
57+TargetNS | 4 | 0
58+Subsgroup | 6 | 3
59+Simple | 58 | 31
60+Override | 30 | 21
61+Open | 51 | 34
62+Missing | 6 | 5
63+Id | 32 | 7
64+CTA | 44 | 13
65+Complex | 25 | 11
66+Assert | 34 | 2
67+All | 62 | 29
68+BoeingXSDTestCases | 6 | 0
69+MS-Wildcards2006-07-15 | 315 | 210
70+MS-SimpleType2006-07-15 | 333 | 146
71+MS-Schema2006-07-15 | 124 | 56
72+MS-Regex2006-07-15 | 2590 | 1988
73+MS-Particles2006-07-15 | 855 | 491
74+MS-Notations2006-07-15 | 116 | 40
75+MS-ModelGroups2006-07-15 | 391 | 221
76+MS-IdentityConstraint2006-07-15 | 844 | 231
77+MS-Group2006-07-15 | 218 | 69
78+MS-Errata102006-07-15 | 19 | 10
79+MS-Element2006-07-15 | 355 | 150
80+MS-DataTypes2006-07-15 | 2247 | 1084
81+MS-ComplexType2006-07-15 | 550 | 270
82+MS-Attribute2006-07-15 | 279 | 137
83+MS-AttributeGroup2006-07-15 | 114 | 64
84+MS-Annotations2006-07-15 | 80 | 50
85+MS-Additional2006-07-15 | 253 | 157
86+Wildcard | 26 | 22
87+Schema | 6 | 6
88+SType | 138 | 123
89+Notation | 13 | 8
90+MGroupDef | 19 | 8
91+MGroup | 40 | 24
92+IdConstrDefs | 27 | 19
93+ElemDecl | 227 | 133
94+CType | 31 | 15
95+AttrUse | 4 | 1
96+AttrDecl | 83 | 73
97+AGroupDef | 13 | 6
98+suntest | 52 | 19
99+NIST2004-01-14 | 3953 | 3873
100+introspection | 1 | 0