- From: Anish.Karmarkar <akarmark@dev.w3.org>
- Date: Tue, 05 Oct 2004 02:38:39 +0000
- To: public-ws-desc-eds@w3.org
Update of /sources/public/2002/ws/desc/media-types In directory hutz:/tmp/cvs-serv10771 Modified Files: xml-media-types.xml xml-media-types.html Log Message: get ready for LC -- fix more ed issues from toronto f2f + misc Index: xml-media-types.xml =================================================================== RCS file: /sources/public/2002/ws/desc/media-types/xml-media-types.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** xml-media-types.xml 23 Sep 2004 09:22:25 -0000 1.21 --- xml-media-types.xml 5 Oct 2004 02:38:37 -0000 1.22 *************** *** 142,146 **** This document addresses the need to indicate the media type associated with binary element content in an XML document and the need to specify, in XML ! Schema, the expected media types associated with binary element content. It is expected that the additional information about the media type will be used for optimizing the handling of binary data that is part of a Web --- 142,146 ---- This document addresses the need to indicate the media type associated with binary element content in an XML document and the need to specify, in XML ! Schema, the expected media type(s) associated with binary element content. It is expected that the additional information about the media type will be used for optimizing the handling of binary data that is part of a Web *************** *** 185,199 **** </p> <ulist> ! <item><p>a mechanism to indicate the media type of an ! XML element content whose type is <emph>xs:base64Binary</emph> or ! <emph>xs:hexBinary</emph>. ! </p> ! </item> ! <item><p> a mechanism to indicate in XML Schema the ! expected media type(s) for an element content whose type is ! <emph>xs:base64Binary</emph> or <emph>xs:hexBinary</emph>. ! </p> ! </item> ! </ulist> <div2 id="notational"> --- 185,214 ---- </p> <ulist> ! <item> ! <p> ! An attribute (<emph>xmlmime:contentType</emph>) to indicate the media ! type of an XML element content whose type is ! <emph>xs:base64Binary</emph> or <emph>xs:hexBinary</emph>. The value ! of the attribute is the name of a IANA media type token (e.g., ! "text/xml; charset=utf-16"). This attribute specifies the media type ! of the content of an element on which it occurs. ! </p> ! </item> ! <item> ! <p> ! A XML Schema annotation attribute ! (<emph>xmlmime:expectedMediaType</emph>) to indicate, in XML Schema, the ! expected media type(s) for an element content whose type is ! <emph>xs:base64Binary</emph> or <emph>xs:hexBinary</emph>. ! </p> ! </item> ! </ulist> ! ! <p> ! The XML Schema annotation, <emph>xmlmime:expectedMediaType</emph>, ! specifies the expected range of values for the ! <emph>xmlmime:contentType</emph> attribute and the expected range of media ! types for the binary element content. ! </p> <div2 id="notational"> *************** *** 277,281 **** define the set of media types that a binary data may have. For example, a Web services application may be willing to indicate that ! binary data represents an image, but leaves it to a document to further specify whether it is "jpeg", "gif", etc. This meta-data is not required to be present. --- 292,296 ---- define the set of media types that a binary data may have. For example, a Web services application may be willing to indicate that ! the binary data represents an image, but leaves it to a document to further specify whether it is "jpeg", "gif", etc. This meta-data is not required to be present. *************** *** 321,328 **** <emph>xs:string</emph>.</p> - <p>The [normalized value] of the <att>contentType</att> &AII; MUST be the - name of a IANA media type token, e.g., "image/png", "text/xml; charset=utf-16". - </p> - </div2> --- 336,339 ---- *************** *** 352,356 **** <ednote> ! <name>ASK</name> <edtext> The 'accept-extensions' of the HTTP 'Accept' header are not allowed in the 'expectedMediaType' attribute value. The WSD WG would like to solicit feedback on this. --- 363,367 ---- <ednote> ! <name></name> <edtext> The 'accept-extensions' of the HTTP 'Accept' header are not allowed in the 'expectedMediaType' attribute value. The WSD WG would like to solicit feedback on this. *************** *** 358,370 **** </ednote> - <p>The value of the <att>contentType</att> attribute SHOULD be - allowed by the <att>expectedMediaType</att>, if specified in the schema, as - specified by <specref ref="usage"/>. When the expectedMediaType specifies - a wildcard ("*") or a list of acceptable media types, the schema SHOULD require - the <att>contentType</att> attribute. - </p> - <p>The <att>expectedMediaType</att> attribute is intended to be used ! as part of a Schema annotation for a &BEII; declaration (see <specref ref="usage"/>). </p> --- 369,374 ---- </ednote> <p>The <att>expectedMediaType</att> attribute is intended to be used ! as part of XML Schema annotation for a &BEII; declaration (see <specref ref="usage"/>). </p> *************** *** 389,392 **** --- 393,401 ---- </ulist> + <p>The [normalized value] of the <att>contentType</att> &AII; MUST be + the name of a IANA media type token, e.g., "image/png", "text/xml; + charset=utf-16" and indicates the media type of the [owner element]. + </p> + <p>The <att>contentType</att> &AII; allows Web services applications to optimize the handling of the binary data defined by a &BEII; and should *************** *** 401,409 **** <head>Element with binary content and contentType attribute</head> <eg xml:space="preserve"> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="&xmlmimens;" --- 410,418 ---- <head>Element with binary content and contentType attribute</head> <eg xml:space="preserve"> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/ct-required" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/ct-required"> <xs:import namespace="&xmlmimens;" *************** *** 431,438 **** <p>The <att>expectedMediaType</att> attribute is used for annotating ! the schema to indicate the expected range of values for ! <att>contentType</att> attribute only. </p> <p>Applications that need to specify expected media types SHOULD use the schema annotation to declare the range of expected --- 440,456 ---- <p>The <att>expectedMediaType</att> attribute is used for annotating ! XML Schema to indicate the expected range of media types of the binary ! element content and the expected range of values for ! <att>contentType</att> attribute. </p> + <p>The value of the <att>contentType</att> attribute, if present, SHOULD + be within the range specified by the <att>expectedMediaType</att> + annotation attribute, if specified in the schema. When the + <att>expectedMediaType</att> annotation attribute has a wildcard + ("*") or a list of acceptable media types, the schema SHOULD require + the <att>contentType</att> attribute to be present. + </p> + <p>Applications that need to specify expected media types SHOULD use the schema annotation to declare the range of expected *************** *** 449,460 **** </p> <example id="eg-wildcard"> ! <head>Element with binary content and expected media type of "image/*"</head> <eg xml:space="preserve"> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="&xmlmimens;" --- 467,488 ---- </p> + <p> + The example below consists of a type definition, <el>PictureType</el>, + and an element declaration, <el>Picture</el>. The + <att>xmlmime:contentType</att> attribute is required to be present + and specifies the media type of + the binary content. The schema annotation attribute + <att>xmlmime:expectedMediaType</att> specifies that the media type + of the binary content is 'image', but the + subtype name is unknown. + </p> <example id="eg-wildcard"> ! <head>Schema declaring an element with binary content and expected media type of "image/*"</head> <eg xml:space="preserve"> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/wildcard" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/wildcard"> <xs:import namespace="&xmlmimens;" *************** *** 462,466 **** ! <xs:complexType name="pictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > --- 490,494 ---- ! <xs:complexType name="PictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > *************** *** 472,476 **** <!-- This element designates the range of values that the element definition will accept --> ! <xs:element name="Picture" type="tns:pictureType" xmlmime:expectedMediaType="image/*"/> </xs:element> --- 500,504 ---- <!-- This element designates the range of values that the element definition will accept --> ! <xs:element name="Picture" type="tns:PictureType" xmlmime:expectedMediaType="image/*"/> </xs:element> *************** *** 481,484 **** --- 509,528 ---- </example> + <p> + The example document instance below conforms to the element + declaration of <el>Picture</el> and specifies that the binary + content is of type "image/png". + </p> + + <example id="eg-wildcard-instance"> + <head>Document instance containing element with binary content type + "image/png"</head> + <eg xml:space="preserve"> + <?xml version="1.0" ?> + <Picture xmlns="http://example.com/wildcard" + xmlns:xmlmime="&xmlmimens;" + xmlmime:contentType="image/png">/aWKKapGGyQ=</Picture> + </eg> + </example> </div2> *************** *** 491,496 **** <head>Binary data with known media type</head> ! <p> Below is an ! example for using binary data whose media type is known in advance to be "image/jpeg". </p> --- 535,540 ---- <head>Binary data with known media type</head> ! <p>The example below consists of a binary element ! whose media type is known in advance to be "image/jpeg". </p> *************** *** 498,502 **** <p>In this example, the application fixes the media type by declaring it with an annotation in conjunction with the complex ! type declaration that specifies the specific binary data. </p> --- 542,546 ---- <p>In this example, the application fixes the media type by declaring it with an annotation in conjunction with the complex ! type definition. </p> *************** *** 504,512 **** <head>Element with binary content and known media type</head> <eg xml:space="preserve"> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="&xmlmimens;" --- 548,556 ---- <head>Element with binary content and known media type</head> <eg xml:space="preserve"> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/know-type" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/know-type"> <xs:import namespace="&xmlmimens;" *************** *** 514,522 **** ! <xs:complexType name="jpegPictureType" type="xs:base64Binary" xmlmime:expectedMediaType="image/jpeg"/> ! <xs:element name="JpegPicture" type="tns:JpegPictureType"/> </xs:schema> --- 558,566 ---- ! <xs:complexType name="JPEGPictureType" type="xs:base64Binary" xmlmime:expectedMediaType="image/jpeg"/> ! <xs:element name="JPEGPicture" type="tns:JpegPictureType"/> </xs:schema> *************** *** 538,546 **** <head>Element with binary content and preferred media type</head> <eg xml:space="preserve"> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="&xmlmimens;" --- 582,590 ---- <head>Element with binary content and preferred media type</head> <eg xml:space="preserve"> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/preferred-type" xmlns:xmlmime="&xmlmimens;" ! targetNamespace="http://example.com/preferred-type"> <xs:import namespace="&xmlmimens;" *************** *** 548,552 **** ! <xs:complexType name="jpegPreferredPictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > --- 592,596 ---- ! <xs:complexType name="JPEGPreferredPictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > *************** *** 556,560 **** </xs:complexType> ! <xs:element name="jpegPeferredPicture" type="tns:jpegPreferredPictureType" xmlmime:acceptedMediaType="image/jpeg;q=1.0, image/tiff;q=0.8"/> --- 600,604 ---- </xs:complexType> ! <xs:element name="JPEGPeferredPicture" type="tns:jpegPreferredPictureType" xmlmime:acceptedMediaType="image/jpeg;q=1.0, image/tiff;q=0.8"/> *************** *** 565,569 **** <ednote> ! <name>ASK</name> <edtext> This document addresses the requirements in --- 609,613 ---- <ednote> ! <name></name> <edtext> This document addresses the requirements in *************** *** 714,722 **** <eg xml:space="preserve"> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmlmime="&xmlmimens;" targetNamespace="&xmlmimens;" > <xs:attribute name="contentType" > <xs:simpleType> --- 758,767 ---- <eg xml:space="preserve"> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmlmime="&xmlmimens;" targetNamespace="&xmlmimens;" > + <!-- <xs:attribute name="contentType" > <xs:simpleType> *************** *** 727,731 **** </xs:simpleType> </xs:attribute> ! <!-- <xs:element name="expectedMediaType" > --- 772,777 ---- </xs:simpleType> </xs:attribute> ! --> ! <xs:attribute name="contentType" type="xs:string" /> <!-- <xs:element name="expectedMediaType" > *************** *** 742,747 **** </xs:simpleType> --> ! ! <xs:element name="expectedMediaType" type="xs:string" > <xs:complexType name="base64Binary" > --- 788,792 ---- </xs:simpleType> --> ! <xs:attribute name="expectedMediaType" type="xs:string" /> <xs:complexType name="base64Binary" > Index: xml-media-types.html =================================================================== RCS file: /sources/public/2002/ws/desc/media-types/xml-media-types.html,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** xml-media-types.html 23 Sep 2004 09:22:25 -0000 1.13 --- xml-media-types.html 5 Oct 2004 02:38:37 -0000 1.14 *************** *** 40,44 **** This document addresses the need to indicate the media type associated with binary element content in an XML document and the need to specify, in XML ! Schema, the expected media types associated with binary element content. It is expected that the additional information about the media type will be used for optimizing the handling of binary data that is part of a Web --- 40,44 ---- This document addresses the need to indicate the media type associated with binary element content in an XML document and the need to specify, in XML ! Schema, the expected media type(s) associated with binary element content. It is expected that the additional information about the media type will be used for optimizing the handling of binary data that is part of a Web *************** *** 127,137 **** </p><p> This document specifies: ! </p><ul><li><p>a mechanism to indicate the media type of an ! XML element content whose type is <em>xs:base64Binary</em> or ! <em>xs:hexBinary</em>. ! </p></li><li><p> a mechanism to indicate in XML Schema the ! expected media type(s) for an element content whose type is ! <em>xs:base64Binary</em> or <em>xs:hexBinary</em>. ! </p></li></ul><div class="div2"> <h3><a id="notational" name="notational"></a>1.1 Notational Conventions</h3><p>The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", --- 127,148 ---- </p><p> This document specifies: ! </p><ul><li><p> ! An attribute (<em>xmlmime:contentType</em>) to indicate the media ! type of an XML element content whose type is ! <em>xs:base64Binary</em> or <em>xs:hexBinary</em>. The value ! of the attribute is the name of a IANA media type token (e.g., ! "text/xml; charset=utf-16"). This attribute specifies the media type ! of the content of an element on which it occurs. ! </p></li><li><p> ! A XML Schema annotation attribute ! (<em>xmlmime:expectedMediaType</em>) to indicate, in XML Schema, the ! expected media type(s) for an element content whose type is ! <em>xs:base64Binary</em> or <em>xs:hexBinary</em>. ! </p></li></ul><p> ! The XML Schema annotation, <em>xmlmime:expectedMediaType</em>, ! specifies the expected range of values for the ! <em>xmlmime:contentType</em> attribute and the expected range of media ! types for the binary element content. ! </p><div class="div2"> <h3><a id="notational" name="notational"></a>1.1 Notational Conventions</h3><p>The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", *************** *** 164,168 **** define the set of media types that a binary data may have. For example, a Web services application may be willing to indicate that ! binary data represents an image, but leaves it to a document to further specify whether it is "jpeg", "gif", etc. This meta-data is not required to be present. --- 175,179 ---- define the set of media types that a binary data may have. For example, a Web services application may be willing to indicate that ! the binary data represents an image, but leaves it to a document to further specify whether it is "jpeg", "gif", etc. This meta-data is not required to be present. *************** *** 178,184 **** The <code>contentType</code> <em>attribute information item</em> has the following Infoset properties: </p><ul><li><p>A [local name] of <code>contentType</code>.</p></li><li><p>A [namespace name] of "http://www.w3.org/@@@@/@@/xmlmime".</p></li></ul><p>The type of the <code>contentType</code> <em>attribute information item</em> is ! <em>xs:string</em>.</p><p>The [normalized value] of the <code>contentType</code> <em>attribute information item</em> MUST be the ! name of a IANA media type token, e.g., "image/png", "text/xml; charset=utf-16". ! </p></div><div class="div2"> <h3><a id="expectedMediaType" name="expectedMediaType"></a>2.2 expectedMediaType attribute </h3><p> The <code>expectedMediaType</code> <em>attribute information item</em> has the following Infoset properties: </p><ul><li><p>A [local name] of <code>expectedMediaType</code>.</p></li><li><p>A [namespace name] of <code>http://www.w3.org/@@@@/@@/xmlmime</code>.</p></li></ul><p>The type of the <code>expectedMediaType</code> <em>attribute information item</em> is --- 189,193 ---- The <code>contentType</code> <em>attribute information item</em> has the following Infoset properties: </p><ul><li><p>A [local name] of <code>contentType</code>.</p></li><li><p>A [namespace name] of "http://www.w3.org/@@@@/@@/xmlmime".</p></li></ul><p>The type of the <code>contentType</code> <em>attribute information item</em> is ! <em>xs:string</em>.</p></div><div class="div2"> <h3><a id="expectedMediaType" name="expectedMediaType"></a>2.2 expectedMediaType attribute </h3><p> The <code>expectedMediaType</code> <em>attribute information item</em> has the following Infoset properties: </p><ul><li><p>A [local name] of <code>expectedMediaType</code>.</p></li><li><p>A [namespace name] of <code>http://www.w3.org/@@@@/@@/xmlmime</code>.</p></li></ul><p>The type of the <code>expectedMediaType</code> <em>attribute information item</em> is *************** *** 191,203 **** <a href="#rfc2616">[IETF RFC 2616]</a> is allowed, but other accept-extensions are not allowed. ! </p><table border="1" summary="Editorial note: ASK"><tr><td width="50%" valign="top" align="left"><b>Editorial note: ASK</b></td><td width="50%" valign="top" align="right"> </td></tr><tr><td valign="top" align="left" colspan="2"> The 'accept-extensions' of the HTTP 'Accept' header are not allowed in the 'expectedMediaType' attribute value. The WSD WG would like to solicit feedback on this. ! </td></tr></table><p>The value of the <code>contentType</code> attribute SHOULD be ! allowed by the <code>expectedMediaType</code>, if specified in the schema, as ! specified by <a href="#usage"><b>3 Declaring media types for binary data</b></a>. When the expectedMediaType specifies ! a wildcard ("*") or a list of acceptable media types, the schema SHOULD require ! the <code>contentType</code> attribute. ! </p><p>The <code>expectedMediaType</code> attribute is intended to be used ! as part of a Schema annotation for a <em>binary element information item</em> declaration (see <a href="#usage"><b>3 Declaring media types for binary data</b></a>). </p></div></div><div class="div1"> <h2><a id="usage" name="usage"></a>3 Declaring media types for binary data</h2><p>Documents that want to specify additional media type --- 200,207 ---- <a href="#rfc2616">[IETF RFC 2616]</a> is allowed, but other accept-extensions are not allowed. ! </p><table border="1" summary="Editorial note: "><tr><td width="50%" valign="top" align="left"><b>Editorial note: </b></td><td width="50%" valign="top" align="right"> </td></tr><tr><td valign="top" align="left" colspan="2"> The 'accept-extensions' of the HTTP 'Accept' header are not allowed in the 'expectedMediaType' attribute value. The WSD WG would like to solicit feedback on this. ! </td></tr></table><p>The <code>expectedMediaType</code> attribute is intended to be used ! as part of XML Schema annotation for a <em>binary element information item</em> declaration (see <a href="#usage"><b>3 Declaring media types for binary data</b></a>). </p></div></div><div class="div1"> <h2><a id="usage" name="usage"></a>3 Declaring media types for binary data</h2><p>Documents that want to specify additional media type *************** *** 206,210 **** </p><ul><li><p>An OPTIONAL <code>contentType</code> <em>attribute information item</em> as described above in <a href="#contentType"><b>2.1 contentType attribute </b></a>. </p></li><li><p>A type of the <em>binary element information item</em> must be a type derived from or equal to ! <em>xs:base64Binary</em> or <em>xs:hexBinary</em>.</p></li></ul><p>The <code>contentType</code> <em>attribute information item</em> allows Web services applications to optimize the handling of the binary data defined by a <em>binary element information item</em> and should be considered as meta-data. The presence of the <code>contentType</code> --- 210,217 ---- </p><ul><li><p>An OPTIONAL <code>contentType</code> <em>attribute information item</em> as described above in <a href="#contentType"><b>2.1 contentType attribute </b></a>. </p></li><li><p>A type of the <em>binary element information item</em> must be a type derived from or equal to ! <em>xs:base64Binary</em> or <em>xs:hexBinary</em>.</p></li></ul><p>The [normalized value] of the <code>contentType</code> <em>attribute information item</em> MUST be ! the name of a IANA media type token, e.g., "image/png", "text/xml; ! charset=utf-16" and indicates the media type of the [owner element]. ! </p><p>The <code>contentType</code> <em>attribute information item</em> allows Web services applications to optimize the handling of the binary data defined by a <em>binary element information item</em> and should be considered as meta-data. The presence of the <code>contentType</code> *************** *** 213,222 **** and <code>xmlmime:hexBinary</code> are defined in <a href="#appendix"><b>B Appendix Schema</b></a> </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-ct-required" name="eg-ct-required"></a>Example: Element with binary content and contentType attribute</div><div class="exampleInner"><pre> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" --- 220,229 ---- and <code>xmlmime:hexBinary</code> are defined in <a href="#appendix"><b>B Appendix Schema</b></a> </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-ct-required" name="eg-ct-required"></a>Example 1: Element with binary content and contentType attribute</div><div class="exampleInner"><pre> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/ct-required" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/ct-required"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" *************** *** 239,244 **** </pre></div></div><div class="div2"> <h3><a id="role" name="role"></a>3.1 Role of expectedMediaType Schema annotation attribute</h3><p>The <code>expectedMediaType</code> attribute is used for annotating ! the schema to indicate the expected range of values for ! <code>contentType</code> attribute only. </p><p>Applications that need to specify expected media types SHOULD use the schema annotation to declare the range of expected --- 246,258 ---- </pre></div></div><div class="div2"> <h3><a id="role" name="role"></a>3.1 Role of expectedMediaType Schema annotation attribute</h3><p>The <code>expectedMediaType</code> attribute is used for annotating ! XML Schema to indicate the expected range of media types of the binary ! element content and the expected range of values for ! <code>contentType</code> attribute. ! </p><p>The value of the <code>contentType</code> attribute, if present, SHOULD ! be within the range specified by the <code>expectedMediaType</code> ! annotation attribute, if specified in the schema. When the ! <code>expectedMediaType</code> annotation attribute has a wildcard ! ("*") or a list of acceptable media types, the schema SHOULD require ! the <code>contentType</code> attribute to be present. </p><p>Applications that need to specify expected media types SHOULD use the schema annotation to declare the range of expected *************** *** 253,263 **** for the <em>binary element information item</em> MUST be a subset of the expected range of values defined for the complex type. </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-wildcard" name="eg-wildcard"></a>Example: Element with binary content and expected media type of "image/*"</div><div class="exampleInner"><pre> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" --- 267,286 ---- for the <em>binary element information item</em> MUST be a subset of the expected range of values defined for the complex type. + </p><p> + The example below consists of a type definition, <code>PictureType</code>, + and an element declaration, <code>Picture</code>. The + <code>xmlmime:contentType</code> attribute is required to be present + and specifies the media type of + the binary content. The schema annotation attribute + <code>xmlmime:expectedMediaType</code> specifies that the media type + of the binary content is 'image', but the + subtype name is unknown. </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-wildcard" name="eg-wildcard"></a>Example 2: Schema declaring an element with binary content and expected media type of "image/*"</div><div class="exampleInner"><pre> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/wildcard" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/wildcard"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" *************** *** 265,269 **** ! <xs:complexType name="pictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > --- 288,292 ---- ! <xs:complexType name="PictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > *************** *** 275,279 **** <!-- This element designates the range of values that the element definition will accept --> ! <xs:element name="Picture" type="tns:pictureType" xmlmime:expectedMediaType="image/*"/> </xs:element> --- 298,302 ---- <!-- This element designates the range of values that the element definition will accept --> ! <xs:element name="Picture" type="tns:PictureType" xmlmime:expectedMediaType="image/*"/> </xs:element> *************** *** 281,299 **** </xs:schema> </pre></div></div></div></div><div class="div1"> <h2><a id="more-ex" name="more-ex"></a>4 Examples</h2><div class="div2"> ! <h3><a id="static" name="static"></a>4.1 Binary data with known media type</h3><p> Below is an ! example for using binary data whose media type is known in advance to be "image/jpeg". </p><p>In this example, the application fixes the media type by declaring it with an annotation in conjunction with the complex ! type declaration that specifies the specific binary data. </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-static" name="eg-static"></a>Example: Element with binary content and known media type</div><div class="exampleInner"><pre> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" --- 304,333 ---- </xs:schema> + </pre></div></div><p> + The example document instance below conforms to the element + declaration of <code>Picture</code> and specifies that the binary + content is of type "image/png". + </p><div class="exampleOuter"> + <div class="exampleHeader"><a id="eg-wildcard-instance" name="eg-wildcard-instance"></a>Example 3: Document instance containing element with binary content type + "image/png"</div><div class="exampleInner"><pre> + <?xml version="1.0" ?> + <Picture xmlns="http://example.com/wildcard" + xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" + xmlmime:contentType="image/png">/aWKKapGGyQ=</Picture> </pre></div></div></div></div><div class="div1"> <h2><a id="more-ex" name="more-ex"></a>4 Examples</h2><div class="div2"> ! <h3><a id="static" name="static"></a>4.1 Binary data with known media type</h3><p>The example below consists of a binary element ! whose media type is known in advance to be "image/jpeg". </p><p>In this example, the application fixes the media type by declaring it with an annotation in conjunction with the complex ! type definition. </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-static" name="eg-static"></a>Example 4: Element with binary content and known media type</div><div class="exampleInner"><pre> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/know-type" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/know-type"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" *************** *** 301,309 **** ! <xs:complexType name="jpegPictureType" type="xs:base64Binary" xmlmime:expectedMediaType="image/jpeg"/> ! <xs:element name="JpegPicture" type="tns:JpegPictureType"/> </xs:schema> --- 335,343 ---- ! <xs:complexType name="JPEGPictureType" type="xs:base64Binary" xmlmime:expectedMediaType="image/jpeg"/> ! <xs:element name="JPEGPicture" type="tns:JpegPictureType"/> </xs:schema> *************** *** 314,323 **** allowed (with a lower preference). </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-preferred" name="eg-preferred"></a>Example: Element with binary content and preferred media type</div><div class="exampleInner"><pre> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/thisexample" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/thisexample"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" --- 348,357 ---- allowed (with a lower preference). </p><div class="exampleOuter"> ! <div class="exampleHeader"><a id="eg-preferred" name="eg-preferred"></a>Example 5: Element with binary content and preferred media type</div><div class="exampleInner"><pre> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ! xmlns:tns="http://example.com/preferred-type" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" ! targetNamespace="http://example.com/preferred-type"> <xs:import namespace="http://www.w3.org/@@@@/@@/xmlmime" *************** *** 325,329 **** ! <xs:complexType name="jpegPreferredPictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > --- 359,363 ---- ! <xs:complexType name="JPEGPreferredPictureType"> <xs:simpleContent> <xs:restriction base="xmlmime:base64Binary" > *************** *** 333,342 **** </xs:complexType> ! <xs:element name="jpegPeferredPicture" type="tns:jpegPreferredPictureType" xmlmime:acceptedMediaType="image/jpeg;q=1.0, image/tiff;q=0.8"/> </xs:schema> ! </pre></div></div><table border="1" summary="Editorial note: ASK"><tr><td width="50%" valign="top" align="left"><b>Editorial note: ASK</b></td><td width="50%" valign="top" align="right"> </td></tr><tr><td valign="top" align="left" colspan="2"> This document addresses the requirements in <a href="http://www.w3.org/2000/xp/Group/xmlp-issues#x443">Issue 443</a> of --- 367,376 ---- </xs:complexType> ! <xs:element name="JPEGPeferredPicture" type="tns:jpegPreferredPictureType" xmlmime:acceptedMediaType="image/jpeg;q=1.0, image/tiff;q=0.8"/> </xs:schema> ! </pre></div></div><table border="1" summary="Editorial note: "><tr><td width="50%" valign="top" align="left"><b>Editorial note: </b></td><td width="50%" valign="top" align="right"> </td></tr><tr><td valign="top" align="left" colspan="2"> This document addresses the requirements in <a href="http://www.w3.org/2000/xp/Group/xmlp-issues#x443">Issue 443</a> of *************** *** 406,426 **** </p></div><div class="div1"> <h2><a id="appendix" name="appendix"></a>B Appendix Schema</h2><div class="exampleInner"><pre> ! <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" targetNamespace="http://www.w3.org/@@@@/@@/xmlmime" > - <xs:attribute name="contentType" > - <xs:simpleType> - <xs:restriction base="xs:string" > - <xs:pattern value="(text|application|image|audio|video|model|x-[-.a-z0-9]+)/ - [a-z0-9][-.+a-z0-9]+(;\s?.+=.+)*" /> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - ! <xs:element name="expectedMediaType" type="xs:string" > <xs:complexType name="base64Binary" > --- 440,452 ---- </p></div><div class="div1"> <h2><a id="appendix" name="appendix"></a>B Appendix Schema</h2><div class="exampleInner"><pre> ! <?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmlmime="http://www.w3.org/@@@@/@@/xmlmime" targetNamespace="http://www.w3.org/@@@@/@@/xmlmime" > + <xs:attribute name="contentType" type="xs:string" /> ! <xs:attribute name="expectedMediaType" type="xs:string" /> <xs:complexType name="base64Binary" >
Received on Tuesday, 5 October 2004 02:38:39 UTC