aas_core3_2.xmlrpc
Read and write the JSON-able values as a subset of XML-RPC.
JSON prescribes no XML representation of its own, so we borrow the one of
XML-RPC for it: a value is written as a single discriminator element –
<nil>, <boolean>, <double>, <string>, <array> or
<struct> – which says what the value is. XML-RPC itself knows no null,
so we follow the widespread extension, and write a JSON null as an empty
<nil/>.
This module knows nothing of the meta-model beyond the JSON-able types, and
it drives no document of its own. The caller hands over the very stream of
(event, element) tuples, or the very
aas_core3_2.xmlcommon.Writer, with which
the enclosing document is being read or written, so that a JSON-able property
is read and written in the same pass as everything around it.
These elements reside in no namespace at all, as the XML-RPC specification
prescribes, and not in the namespace of the enclosing document. The outermost
one therefore undeclares the default namespace with xmlns="", and
the elements nested in it inherit that.
- aas_core3_2.xmlrpc.read_value_content(element: Element, iterator: Iterator[Tuple[str, Element]]) Union[None, bool, int, float, str, Sequence[Any], Mapping[str, Any]][source]
Read the content of
elementas a JSON-able value.The content is a single discriminator element –
<nil>,<boolean>,<double>,<string>,<array>or<struct>– which says what the value is.The end element corresponding to
elementwill be read as well.
- aas_core3_2.xmlrpc.read_array_body(element: Element, iterator: Iterator[Tuple[str, Element]]) Sequence[Any][source]
Read the content of
elementas a<data>of<value>’s.The end element corresponding to
elementwill be read as well.
- aas_core3_2.xmlrpc.read_value_element(element: Element, iterator: Iterator[Tuple[str, Element]]) Union[None, bool, int, float, str, Sequence[Any], Mapping[str, Any]][source]
Read
element, which has to be a<value>, as a JSON-able value.The end element corresponding to
elementwill be read as well.
- aas_core3_2.xmlrpc.read_struct_body(element: Element, iterator: Iterator[Tuple[str, Element]]) Mapping[str, Any][source]
Read the content of
elementas a sequence of<member>’s.The end element corresponding to
elementwill be read as well.
- aas_core3_2.xmlrpc.write_discriminator(value: Union[None, bool, int, float, str, Sequence[Any], Mapping[str, Any]], writer: Writer) None[source]
Write
valueas one of the six XML-RPC discriminators.
- aas_core3_2.xmlrpc.write_array_body(value: Sequence[Any], writer: Writer) None[source]
Write the
<data>of the JSON-able arrayvalue.The path of a failure points into
value, and not into the document, which is only half written when the failure is raised: it is the value which the caller holds and can look at.
- aas_core3_2.xmlrpc.write_struct_body(value: Mapping[str, Any], writer: Writer) None[source]
Write the
<member>’s of the JSON-able objectvalue.The path of a failure points into
value, and not into the document, which is only half written when the failure is raised: it is the value which the caller holds and can look at.