MTOM addition: Providing media types to data in XML

Hi, in fulfillment of my action item, I hereby propose the addition of a
section about media-typing XML binary data to our MTOM working draft.

I propose we add section 5 with (roughly) the following text, mostly
copied from PASWA [1] sections 3, 7 and appendix I. This additional
section means that the document is not only about transmission
optimization any more, therefore we need to rename it, I suggest "SOAP
Messages With Binary Data" or "SOAP Messages With Attachments", though
the latter is already used.

[1] http://www.gotdotnet.com/team/jeffsch/paswa/paswa61.html

The namespace table should be extended to include the prefix xmime
mapped to the namespace "http://www.w3.org/2003/06/soap/xml-media-type"
and the prefix xs mapped to the namespace
"http://www.w3.org/2001/XMLSchema".


---------------------
5. Providing Media Types to Data in XML

For purposes of annotating binary data present in the form of base64
text in XML infosets with MIME media types, this specification defines a
global attribute (xmime:mediaType) that may be applied to elements whose
children contain base64-encoded binary data. This specification also
defines an XML Schema complex type that augments the xs:base64Binary
type with this attribute.

5.1 xmime:mediaType attribute information item
The mediaType attribute information item specifies the media type of the
base64-encoded content of its owner element information item. Its
normalized value is a media type as defined by Section 5.1 of RFC 2045
and RFC 2046. When the mediaType attribute information item is not
present the media type "application/octet-stream" is assumed.

5.2 xmime:Binary type
The Binary type is an XML Schema complex type whose base is
xs:base64Binary. The type carries optional xmime:mediaType attribute.
This type can be used by elements that need to carry base64-encoded data
along with optional media type information.

5.3 xmime:accept attribute information item
For the purpose of annotating a schema with information about allowed
media types in an element or type definition, notably for use in WSDL,
the accept attribute information item may be used on element
declarations in a schema to specify the list of accepted media types.
Its normalized value is a space-delimited list of media types with ´q¡
parameters as defined in Section 14.1 of RFC 2616. When the accept
attribute is not present the media type "*/*" is assumed. 

[jacek: this is new, schema guys please check this]
This attribute information item can be used on xs:element,
xs:simpleContent or xs:complexContent. An element MUST NOT specify a
wider range of accepted media types than its type, it MAY change the "q"
parameter values though. Likewise, a restricting type MUST NOT specify a
wider range of accepted media types than its base type, it MAY change
the "q" parameter values though.

5.4 XML Schemas  [jacek: possibly an appendix]

The following is a normative schema for the mediaType and accept
attributes and the Binary element. [jacek: copied from PASWA, somebody
please verify]

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns:tns="http://www.w3.org/2003/06/soap/xml-media-type" 
           targetNamespace="http://www.w3.org/2003/06/soap/xml-media-type" >

  <xs:attribute name="mediaType" >
    <xs:simpleType>
      <xs:restriction base="xs:string" >
        <xs:pattern value="(text|application|image|audio|video|model|multipart|message|x-[-.a-z0-9]+)/[a-z0-9][-.+a-z0-9]+(;\s?.+=.+)*" />
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>

  <xs:attribute name="accept" >
    <xs:simpleType>
      <xs:restriction base="xs:string" >
        <xs:pattern value="(text|application|image|audio|video|model|multipart|message|x-[-.a-z0-9]+)/[a-z0-9][-.+a-z0-9]+(;p=(1\.0|0\.\d+))?" />
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>

  <xs:complexType name="Binary" >
    <xs:simpleContent>
      <xs:extension base="xs:base64Binary" >
        <xs:attribute ref="tns:mediaType" use="optional" />
        <xs:anyAttribute namespace="##any" processContents="lax" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

</xs:schema>
------------------------



What do you think, especially the authors of PASWA?

                   Jacek Kopecky

                   Senior Architect
                   Systinet Corporation
                   http://www.systinet.com/

Received on Thursday, 10 July 2003 01:01:46 UTC