1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 """Extensions of standard exceptions for PyXB events.
16
17 Yeah, I'd love this module to be named exceptions.py, but it can't
18 because the standard library has one of those, and we need to
19 reference it below.
20 """
21
22 import exceptions
23
25 """Base class for exceptions that indicate a problem that the user should fix."""
26 pass
27
29 """Raised when the XML hierarchy does not appear to be valid for an XML schema."""
30 pass
31
33 """Violation of some rule relevant to XML Namespaces"""
34 - def __init__ (self, namespace, *args, **kw):
37
39
41 """Problem related to namespace archives"""
42 pass
43
45 """Raised when somebody tries to create a schema component using a
46 schema that has already been used in that namespace. Import and
47 include processing would have avoided this, so somebody asked for
48 it specifically."""
49 - def __init__ (self, namespace, schema_location, existing_schema, *args, **kw):
57
61
63 """Raised when something goes wrong generating the binding classes"""
64 pass
65
67 """Raised when an attempt is made to record multiple objects of the same name in the same namespace category."""
68 pass
69
71 """Raised when a value in an XML attribute does not conform to the simple type."""
72 pass
73
75 '''Raised when a name is referenced that is not defined in the appropriate namespace.'''
76 __namespace = None
77 __ncName = None
78
80 """Raised when a schema component property is accessed on a component instance that does not define that property."""
81 pass
82
84 """Raised when processing document content and an error is encountered."""
85 pass
86
88 """Raised when processing document and the content model is not satisfied."""
89
91 """Raised when attempting to construct an element that is abstract."""
92 pass
93
94 -class UnrecognizedContentError (StructuralBadDocumentError):
95 """Raised when processing document and an element does not match the content model."""
96
98 """Raised when creating an instance from a document with an unrecognized root element."""
99
101 """Raised when processing document and there is more material in an element content than expected."""
102
103 -class ContentInNilElementError (ExtraContentError):
104 """Raised when an element that is marked to be nil has content."""
105 pass
106
107 -class MissingContentError (StructuralBadDocumentError):
108 """Raised when processing document and expected content is not present. See also UnrecognizedContentError."""
109
111 """Raised when processing document and a tag that is a type but not an element is encountered."""
112
114 """Raised when an attribute is found that is not sanctioned by the content model."""
115
117 """Raised when something in the infoset fails to satisfy a content model or attribute requirement."""
118 pass
119
121 """Raised when an attribute requirement is not satisfied."""
122 pass
123
125 """Raised when an attribute that is prohibited is provided in an element."""
126
128 """Raised when an attribute that is required is missing in an element."""
129
131 """Raised when an attribute with a fixed value constraint is set to a different value."""
132
134 """Raised when somebody tries to instantiate an abstract complex type."""
135
137 """Raised when converting binding to DOM and something goes wrong."""
138 pass
139
141 """Raised when checking _isNil on a type that does not support nillable."""
142 pass
143
145 """Raised when the content of a binding object is not consistent with its content model"""
146 pass
147
149 """Raised when an element is given non-element content but may not contain such."""
150 pass
151
152 -class NoContentModel (BindingValidationError):
153 """Raised when an operation is attempted that requires a content
154 model, but the complex type has empty or simple content."""
155 pass
156
158 """Raised when the bindings are mis-used."""
159 pass
160
161 -class NotSimpleContentError (BindingError):
162 """Raised when an operation that requires simple content is
163 invoked on a complex type that does not have simple content."""
164 pass
165
166 -class NotComplexContentError (BindingError):
167 """Raised when an operation is attempted that requires a content
168 model, but the complex type has empty or simple content."""
169 pass
170
172 """Base class for exceptions that indicate a problem that the user probably can't fix."""
173 pass
174
176 """Raised when the code detects arguments to a public
177 operation."""
178
180 """Raised when the code detects an implementation problem."""
181
183 """Raised when a code branch is taken that has not yet been implemented."""
184