sdo.sample.sequence.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 287 行 · 第 1/2 页

HTML
287
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Working with Sequenced Data Objects</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sdo.sample.getset.html">Setting and Getting Property Values</a></div> <div class="next" style="text-align: right; float: right;"><a href="sdo.sample.reflection.html">Reflecting on Service Data Objects</a></div> <div class="up"><a href="sdo.examples.html">Examples</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="sdo.sample.sequence" class="section">  <h2 class="title">Working with Sequenced Data Objects</h2>  <p class="para">   Sequenced data objects are SDOs which can track property   ordering across the properties of a data object. They can also   contain unstructured text elements (text element which do not   belong to any of the SDO&#039;s properties).  Sequenced data objects are   useful for working with XML documents which allow unstructured text (i.e.   mixed=true) or if the elements can be interleaved (   <div class="cdata"><pre>&lt;A/&gt;&lt;B/&gt;&lt;A/&gt;</pre></div>).  This can occur for example when   the schema defines maxOccurs&gt;1 on a   element which is a complexType with a choice order indicator.  </p>  <p class="para">   The examples below assume an SDO created with the following schema   and instance information, using the XML Data Access Service.  </p>  <p class="para">   The schema below describes the format of a letter.  The letter can   optionally contain three properties; date, firstName, and lastName.   The schema states <strong class="command">mixed=&quot;true&quot;</strong> which means that   unstructured text can be interspersed between the three properties.  </p>  <p class="para">   <div class="example-contents"><div class="cdata"><pre>&lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;  xmlns:letter=&quot;http://letterSchema&quot;  targetNamespace=&quot;http://letterSchema&quot;&gt;  &lt;xsd:element name=&quot;letters&quot; type=&quot;letter:FormLetter&quot;/&gt;  &lt;xsd:complexType name=&quot;FormLetter&quot; mixed=&quot;true&quot;&gt;    &lt;xsd:sequence&gt;      &lt;xsd:element name=&quot;date&quot; minOccurs=&quot;0&quot; type=&quot;xsd:string&quot;/&gt;      &lt;xsd:element name=&quot;firstName&quot; minOccurs=&quot;0&quot; type=&quot;xsd:string&quot;/&gt;      &lt;xsd:element name=&quot;lastName&quot; minOccurs=&quot;0&quot; type=&quot;xsd:string&quot;/&gt;    &lt;/xsd:sequence&gt;  &lt;/xsd:complexType&gt;&lt;/xsd:schema&gt;</pre></div>   </div>  </p>  <p class="para">   The following is an instance letter document.  It contains the   three letter properties; date, firstName and lastName, and has   unstructured text elements for the address and letter body.  </p>  <p class="para">   <div class="example-contents"><div class="cdata"><pre>&lt;letter:letters xmlns:letter=&quot;http://letterSchema&quot;&gt;  &lt;date&gt;March 1, 2005&lt;/date&gt;  Mutual of Omaha  Wild Kingdom, USA  Dear  &lt;firstName&gt;Casy&lt;/firstName&gt;  &lt;lastName&gt;Crocodile&lt;/lastName&gt;  Please buy more shark repellent.  Your premium is past due.&lt;/letter:letters&gt;</pre></div>   </div>  </p>  <p class="para">   When loaded, the letter data object will have the sequence and   property indices shown in the table below:   <table class="informaltable">    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Sequence Index</th>       <th colspan="1">Property Index:Name</th>       <th colspan="1">Value</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">0</td>       <td colspan="1" rowspan="1" align="left">0:date</td>       <td colspan="1" rowspan="1" align="left">March 1, 2005</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">1</td>       <td colspan="1" rowspan="1" align="left">-</td>       <td colspan="1" rowspan="1" align="left">Mutual of Omaha</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">2</td>       <td colspan="1" rowspan="1" align="left">-</td>       <td colspan="1" rowspan="1" align="left">Wild Kingdom, USA</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">3</td>       <td colspan="1" rowspan="1" align="left">-</td>       <td colspan="1" rowspan="1" align="left">Dear</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">4</td>       <td colspan="1" rowspan="1" align="left">1:firstName</td>       <td colspan="1" rowspan="1" align="left">Casy</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">5</td>       <td colspan="1" rowspan="1" align="left">2:lastName</td>       <td colspan="1" rowspan="1" align="left">Crocodile</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">6</td>       <td colspan="1" rowspan="1" align="left">-</td>       <td colspan="1" rowspan="1" align="left">Please buy more shark repellent.</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">7</td>       <td colspan="1" rowspan="1" align="left">-</td>       <td colspan="1" rowspan="1" align="left">Your premium is past due.</td>      </tr>     </tbody>    </colgroup>   </table>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?