<html xmlns="http://www.w3.org/1999/xhtml" a0:Name="SuikaWiki" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:Version="0.9"><head></head><body><section><h1>ev:listener 要素 observer 属性, ev:observer 大域属性(XML Events)</h1><p><a0:anchor-end a0:anchor="1">[1]</a0:anchor-end> <a0:anchor>XML事象</a0:anchor>の (<code class="XMLe"><a0:anchor>listener</a0:anchor></code>
要素の) <dfn><code class="XMLa">observer</code></dfn>
属性は、 <code class="XML"><a0:anchor>IDREF</a0:anchor></code> 型であり、
<a0:anchor>事象聴者</a0:anchor>が登録される要素
(<dfn>観察器</dfn>) の<a0:anchor>識別子</a0:anchor>を指定します。
<a0:anchor-external a0:resParameter="http://www.w3.org/TR/xml-events#attr-listener-observer" a0:resScheme="URI">http://www.w3.org/TR/xml-events#attr-listener-observer</a0:anchor-external></p><p><a0:anchor-end a0:anchor="2">[2]</a0:anchor-end> この属性が指定されていないときには、
観察器要素はその要素 (他の XML 事象属性が指定されている要素) 
自体となります。
<a0:anchor-external a0:resParameter="http://www.w3.org/TR/xml-events#section-listener-observer" a0:resScheme="URI">http://www.w3.org/TR/xml-events#section-listener-observer</a0:anchor-external></p><p>但し、この属性だけでなく <code class="XMLa"><a0:anchor>handler</a0:anchor></code>
属性も指定されていない時には、その要素は<a0:anchor>取扱器</a0:anchor>となり、
観察器はその<a0:anchor>親要素</a0:anchor>になります。
<a0:anchor-external a0:resParameter="http://www.w3.org/TR/xml-events#section-listener-handler" a0:resScheme="URI">http://www.w3.org/TR/xml-events#section-listener-handler</a0:anchor-external></p><p>例:</p><pre class="XML"><a0:anchor-external a0:resParameter="ev:listener ev:event=&quot;foo&quot; handler=&quot;#h&quot; observer=&quot;o&quot; /" a0:resScheme="URI">ev:listener ev:event=&quot;foo&quot; handler=&quot;#h&quot; observer=&quot;o&quot; /</a0:anchor-external>
&lt;handler id=&quot;h&quot;&gt;
  煮て焼く。
&lt;/handler&gt;
&lt;observer id=&quot;o&quot;&gt;
  ...
&lt;/observer&gt;</pre><p>見てわかる通りの意味です。</p><pre class="XML">&lt;handler id=&quot;h&quot;&gt;
  煮て焼く。
&lt;/handler&gt;
&lt;observer id=&quot;o&quot; ev:event=&quot;foo&quot; ev:handler=&quot;h&quot;&gt;
  ...
&lt;/observer&gt;</pre><p><samp class="XMLe">observer</samp> 要素を見た時、
<code class="XMLa">handler</code> 属性はあって <code class="XMLa">observer</code>
属性はないので、観察器は自分自身となります。</p><pre class="XML">&lt;observer id=&quot;o&quot;&gt;
  &lt;content&gt;...&lt;/content&gt;
  &lt;handler id=&quot;h&quot; ev:event=&quot;foo&quot;&gt;
    煮て焼く。
  &lt;/handler&gt;
&lt;/observer&gt;</pre><p><samp class="XMLe">handler</samp> 要素を見た時、
<code class="XMLa">handler</code> 属性も <code class="XMLa">observer</code>
属性もないので、観察器は親要素、取扱器は自分自身となります。</p><a0:form ref="comment"></a0:form></section><section><h1>メモ</h1></section></body></html>