@@ -0,0 +1,101 @@
1+-- This file was generated by xsd-isogen version 0.1.0.0
2+-- https://github.com/dredozubov/xsd-isogen
4+{-# OPTIONS_GHC -Wno-unused-imports #-}
10+import Text.XML.DOM.Parser
11+import Text.XML.Writer
12+import Text.XML.ParentAttributes
13+import Prelude hiding ((*), (+))
19+"X" =:= record ParserAndGenerator
25+"A" =:= record ParserAndGenerator
33+"B" =:= record ParserAndGenerator
39+"C" =:= record ParserAndGenerator
48+instance NFData AnyXmlC where
51+instance FromDom AnyXmlC where
54+ (matchName "{http://www.w3.org/2001/XMLSchema-instance}type")
57+ "C" -> TheXmlC <$> fromDom
58+ "A" -> TheXmlA <$> fromDom
59+ _ -> throwParserError (PEOther "Unexpected type")
61+instance ToXML AnyXmlC where
62+ toXML (TheXmlC a) = toXML a
63+ toXML (TheXmlA a) = toXML a
65+instance ToXmlParentAttributes AnyXmlC where
66+ toXmlParentAttributes (TheXmlC a) =
67+ ("{http://www.w3.org/2001/XMLSchema-instance}type", "C")
68+ : toXmlParentAttributes a
69+ toXmlParentAttributes (TheXmlA a) =
70+ ("{http://www.w3.org/2001/XMLSchema-instance}type", "A")
71+ : toXmlParentAttributes a
74+ | TheAnyXmlC !AnyXmlC
77+instance NFData AnyXmlB where
80+instance FromDom AnyXmlB where
83+ (matchName "{http://www.w3.org/2001/XMLSchema-instance}type")
86+ "B" -> TheXmlB <$> fromDom
87+ "C" -> TheAnyXmlC <$> fromDom
88+ _ -> throwParserError (PEOther "Unexpected type")
90+instance ToXML AnyXmlB where
91+ toXML (TheXmlB a) = toXML a
92+ toXML (TheAnyXmlC a) = toXML a
94+instance ToXmlParentAttributes AnyXmlB where
95+ toXmlParentAttributes (TheXmlB a) =
96+ ("{http://www.w3.org/2001/XMLSchema-instance}type", "B")
97+ : toXmlParentAttributes a
98+ toXmlParentAttributes (TheAnyXmlC a) =
99+ ("{http://www.w3.org/2001/XMLSchema-instance}type", "C")
100+ : toXmlParentAttributes a