<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/xml.xsl" type="text/xsl"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>nulog, NULL::something : out of the headphone &gt; 2005 &gt; January &gt; 21 &gt; 名前空間が null?</title>
  <link href="http://lowreal.net/logs/2005/01/21/3"/>
  <icon>http://lowreal.net/img/banner.png</icon>
  <link rel="self" type="application/atom+xml" href="http://lowreal.net/logs/2005/01/21/3.atom"/>
  <link rel="alternate" type="application/xhtml+xml" href="http://lowreal.net/logs/2005/01/21/3.xhtml"/>
  <updated>2005-01-21T21:23:00+09:00</updated>
  <author>
    <name>cho45(砂糖)</name>
  </author>
  <id>http://lowreal.net/2005/01/21/3</id>
  <entry>
    <title>名前空間が null?</title>
    <link rel="alternate" type="text/html" href="http://lowreal.net/logs/2005/01/21/3.html"/>
    <link rel="alternate" type="application/xml+xhtml" href="http://lowreal.net/logs/2005/01/21/3.xhtml"/>
    <updated>2005-01-21T21:23:00+09:00</updated>
    <published>2005-01-21T21:23:00+09:00</published>
    <id>http://lowreal.net/2005/01/21/3</id>
    <category term="xml"/>
    <category term="dom"/>
    <category term="xslt"/>
    <content type="xhtml" xml:base="http://lowreal.net/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p><abbr title="Internet Relay Chat">IRC</abbr> ネタ。</p>
        <p><cite><a href="http://ishikawa.arielworks.com/memo/2005/01#d21">2005年1月の指向性メモ</a></cite> に <q>createElement()で作られたエレメントノードは名前空間がnullになるはずなのに、親要素のデフォルト名前空間を引き継いでしまっている。</q> って書いてあるけど、何か違う気がする。</p>
        <p>確かに <abbr title="Document Object Model">DOM</abbr> Core の createElement の項には <q cite="http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#i-Document"><code>localName</code>, <code>prefix</code>, and <code>namespaceURI</code> set to <code>null</code>.</q> とは書いてある (これを根拠にしているかは定かじゃない) けれど、これは名前空間っていう概念がないから、名前空間関連のプロパティにはとりあえず <code>null</code> という値を入れておけよってことで、名前空間<abbr title="Uniform Resource Identifer | Universal Resource Identifer">URI</abbr> を空値に設定するっていう意味じゃない気がする。code でマークアップされてるしね？</p>
        <p>そもそも自分も書いたことあるんだけれど、<q>名前空間がnullになる</q>っていうのが何かおかしいかもしれないとも思う。<a href="http://www.w3.org/TR/REC-xml/">Extensible Markup Language (XML) 1.0</a> にも <a href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</a> にも null という単語が出てこない。名前空間が null っていう表現が出てくるのは <abbr title="XML Path language">XPath</abbr> の仕様の日本語訳で、原文の null には code 要素がついていないので、ただたんに“空”といいたいだけなんじゃないかとか。でもそうだったら empty って書くかなぁ……仕様書だし紛らわしいふうには書かないから、あるいは俺の読解力が糞なおかげで違うかもしれない……</p>
        <p>まー結局のところ createElement に名前空間の概念がそもそもないので単純に引数の nodeName を引数の名前にするよってことで、それ以上は実装依存なんじゃまいか。みたいな？　併用することは稀なので。。。</p>
        <p>しかし自分の解釈があっているかどうかは永遠に謎だ。確かめようがないから困る。誰に聞けばいいのか。その人が言っていることが正しいのか、正しいとしても自分がそれを正しいまま受け取れているかは確かめようがない。あーアレだね。アレ。理解は誤解の総体 (だっけ？) ってヤツ。　わかりあえているように感じるにはできるだけ曖昧な表現をすればいい。アレとかソレとかを、明確にしない「ありえねー」とか。</p>
      </div>
    </content>
  </entry>
</feed>
