Package rst.xml¶
This package contains data types related to XML documents.
In particular, the types XOP
and Attachment
are inspired by
See also
- XML-binary Optimized Packaging (XOP)
- http://www.w3.org/TR/xop10/
Messages¶
Message XOPs¶
-
class
rst.xml.
XOPs
¶ A collection of XML documents with optional binary attachments.
Code author: David Klotz <dklotz@techfak.uni-bielefeld.de>
-
xops
¶ Type: array of rst.xml.XOP
The collection of
XOP
objects.
-
message XOPs {
/**
* The collection of @ref rst.xml.XOP objects.
*/
repeated XOP xops = 1;
}
Message XOP¶
-
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”).
See also
- XML-binary Optimized Packaging (XOP)
- http://www.w3.org/TR/xop10/
Code author: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
-
xml
¶ Type: ASCII-STRING
XML string (UTF-8 encoded).
Has to be valid XML since parsers and, potentially, validators might be applied.
-
attachments
¶ Type: array of rst.xml.Attachment
Set of attachment objects.
Attachment
objects are uniquely identifiable by means of theirurl
fields.The order of
Attachment
objects is not significant as they are indexed by URLs.
-
id
¶ Type: UINT64
An optional document identifier.
Can be used e.g. to distinguish documents without looking at their content.
message XOP {
/**
* XML string (UTF-8 encoded).
*
* Has to be valid XML since parsers and, potentially, validators
* might be applied.
*/
optional string xml = 1;
/**
* Set of attachment objects.
*
* @ref .Attachment objects are uniquely identifiable by means of
* their @ref .Attachment.url fields.
*
* The order of @ref .Attachment objects is not significant as
* they are indexed by URLs.
*/
repeated Attachment attachments = 2;
/**
* An optional document identifier.
*
* Can be used e.g. to distinguish documents without looking at
* their content.
*/
optional uint64 id = 3;
}
Message Attachment¶
-
class
rst.xml.
Attachment
¶ Uniquely identifiable object which is associated to a
XOP
.The attachment is uniquely identified within the containing
XOP
object by itsurl
.In this implementation, the attached object is stored in a serialized form in the
wire_schema
anddata
fields.Code author: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
Todo
move to separate file?
-
url
¶ Type: ASCII-STRING
URL of attachment.
Within a
XOP
object (and possibly beyond), each attachment should have a unique URL.
-
wire_schema
¶ Type: OCTET-VECTOR
Wire-schema of the serialized object.
This field and the
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.
-
data
¶ Type: OCTET-VECTOR
Blob data of the serialized object.
See
wire_schema
for details.
-
message Attachment {
/**
* URL of attachment.
*
* Within a @ref .XOP object (and possibly beyond), each
* attachment should have a unique URL.
*/
optional string url = 1;
/**
* Wire-schema of the serialized object.
*
* This field and the @ref .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.
*/
optional bytes wire_schema = 2;
/**
* Blob data of the serialized object.
*
* See @ref .wire_schema for details.
*/
optional bytes data = 3;
}