Skip to content

ReferenceMaterials¤

ReferenceMaterials (Any) ¤

ReferenceMaterials(**attributes: str)

Documentation of reference materials, results, acceptance criteria, relevant dates and the period of validity.

Since this class is currently represented by the any type in the XML Schema Definition, it is simply a subclass of Element. It may be updated to be a more specific class at a later date.

Parameters:

Name Type Description Default
attributes str

All keyword arguments are used as the element's attributes.

{}
Source code in src/msl/equipment/schema.py
193
194
195
196
197
198
199
def __init__(self, **attributes: str) -> None:
    """Base class that represents the [any][type_any] type in the XML Schema Definition.

    Args:
        attributes: All keyword arguments are used as the element's attributes.
    """
    super().__init__(self.tag, attrib={}, **attributes)

tag class-attribute instance-attribute ¤

tag: str = 'referenceMaterials'

The element's name.

from_xml classmethod ¤

from_xml(element: Element[str]) -> A

Copies an XML element into the Any subclass.

Parameters:

Name Type Description Default
element Element[str]

An XML element from an equipment register.

required

Returns:

Type Description
A

The subclass instance.

Source code in src/msl/equipment/schema.py
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
@classmethod
def from_xml(cls: type[A], element: Element[str]) -> A:  # noqa: PYI019
    """Copies an XML element into the [Any][msl.equipment.schema.Any] subclass.

    Args:
        element: An XML element from an equipment register.

    Returns:
        The subclass instance.
    """
    prefix = f"{{{Register.NAMESPACE}}}"
    for e in element.iter():
        if e.tag.startswith(prefix):  # str.removeprefix() was added in Python 3.9
            e.tag = e.tag[len(prefix) :]

    c = cls(**element.attrib)
    c.tail = element.tail
    c.text = element.text
    c.extend(element)
    return c