Infoset formulation of XOP

Mark Nottingham <[email protected]>
Newsgroups gmane.text.xml.distributed
Message-ID <[email protected]>
To satisfy my AI, please find attached an Infoset formulation of XOP.



--
Mark Nottingham   Principal Technologist
Office of the CTO   BEA Systems
xop.html (text/html, 32.3 KB)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>XML-binary Optimized Packaging</title><style type="text/css">
code           { font-family: monospace; }

div.constraint,
div.issue,
div.note,
div.notice     { margin-left: 2em; }



.diff-chg	{ background-color: orange; }
.diff-del	{ background-color: red; text-decoration: line-through;}
.diff-add	{ background-color: lime; }

table          { empty-cells: show; }


div.exampleInner pre { margin-left: 1em;
                       margin-top: 0em; margin-bottom: 0em}
div.exampleOuter {border: 4px double gray;
                  margin: 0em; padding: 0em}
div.exampleInner { background-color: #d5dee3;
                   border-top-width: 4px;
                   border-top-style: double;
                   border-top-color: #d3d3d3;
                   border-bottom-width: 4px;
                   border-bottom-style: double;
                   border-bottom-color: #d3d3d3;
                   padding: 4px; margin: 0em }
div.exampleWrapper { margin: 4px }
div.exampleHeader { font-weight: bold;
                    margin: 4px}
</style><link type="text/css" rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/base.css"></head><body>

  
  
  

  <div class="head">
