diff --git a/lib/siplib.py b/lib/siplib.py index 188f7559ef4172d249b3997aa82a72789846fe59..24ea8ede55d508eef92b75a9d06b6a2a2fff2d6f 100644 --- a/lib/siplib.py +++ b/lib/siplib.py @@ -43,6 +43,14 @@ VERSION = "SIPlib 0.4" ltasip.Namespace.setPrefix('sip') +# The LTA catalogue expectes all lofar complexType objects to be annotated as xsi:type="<my_type>" +# Trick pyxb into doing this, by override the _RequireXSIType, and make the xsitype required for out types. +import inspect +from pyxb.binding.basis import complexTypeDefinition +for member in inspect.getmembers(ltasip, inspect.isclass): + if issubclass(member[1], complexTypeDefinition): + member[1]._RequireXSIType = classmethod(lambda _1, _2: True) + # todo: create docstrings for everything. # specify types and explain purpose of the field (-> ask someone with more astronomical background)