[1] [CODE[[[DOMString]] [VAR(DOMi)[[[Node]]]].[CODE(DOMa)[nodeValue]]]]
属性は、[[節]]の値です。

** 結果

[2]
,設定例外	,[CODE[[CODE(DOM)[[[DOMException]]]].[CODE(DOM)[[[NO_MODIFICATION_ALLOWED_ERR]]]]]]	,読取専用の節を編集しようとしました
,取得例外	,[CODE[[CODE(DOM)[DOMException]].[CODE(DOM)[[[DOMSTRING_SIZE_ERR]]]]]]	,実装の [CODE(DOM)[[[DOMString]]]] の制限を越える長さの値を取得しようとしました

[3] 正常時に得られる節の値 :
,節の型	,値
,[CODE(DOM)[[[Attr]]]]	,[[属性値]]
,[CODE(DOM)[[[CDATASection]]]]	,[[CDATA区間]]の内容
,[CODE(DOM)[[[Comment]]]]	,[[注釈]]の内容
,[CODE(DOM)[[[Document]]]]	,[CODE(DOM)[[[null]]]]
,[CODE(DOM)[[[DocumentFragment]]]]	,[CODE(DOM)[null]]
,[CODE(DOM)[[[DocumentType]]]]	,[CODE(DOM)[null]]
,[CODE(DOM)[[[Element]]]]	,[CODE(DOM)[null]]
,[CODE(DOM)[[[Entity]]]]	,[CODE(DOM)[null]]
,[CODE(DOM)[[[EntityReference]]]]	,[CODE(DOM)[null]]
,[CODE(DOM)[[[Notation]]]]	,[CODE(DOM)[null]]
,[CODE(DOM)[[[ProcessingInstruction]]]]	,[[対象名]]を除く内容全体
,[CODE(DOM)[[[Text]]]]	,[[文節]]の内容

[4] 値が [CODE(DOM)[null]] の種類の節に値を設定しようとした場合も
[CODE(DOM)[NO_MODIFICATION_ALLOWED_ERR]] でいいのでしょうか?

- [6] >>4 [DOM1SE], [DOM2] によれば、値が [CODE(DOM)[null]] の型では設定することは no effect です。つまり、例外にはなりませんが意味もありません。次に取得しようとした時には甲斐なく [CODE(DOM)[null]] に戻っているのが正しい実装かと。

** 仕様書

- [6] [DOM1] ''Document Object Model (Core) Level 1'' <http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#attribute-nodeValue>
- [5] [DOM1SE] ''Document Object Model Core'' <http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core.html#ID-F68D080>
- [7] [DOM2] ''Document Object Model Core'' <http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68D080>
[[#comment]]


* メモ

[9]
[[WinIE]] では [CODE(DOMi)[[[Text]]]] 節点の [CODE(DOMa)[[[nodeValue]]]]
を空文字列に設定するとその節点自体が削除されてしまうらしい。

[REFS[
- [11] [CITE[IE6 の DOM]] <http://www.parkcity.ne.jp/~chaichan/qanda/qa6043.htm>
]REFS]

[10] [CITE[Define what happens when setting nodeValue to null. · ec43aa7 · whatwg/dom]]
( ([TIME[2014-04-11 23:40:33 +09:00]] 版))
<https://github.com/whatwg/dom/commit/ec43aa7941e66f2b7e9379b21294fdad822b12c0>

[8] [CITE@en[Add Attr.prototype.nodeValue per https://www.w3.org/Bugs/Public/show_bug... · 2b76ab8 · whatwg/dom]] ([TIME[2014-11-22 17:18:42 +09:00]] 版) <https://github.com/whatwg/dom/commit/2b76ab8f2426d545550d81053a962aac2f6d9e49>

[12] [CITE@en[Add ''''''[''''''TreatNullAs=EmptyString'''''']'''''' to Attr.nodeValue/textContent · whatwg/dom@df9901c]]
([TIME[2015-09-08 21:51:27 +09:00]] 版)
<https://github.com/whatwg/dom/commit/df9901c05ea6a966925cc2ec110c9e8779ca4526>

[13] [CITE@en[Add ''''''[''''''CEReactions'''''']'''''' annotations to mutating methods · whatwg/dom@3cd02d1]]
([TIME[2016-04-26 19:06:46 +09:00]] 版)
<https://github.com/whatwg/dom/commit/3cd02d139c159a31fbb400e03932652c72fc7812>

[14] [CITE@en[Make Attr inherit from Node again]]
([[annevk]]著, [TIME[2016-08-19 21:44:07 +09:00]])
<https://github.com/whatwg/dom/commit/625a0747f137454c155a7b577a9e45be1aa35a34>