diff --git a/lib/siplib.py b/lib/siplib.py index 2c9a9f46b26927aab6fd8f51d395d8367c2d2147..a4f9faf5867c93e730a709c2328d8a7f71487188 100644 --- a/lib/siplib.py +++ b/lib/siplib.py @@ -41,6 +41,14 @@ logger = logging.getLogger(__name__) 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)