<h1>XML-binary Optimized Packaging</h1>
<h2>Editors Copy $Date: 2004/02/25 18:11:18 $ 27 January 2004</h2><dl><dt>This version:</dt><dd>
      <a href="http://www.w3.org/TR/2004/WD-soap12-xop-20040127">http://www.w3.org/TR/2004/WD-soap12-xop-20040127</a> 
    </dd><dt>Latest version:</dt><dd>
      <a href="http://www.w3.org/TR/soap12-xop">
	http://www.w3.org/TR/soap12-xop</a>
    </dd><dt>Editors:</dt>
      <dd>Noah Mendelsohn, IBM</dd>
      <dd>Mark Nottingham, BEA</dd>
      <dd>Herv&eacute; Ruellan, Canon</dd>
    </dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy;2003 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>(<a href="http://www.lcs.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">viability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>, <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-software">software licensing</a> rules apply.</p></div><hr><div>
<h2><a name="abstract">Abstract</a></h2>
      <p>
	This document defines the XML-binary Optimized Packaging (XOP)
	convention, a means of more efficiently serializing XML Infosets that have certain types of content.
      </p>
    </div><div>
<h2><a name="status">Status of this Document</a></h2><p><strong>This document is an editors' copy that has
        no official standing.</strong></p>

      <p><em>
	  This section describes the status of this document at the time of its
	  publication. Other documents may supersede this document. The latest
	  status of this document series is maintained at the W3C.
      </em></p>

      <p>
	This is an editor's copy of the XML-binary Optimized Packaging
	document. It has been produced by the <a href="http://www.w3.org/2000/xp/Group/">XML Protocol Working Group</a> (WG),
	which is part of the <a href="http://www.w3.org/2002/ws/Activity"> Web Services
	  Activity</a>.
      </p>

      <p>
	Discussion of this document takes place on the public <a href="mailto:[email protected]">[email protected]</a> mailing
	list <a href="http://lists.w3.org/Archives/Public/xml-dist-app/">(public
	  archive)</a> under the email communication rules in the <a href="http://www.w3.org/2000/09/XML-Protocol-Charter"> XML Protocol Working
	  Group Charter </a>.
      </p>

      <p>
	Comments on this document are welcome. Send them to <a href="mailto:[email protected]">[email protected]</a> mailing
	list <a href="http://lists.w3.org/Archives/Public/xmlp-comments/">(public
	  archive)</a>. Note that all outstanding issues against this
	document are documented in the Working Group <a href="http://www.w3.org/2000/xp/Group/xmlp-issues">Issues List</a>.
      </p>

      <p>
	Patent disclosures relevant to this specification may be found on the
	Working Group's <a href="http://www.w3.org/2000/xp/Group/2/10/16-IPR-statements.html">patent
	  disclosure page</a>.
      </p>

    </div>

  
  
  

  <hr><div class="toc">
<h2><a name="shortcontents">Short Table of Contents</a></h2><p class="toc">1. <a href="#introduction">Introduction</a><br>2. <a href="#xop_packages">XOP Packages</a><br>3. <a href="#xop_data_models">XOP Infosets Constructs</a><br>4. <a href="#xop_processing_model">XOP's Processing Model</a><br>5. <a href="#identifying_xop_documents">Identifying XOP Documents</a><br>6. <a href="#security_considerations">Security Considerations</a><br>A. <a href="#references">References</a><br>B. <a href="#changelog">Change Log</a> (Non-Normative)<br></p></div><hr><div class="toc">

<h2><a name="contents">Table of Contents</a></h2><p class="toc">1. <a href="#introduction">Introduction</a><br>&nbsp;&nbsp;&nbsp;&nbsp;1.1 <a href="#terminology">Terminology</a><br>&nbsp;&nbsp;&nbsp;&nbsp;1.2 <a href="#example">Example</a><br>&nbsp;&nbsp;&nbsp;&nbsp;1.3 <a href="#notational_conventions">Notational Conventions</a><br>2. <a href="#xop_packages">XOP Packages</a><br>&nbsp;&nbsp;&nbsp;&nbsp;2.1 <a href="#mime_xop_packages">MIME Multipart/Related XOP Packages</a><br>3. <a href="#xop_data_models">XOP Infoset Constructs</a><br>&nbsp;&nbsp;&nbsp;&nbsp;3.1 <a href="#xop_include">xop:Include Element Information Item</a><br>&nbsp;&nbsp;&nbsp;&nbsp;3.2 <a href="#xop_href">href Attribute Information Item</a><br>&nbsp;&nbsp;&nbsp;&nbsp;3.3 <a href="#xop_content_type">xop-mime:content-type Attribute Information Item</a><br>4. <a href="#xop_processing_model">XOP's Processing Model</a><br>&nbsp;&nbsp;&nbsp;&nbsp;4.1 <a href="#creating_xop_packages">Creating XOP Packages</a><br>&nbsp;&nbsp;&nbsp;&nbsp;4.2 <a href="#interpreting_xop_packages">Interpreting XOP Packages</a><br>5. <a href="#identifying_xop_documents">Identifying XOP Documents</a><br>6. <a href="#security_considerations">Security Considerations</a><br></p>
<h3><a id="appendix" name="appendix">Appendices</a></h3><p class="toc">A. <a href="#references">References</a><br>B. <a href="#changelog">Change Log</a> (Non-Normative)<br></p></div><hr><div class="body">

    
    
    
    <div class="div1">
      
<h2><a name="introduction"></a>1. Introduction</h2>

      <p>
	This specification defines the XML-binary Optimized Packaging (XOP)
	convention, a means of more efficiently serializing XML Infosets that have    certain types of content.
      </p>

      <p>
	A XOP package is created by placing a serialization of an XML Infoset
	inside of an extensible packaging format (such as MIME
	Multipart/Related, see <a href="#RFC2387">[RFC 2387]</a>) and then re-encoding
	selected portions of its content alongside it, while marking their
	locations in the XML with a special element that links to the packaged
	data using URIs.
      </p>

      <p>
	Optimization in XOP is limited to the content of those elements which
	contain characters that can be interpreted as the canonical lexical
	representation of the XML Schema <code>base64Binary</code>  datatype (see
	<a href="#XMLSchemaP2">[XML Schema Part 2]</a> <a href="http://www.w3.org/TR/xmlschema-2/#base64Binary">3.2.16
	  base64Binary</a> and <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-54">Errata in XML
	  Schema, E2-54</a>).  Attributes, non-base64-compatible
	character data, and data not in the canonical representation of the
	<code>base64Binary</code>  datatype cannot be successfully optimized by
	XOP.
      </p>

      <table border="1" summary="Editorial note: HR"><tr><td width="50%" valign="top" align="left"><b>Editorial note: HR</b></td><td width="50%" valign="top" align="right">&nbsp;</td></tr><tr><td valign="top" align="left" colspan="2">
	  Track change of any XML Schema spec new edition incorporating the
	  Erratas, to replace the double reference by only one.
	</td></tr></table>

      <p>
	This specification uses terminology from the XML Infoset when discussing
	XML content and structure. This is only a convention for the clear
	specification of XOP's behaviour. When doing so, this specification
	abbreviates some Information Item types for clarity; for example
	<em>Element</em>, when used in this specification, refers to an
	<em>Element Information Item</em>, and <em>Attribute</em> refers to an
	<em>Attribute Information Item</em>.
      </p>

      <p>
	The remainder of this specification is organized in the following
	fashion:
      </p>

      <ul>
	<li>
	  <p>
	    Section Two of this specification describes the form of the XOP
	    Package.
	  </p>
	</li>

	<li>
	  <p>
	    Section Three describes the XOP Infoset, which preserves the
	    non-optimized content and structure of the original Infoset.
	  </p>
	</li>

	<li>
	  <p>
	    Section Four specifies XOP's processing model.
	  </p>
	</li>

	<li>
	  <p>
	    Section Five describes how XOP Documents are identified.
	  </p>
	</li>

	<li>
	  <p>
	    Section Six explores the security considerations of using the XOP
	    convention.
	  </p>
	</li>

      </ul>

      
      
      
      <div class="div2">
	
<h3><a name="terminology"></a>1.1 Terminology</h3>

	<p>
	  The following terms are used in this specification:
	</p>

	<ul>
	  <li>
	    <b>Original XML Infoset</b> - An XML Infoset to be optimized.
	  </li>
	  <li>
	    <b>Extracted Content</b> - Optimized content which has
	    been removed from the Infoset.
	  </li>
	  <li>
	    <b>XOP Infoset</b> - The Original Infoset with
	    any Extracted Content removed and replaced by
	    <code>xop:Include</code> elements.
	  </li>
	  <li>
	    <b>XOP Document</b> - A serialization of the XOP 
	    Infoset using XML 1.0.
	  </li>
	  <li>
	    <b>XOP Package</b> - A package containing the XOP
	    Document and any Extracted Content. As a whole, the XOP Package
	    is an alternate serialization of the Original Infoset.
	  </li>
	  <li>
	    <b>Reconstituted XML Infoset</b> - An XML Infoset that has been
	    constructed from the parts of a XOP Package.
	  </li>
	</ul>

	<img src="XOP-architecture.png" alt="Architecture of the XOP framework">
	  <p align="center">Figure 1: Architecture of the XOP framework</p>
	

      </div>


      
      
      
      <div class="div2">
	
<h3><a name="example"></a>1.2 Example</h3>

	<p>
	  <a href="#xml_infoset_sample"><b>Example 1</b></a> shows an XML Infoset prior to XOP
	  processing. <a href="#xop_package_sample"><b>Example 2</b></a> shows the same
	  Infoset, serialized using the XOP format in a MIME Multipart/Related
	  package. The base64-encoded content of the <code>m:photo</code>  and
	  <code>m:sig</code>  elements have been replaced by a
	  <code>xop:Include</code>  element, while the binary octets have been
	  serialized in separate MIME parts.
	</p>

	<div class="exampleOuter">
	  
<div class="exampleHead">Example 1: XML Infoset prior to XOP processing</div>
	  <div class="exampleInner"><pre>&lt;soap:Envelope
    xmlns:soap='http://www.w3.org/2003/05/soap-envelope' 
    xmlns:xop='http://www.w3.org/2003/12/xop/include' 
    xmlns:xop-mime='http://www.w3.org/2003/12/xop/mime'&gt;
  &lt;soap:Body&gt;
    &lt;m:data xmlns:m='http://example.org/stuff'&gt;
      &lt;m:photo xop-mime:content-type='image/png'&gt;
        /aWKKapGGyQ=
      &lt;/m:photo&gt;
      &lt;m:sig xop-mime:content-type='application/pkcs7-signature'&gt;
        Faa7vROi2VQ=
      &lt;/m:sig&gt;
    &lt;/m:data&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre></div>
	</div>

	<div class="exampleOuter">
	  
<div class="exampleHead">Example 2: XML Infoset serialized as a XOP package</div>
	  <div class="exampleInner"><pre>MIME-Version: 1.0
Content-Type: Multipart/Related;boundary=MIME_boundary;
	      type=text/xml;start="&lt;[email protected]&gt;"
Content-Description: An XML document with my picture and signature in it

--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: &lt;[email protected]&gt;

&lt;soap:Envelope
    xmlns:soap='http://www.w3.org/2003/05/soap-envelope'
    xmlns:xop='http://www.w3.org/2003/12/xop/include'
    xmlns:xop-mime='http://www.w3.org/2003/12/xop/mime'&gt;
  &lt;soap:Body&gt;
    &lt;m:data xmlns:m='http://example.org/stuff'&gt;
      &lt;m:photo xop-mime:content-type='image/png'&gt;
        &lt;xop:Include href='cid:http://example.org/me.png'/&gt;
      &lt;/m:photo&gt;
      &lt;m:sig xop-mime:content-type='application/pkcs7-signature'&gt;
        &lt;xbinc:Include href='cid:http://example.org/my.hsh'/&gt;
      &lt;/m:sig&gt;
    &lt;/m:data&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;

--MIME_boundary
Content-Type: image/png
Content-Transfer-Encoding: binary
Content-ID: &lt;http://example.org/me.png&gt;

// binary octets for png

--MIME_boundary
Content-Type: application/pkcs7-signature
Content-Transfer-Encoding: binary
Content-ID: &lt;http://example.org/my.hsh&gt;

// binary octets for signature

--MIME_boundary--</pre></div>
	</div>

      </div>

      
      
      
      <div class="div2">
	
<h3><a name="notational_conventions"></a>1.3 Notational Conventions</h3>

	<p>
	  The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
	  "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
	  document are to be interpreted as described in RFC 2119 <a href="#RFC2119">[RFC 2119]</a>.
	</p>

	<p>
	  This specification uses a number of namespace prefixes throughout;
	  they are listed below. Note that the choice of any namespace prefix
	  is arbitrary and not semantically significant.
	</p>

	<a name="tabnsprefixes"></a><table border="1">
	  <caption>Table 1: Prefixes and Namespaces used in this
	    specification.</caption>
	  <tbody>
	    <tr>
	      <th rowspan="2" colspan="1">Prefix</th>
	      <th rowspan="1" colspan="1">Namespace</th>
	    </tr>
	    <tr>
	      <th rowspan="1" colspan="1">Notes</th>
	    </tr>

	    <tr>
	      <td rowspan="2" colspan="1">xop</td>
	      <td rowspan="1" colspan="1">"http://www.w3.org/2003/12/xop/include"</td>
	    </tr>
	    <tr>
	      <td rowspan="1" colspan="1">
		A normative XML Schema <a href="#XMLSchemaP1">[XML Schema Part 1]</a>, <a href="#XMLSchemaP2">[XML Schema Part 2]</a> document for the
		"http://www.w3.org/2003/12/xop/include"
		namespace can be found at <a href="http://www.w3.org/2000/xp/Group/3/06/Attachments/include.xsd">http://www.w3.org/2000/xp/Group/3/06/Attachments/include.xsd</a>.
	      </td>
	    </tr>

	    <tr>
	      <td rowspan="2" colspan="1">xop-mime</td>
	      <td rowspan="1" colspan="1">"http://www.w3.org/2003/12/xop/mime"</td>
	    </tr>
	    <tr>
	      <td rowspan="1" colspan="1">
		[TBD]
	      </td>
	    </tr>

	    <tr>
	      <td rowspan="2" colspan="1">xs</td>
	      <td rowspan="1" colspan="1">"http://www.w3.org/2001/XMLSchema"</td>
	    </tr>
	    <tr>
	      <td rowspan="1" colspan="1">
		The namespace of XML Schema data types <a href="#XMLSchemaP2">[XML Schema Part 2]</a>.
	      </td>
	    </tr>

	  </tbody>
	</table>

      </div>
    </div>

    
    
    
    <div class="div1">
      
<h2><a name="xop_packages"></a>2. XOP Packages</h2>

      <p>
	XOP is capable of using a variety of underlying packaging mechanisms.
	This section specifies how a particular packaging mechanism, MIME
	Multipart/Related, is used, but does not preclude the use of other
	packaging mechanisms with the XOP convention.
      </p>

      
      
      
      <div class="div2">
	
<h3><a name="mime_xop_packages"></a>2.1 MIME Multipart/Related XOP Packages</h3>

	<p>
	  This section describes how MIME Multipart/Related packaging (as specified in
	  <a href="#RFC2387">[RFC 2387]</a>) is used with XOP.
	</p>

	<p>
	  The root MIME part is the root part of the package, and MUST be an
	  XML 1.0 serialization <a href="#XML">[XML 1.0]</a> of the XOP Infoset, as
	  defined below, and MUST be identified with the [ TBD ] media type.
	</p>

	<table border="1" summary="Editorial note: HR"><tr><td width="50%" valign="top" align="left"><b>Editorial note: HR</b></td><td width="50%" valign="top" align="right">&nbsp;</td></tr><tr><td valign="top" align="left" colspan="2">Need to define the media type.</td></tr></table>

	<p>
	  Except for purposes of determining the root MIME part, as specified
	  by <a href="#RFC2387">[RFC 2387]</a>, ordering of MIME parts MUST NOT be
	  considered significant to XOP processing or to the construction of
	  the XOP Infoset.
	</p>

	<p>
	  Part metadata is reflected in MIME header fields. Specifically, if
	  the URI used in the value of a <code>xop:Include</code>  element's
	  <code>href</code>  attribute has a 'cid' scheme, the corresponding MIME
	  part's Content-ID header field MUST have a corresponding field-value.
	  Otherwise, the MIME part's Content-Location header field MUST have a
	  field-value identical to the URI in the value of the <code>href</code> 
	  attribute.
	</p>

	<p>
	  Furthermore, if a <code>xop-mime:content-type</code>  header is found (as
	  described in <a href="#xop_processing_model"><b>4. XOP's Processing Model</b></a>), it SHOULD be
	  reflected in the MIME Content-Type header's field-value.
	</p>

      </div>

    </div>

    
    
    
      <div class="div1">
	
<h2><a name="xop_data_models"></a>3. XOP Infoset Constructs</h2>

      <p>
	  XOP operates by transforming the supplied Original Infoset into a
	  more compact XML representation, which is achieved by removing the
	  <em>Character</em> children of <em>Elements</em> to be
	  optimized and replacing them with an <em>Element</em> named
	  <code>xop:Include</code> . The <code>xop:Include</code>  <em>Element
	  </em> contains an <em>Attribute</em> with a link to
	  the structure that is created to carry a binary representation of the
	  data removed from the original <em>Element</em>. Details of
	  the construction and processing of XOP serializations are provided in
	  <a href="#xop_processing_model"><b>4. XOP's Processing Model</b></a>.
	</p>

      <p>
	The Infoset used as input to XOP processing MUST NOT contain any
	<em>Element</em> with a namespace name of
	<code>http://www.w3.org/2003/12/xop/include</code> and a localname of
	<code>Include</code>.  Infosets containing such <em>Elements</em> cannot
	be serialized using XOP.
	</p>

      <p>
	  The following subsections provide formal definitions for the
	  <em>Elements</em> and <em>Attributes</em> used to
	  construct a XOP serialization.
	</p>

      
      
      
      <div class="div2">
	
<h3><a name="xop_include"></a>3.1 <code>xop:Include</code> <em>Element Information Item</em></h3>

	<p>
	  The <code>xop:Include</code> <em>Element</em> property values
	  are as follows:
	</p>

	<ul>
	  <li>
	    <b>nanemspace name</b> MUST be
	    <code>http://www.w3.org/2003/12/xop/include</code>.
	  </li>
	  <li><b>localname</b> MUST be <code>Include</code>.</li>
	  <li>
	    <b>children</b> MUST NOT contain any <em>Information Item</em>.
	  </li>
	  <li>
	    There MAY be more than one <em>Attributes</em> comprising
	    <b>attributes</b>. Among these MUST be the following:

	    <ul>
	      <li>
		<code>href</code>  <em>Attribute</em> (see <a href="#xop_href"><b>3.2 href Attribute Information Item</b></a>).
	      </li>
	    </ul>

	  </li>
	  <li>
	    Other properties such as <b>base-uri</b>, <b>parent</b> nad
	    <b>in-scope namespaces</b> MUST be set according to the context.
	  </li>
	</ul>

	<table border="1" summary="Editorial note: Gudge"><tr><td width="50%" valign="top" align="left"><b>Editorial note: Gudge</b></td><td width="50%" valign="top" align="right">&nbsp;</td></tr><tr><td valign="top" align="left" colspan="2">
	    Should not allow other children either.
	  </td></tr></table>

      </div>
  
      
      
      
      <div class="div2">
	
<h3><a name="xop_href"></a>3.2 <code>href</code>  <em>Attribute</em></h3>

	<p>
	  The <code>href</code> <em>Attribute</em> has the following
	  Infoset property values:
	</p>

	<ul>
	  <li>
	    <b>namespace name</b> MUST be empty.
	  </li>
	  <li>
	    <b>localname</b> MUST be <code>href</code>.
	  </li>
	  <li>
	    <b>normalized value</b> MUST be a representation of a URI referencing
	    the part of the package containing the data logically included by
	    the <b>parent</b> <em>Element</em> (i.e., the
	    <code>xop:Include</code> <em>Element</em>).
	  </li>
	  <li>
	    <b>owner element</b> MUST be the <code>xop:Include</code>  <em>Element
	    </em> which is parent of the <em>Attribute</em>.
	  </li>
	</ul>

      </div>

      
      
      
      <div class="div2">
	
<h3><a name="xop_content_type"></a>3.3 <code>xop-mime:content-type</code>  <em>Attribute Information Item</em></h3>

	<p>
	  The <code>xop-mime:content-type</code> <em>Attribute</em> has
	  the following Infoset property values:
	</p>

	<ul>
	  <li>
	    <b>namespace name</b> MUST be
	    <code>http://www.w3.org/2003/12/xop/mime</code>.
	  </li>
	  <li><b>localname</b> MUST be <code>content-type</code>.</li>
	  <li>
	    <b>normalized value</b> MUST be the content-type of the binary data
	    represented as base64 encoded data in the <em>Element</em>
	    parent of this <em>Attribute</em>.
	  </li>
	  <li>
	    <b>owner element</b> MUST be set according to the context.
	  </li>
	</ul>

	<table border="1" summary="Editorial note: HR"><tr><td width="50%" valign="top" align="left"><b>Editorial note: HR</b></td><td width="50%" valign="top" align="right">&nbsp;</td></tr><tr><td valign="top" align="left" colspan="2">
	    Write the corresponding schema.
	  </td></tr></table>

      </div>

    </div>

    
    
    

    <div class="div1">
      
<h2><a name="xop_processing_model"></a>4. XOP's Processing Model</h2>

      <p>
	This section describe XOP's Processing Model, both for creating XOP
	Packages and interpreting XOP Packages.  Unless otherwise stated,
	processing of XOP Packages MUST be semantically equivalent to
	performing the specified steps separately, and in the order given.
      </p>

      
      
      
      <div class="div2">
	
<h3><a name="creating_xop_packages"></a>4.1 Creating XOP Packages</h3>

	<p>
	  To create a XOP Package from an Original XML Infoset:
	</p>

	<ol>
	  <li>
	    Ensure that the Original Infoset contains no <em>Element
	    </em> with a <b>namespace name</b> of
	    <code>http://www.w3.org/2003/12/xop/include</code> and a <b>localname</b> of <code>Include</code>. As
	    discussed in <a href="#xop_data_models"><b>3. XOP Infoset Constructs</b></a>, Infosets with
	    such <em>Elements</em> cannot be represented using XOP.
	  </li>
	  <li>
	    Create an empty package.
	  </li>
	  <li>
	    Identify within the Original Infoset the <em>Elements </em> to be
	    optimized. Such <em>Information Items</em>' children MUST only be
	    <code>characters</code> representing the canonical lexical form of
	    base64Binary as described in <a
	    href="http://www.w3.org/2001/05/xmlschema-errata#e2-54">Errata in XML
	    Schema, E2-54</a>.
	  </li>
	  <li>
	    Create a XOP Infoset which is a copy of the Original Infoset,
	    but with the <b>children</b> of each <em>Element</em>
	    identified in the previous step replaced by a
	    <code>xop:Include</code> <em>Element</em> (see <a href="#xop_include"><b>3.1 xop:Include Element Information Item</b></a>) constructed as follows:

	    <ol>
	      <li>
		Transform the replaced characters into binary data by
		processing them as base64-encoded data.
	      </li>
	      <li>
		Serialize the binary data into a new part of the package, with
		appropriate metadata corresponding to the <b>normalized value</b>
		of the <code>href</code> <em>Attribute</em> of the
		<code>xop:Include</code> <em>Element</em> (see <a href="#xop_href"><b>3.2 href Attribute Information Item</b></a>).
	      </li>
	      <li>
		If the <em>Information Item</em> being optimized (i.e., the
		<b>parent</b> of the newly inserted <code>xop:Include</code> 
		<em>Element</em>) has a
		<code>xop-mime:content-type</code> <em>Attribute</em>,
		its value SHOULD be reflected appropriately in the part's
		metadata.
	      </li>
	    </ol>
	  </li>
	  <li>
	    Serialize the resulting XOP Infoset into the package as XML 1.0
	    and identify it as the root part according to the packaging
	    mechanism's convention.
	  </li>
	</ol>

	<p>
	  Additional parts MAY be added to the package to satisfy application
	  specific requirements.  Other content-specific metadata MAY be
	  reflected in the packaging metadata as appropriate.
	</p>

	<p>
	  If content cannot be successfully encoded into the XOP Infoset,
	  implementations SHOULD behave as if that portion of the Original
	  Infoset was not nominated for optimization.
	</p>

      </div>

      
      
      
      <div class="div2">
	
<h3><a name="interpreting_xop_packages"></a>4.2 Interpreting XOP Packages</h3>

	<p>
	  To create a Reconstituted Infoset from a XOP Package:
	</p>

	<ol>
	  <li>
	    Parse the root part of the package as an XML 1.0 document to
	    construct an XML Infoset (see <a href="#XMLInfoSet">[XML InfoSet]</a>). 	  
       </li>

	  <li>
	    Using that Infoset, for each <em>Element</em> which has
	    as its <b>children</b> a <code>xop:Include</code>  <em>Element
	      </em> (as defined in <a href="#xop_include"><b>3.1 xop:Include Element Information Item</b></a>):
	    <ol>
	      <li>
		Locate the part of the package corresponding to the URI in the
		<code>xop:Include</code>'s <code>href</code>  <em>Attribute
		</em> (i.e., corresponding to the URI encoded in the
		<em>Attribute</em>'s <b>normalized value</b>).
	      </li>
	      <li>
		Replace the <em>Element</em>'s <b>children</b> with
		<em>characters</em> containing the canonical base64
		encoding of the entity body of the identified package part
		(i.e., effectively replace the <code>xop:Include</code> 
		<em>Element</em> with the data reconstructed from the
		package part).
	      </li>
	    </ol>
	  </li>
	</ol>

      </div>

    </div>


    
    
    
    <div class="div1">
      
<h2><a name="identifying_xop_documents"></a>5. Identifying XOP Documents</h2>

      <p>
	[TBD]
      </p>
    </div>

    
    
    
    <div class="div1">
      
<h2><a name="security_considerations"></a>6. Security Considerations</h2>

      <p>
	[TBD]
      </p>
    </div>

  </div>

  
  
  
  <div class="back">

    
    
    
    
    
    <div class="div1">
      
<h2><a name="references"></a>A. References</h2>

      <dl>
	<dt class="label"><a name="XML"></a>[XML 1.0] </dt><dd>W3C
	  Recommendation "Extensible Markup Language (XML) 1.0 (Second
	  Edition)", Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, 6
	  October 2000.  (See <a href="http://www.w3.org/TR/2000/REC-xml-20001006">http://www.w3.org/TR/2000/REC-xml-20001006</a>.)</dd>

	<dt class="label"><a name="XMLNS"></a>[Namespaces in XML] </dt><dd>W3C Recommendation "Namespaces in XML", Tim Bray, Dave
	  Hollander, Andrew Layman, 14 January 1999.  (See <a href="http://www.w3.org/TR/1999/REC-xml-names-19990114/">http://www.w3.org/TR/1999/REC-xml-names-19990114/</a>.)</dd>

	<dt class="label"><a name="XMLInfoSet"></a>[XML InfoSet] </dt><dd>W3C
	  Recommendation "XML Information Set", John Cowan, Richard Tobin, 24
	  October 2001.  (See <a href="http://www.w3.org/TR/2001/REC-xml-infoset-20011024/">http://www.w3.org/TR/2001/REC-xml-infoset-20011024/</a>.)</dd>

	<dt class="label"><a name="XMLSchemaP1"></a>[XML Schema Part 1] </dt><dd>W3C
	  Recommendation "XML Schema Part 1: Structures", Henry S. Thompson,
	  David Beech, Murray Maloney, Noah Mendelsohn, 2 May 2001.  (See <a href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/</a>.)</dd>

	<dt class="label"><a name="XMLSchemaP2"></a>[XML Schema Part 2] </dt><dd>W3C
	  Recommendation "XML Schema Part 2: Datatypes", Paul V. Biron, Ashok
	  Malhotra, 2 May 2001.  (See <a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/</a>.)</dd>

	<dt class="label"><a name="SchemaPart2Errata"></a>[XML Schema Part 2 Errata] </dt><dd>W3C
	  Internal Working Draft 7 March 2003 Id: datatypes-with-errata.xml,v
	  1.5 2003/03/07 19:54:00  (See <a href="http://www.w3.org/XML/Group/2002/09/xmlschema-2/datatypes-with-errata.html">http://www.w3.org/XML/Group/2002/09/xmlschema-2/datatypes-with-errata.html</a>.)</dd>

	<dt class="label"><a name="RFC2119"></a>[RFC 2119] </dt><dd>IETF "RFC
	  2119: Keywords for use in RFCs to Indicate Requirement Levels", S.
	  Bradner, March 1997.  (See <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>.)</dd>

	<dt class="label"><a name="RFC2387"></a>[RFC 2387] </dt><dd>IETF "The
	  MIME Multipart/Related Content-type", E. Levinson, August
	  1998.  (See <a href="http://www.ietf.org/rfc/rfc2387.txt">http://www.ietf.org/rfc/rfc2387.txt</a>.)</dd>
      </dl>
    </div>

    
    
    
    <div class="div1">
      
<h2><a name="changelog"></a>B. Change Log (Non-Normative)</h2>

      <a name=""></a><table border="1">
	<caption>Table 2: Changes since first draft.</caption>

	<thead>
	  <tr>
	    <th rowspan="1" colspan="1">Who</th>
	    <th rowspan="1" colspan="1">When</th>
	    <th rowspan="1" colspan="1">What</th>
	  </tr>
	</thead>

	<tbody>
	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040224</td>
	    <td rowspan="1" colspan="1">
	      Changed children property of xop:Include to be empty.
	    </td>
	  </tr>

	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040129</td>
	    <td rowspan="1" colspan="1">
	      Changed include.xsd location.
	    </td>
	  </tr>
	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040129</td>
	    <td rowspan="1" colspan="1">
	      Removed starting "Note" from second paragraph of <a href="#xop_data_models"><b>3. XOP Data Models Constructs</b></a>.
	    </td>
	  </tr>
	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040129</td>
	    <td rowspan="1" colspan="1">
	      Removed Ednote in 1.1.
	    </td>
	  </tr>

	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040127</td>
	    <td rowspan="1" colspan="1">
	      Added examples.
	    </td>
	  </tr>
	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040127</td>
	    <td rowspan="1" colspan="1">
	      Added request for comments on [email protected].
	    </td>
	  </tr>

	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040126</td>
	    <td rowspan="1" colspan="1">
	      Misc editorial changes.
	    </td>
	  </tr>
	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040126</td>
	    <td rowspan="1" colspan="1">
	      Corrected usage of Data Model terms.
	    </td>
	  </tr>

	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040123</td>
	    <td rowspan="1" colspan="1">
	      Implemented Noah's proposed changes.
	    </td>
	  </tr>

	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040122</td>
	    <td rowspan="1" colspan="1">
	      Changed MIME/Multipart to MIME Multipart/Related in accordance
	      with RFC2387.
	    </td>
	  </tr>

	  <tr>
	    <td rowspan="1" colspan="1">HR</td>
	    <td rowspan="1" colspan="1">20040121</td>
	    <td rowspan="1" colspan="1">
	      Converted from html to xml.
	    </td>
	  </tr>
	</tbody>
      </table>

    </div>

  </div>
</body></html>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.