.. _package-rst-xml: ================= Package rst.xml ================= This package contains data types related to XML documents. In particular, the types :py:class:`XOP ` and :py:class:`Attachment ` are inspired by .. seealso:: XML-binary Optimized Packaging (XOP) http://www.w3.org/TR/xop10/ Messages ======== .. container:: mess4ge-multi .. container:: mess4ge-graph .. digraph:: message_graph fontname="Arial"; fontsize=11; stylesheet="../_static/graphs.css"; node [fontsize=11,fontname="Arial"] edge [fontsize=11,fontname="Arial"] "1" [label=<
XOPs
XOPxops
>,shape=box,style=filled,fillcolor="white"]; "2" [label=<
XOP
ASCII-STRINGxml
Attachmentattachments
UINT64id
>,shape=box,style=filled,fillcolor="white"]; "3" [label=<
Attachment
ASCII-STRINGurl
OCTET-VECTORwire_schema
OCTET-VECTORdata
>,shape=box,style=filled,fillcolor="white"]; "1":xops -> "2"[]; "2":attachments -> "3"[]; .. container:: mess4ge-list .. container:: messages * :ref:`XOPs ` * :ref:`XOP ` * :ref:`Attachment ` .. container:: clearer clearer: should be made invisible via css .. _message-rst-xml-xops: Message XOPs ------------ .. container:: message-rst-xml-xops-multi .. container:: message-rst-xml-xops-documentation .. py:class:: rst.xml.XOPs A collection of XML documents with optional binary attachments. .. codeauthor:: David Klotz .. py:attribute:: xops :type: array of :py:class:`rst.xml.XOP` The collection of :py:class:`XOP ` objects. .. container:: message-rst-xml-xops-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-trunk/upstream/RST-0.19.0-Linux/share/rst0.19/proto/stable/rst/xml/XOPs.proto :lines: 14-21 :language: protobuf :emphasize-lines: 6-6 .. _message-rst-xml-xop: Message XOP ----------- .. container:: message-rst-xml-xop-multi .. container:: message-rst-xml-xop-documentation .. py:class:: rst.xml.XOP Objects of this type represent XML with binary attachments. Thus, this type can be seen (and used) as an implementation of the XML-binary Optimized Packaging (XOP) recommendation. (Note that the draft calls this kind of object "XOP Package"). .. seealso:: XML-binary Optimized Packaging (XOP) http://www.w3.org/TR/xop10/ .. codeauthor:: Robert Haschke .. py:attribute:: xml :type: :py:class:`ASCII-STRING` XML string (UTF-8 encoded). Has to be valid XML since parsers and, potentially, validators might be applied. .. py:attribute:: attachments :type: array of :py:class:`rst.xml.Attachment` Set of attachment objects. :py:class:`Attachment ` objects are uniquely identifiable by means of their :py:attr:`url ` fields. The order of :py:class:`Attachment ` objects is not significant as they are indexed by URLs. .. py:attribute:: id :type: :py:class:`UINT64` An optional document identifier. Can be used e.g. to distinguish documents without looking at their content. .. container:: message-rst-xml-xop-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-trunk/upstream/RST-0.19.0-Linux/share/rst0.19/proto/stable/rst/xml/XOP.proto :lines: 59-87 :language: protobuf :emphasize-lines: 9-9,20-20,28-28 .. _message-rst-xml-attachment: Message Attachment ------------------ .. container:: message-rst-xml-attachment-multi .. container:: message-rst-xml-attachment-documentation .. py:class:: rst.xml.Attachment Uniquely identifiable object which is associated to a :py:class:`XOP `. The attachment is uniquely identified within the containing :py:class:`XOP ` object by its :py:attr:`url `. In this implementation, the attached object is stored in a serialized form in the :py:attr:`wire_schema ` and :py:attr:`data ` fields. .. codeauthor:: Robert Haschke .. todo:: move to separate file? .. py:attribute:: url :type: :py:class:`ASCII-STRING` URL of attachment. Within a :py:class:`XOP ` object (and possibly beyond), each attachment should have a unique URL. .. py:attribute:: wire_schema :type: :py:class:`OCTET-VECTOR` Wire-schema of the serialized object. This field and the :py:attr:`data ` field are intended to be processed by a (de)serialization mechanism that decodes/encodes the data blob according to the type information in wireSchema. .. py:attribute:: data :type: :py:class:`OCTET-VECTOR` Blob data of the serialized object. See :py:attr:`wire_schema ` for details. .. container:: message-rst-xml-attachment-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-trunk/upstream/RST-0.19.0-Linux/share/rst0.19/proto/stable/rst/xml/XOP.proto :lines: 20-45 :language: protobuf :emphasize-lines: 9-9,18-18,25-25