XMLチュートリアル

XMLホーム XMLの紹介 XML使用方法 XMLツリー XML構文 XML要素 XML属性 XML名前空間 XML表示 XML HttpRequest XMLパーサー XML DOM XML XPath XML XSLT XML XQuery XML XLink XMLバリデーター XML DTD XMLスキーマ XMLサーバー XMLの例 XMLクイズ XML証明書

XML AJAX

AJAXの紹介 AJAX XMLHttp AJAXリクエスト AJAX応答 AJAXXMLファイル AJAX PHP AJAX ASP AJAXデータベース AJAXアプリケーション AJAXの例

XML DOM

DOMの紹介 DOMノード DOMアクセス DOMノード情報 DOMノードリスト DOMトラバース DOMナビゲーション DOMは値を取得します DOM変更ノード DOM削除ノード DOM置換ノード DOM作成ノード DOM追加ノード DOMクローンノード DOMの例

XPathチュートリアル

XPathの概要 XPathノード XPath構文 XPath軸 XPath演算子 XPathの例

XSLTチュートリアル

XSLTの紹介 XSL言語 XSLT変換 XSLT <テンプレート> XSLT <値> XSLT <for-each> XSLT <ソート> XSLT <if> XSLT <選択> XSLT適用 クライアント上のXSLT サーバー上のXSLT XSLT Edit XML XSLTの例

XQueryチュートリアル

XQueryの紹介 XQueryの例 XQuery FLWOR XQuery HTML XQueryの用語 XQuery構文 XQuery追加 XQuery Select XQuery関数

XML DTD

DTDの紹介 DTDビルディングブロック DTD要素 DTD属性 DTD要素と属性 DTDエンティティ DTDの例

XSDスキーマ

XSDの概要 XSDハウツー XSD <スキーマ> XSD要素 XSD属性 XSDの制限

XSDコンプレックス

XSD要素 XSDが空です XSD要素のみ XSDテキストのみ XSD混合 XSDインジケーター XSD <任意> XSD <anyAttribute> XSD置換 XSDの例

XSDデータ

XSD文字列 XSD日付 XSD数値 XSDその他 XSDリファレンス

Webサービス

XMLサービス XML WSDL XML SOAP XML RDF XML RSS

参考文献

DOMノードタイプ DOMノード DOM NodeList DOM NamedNodeMap DOMドキュメント DOM要素 DOM属性 DOMテキスト DOM CDATA DOMコメント DOM XMLHttpRequest DOMパーサー XSLT要素 XSLT / XPath関数

XMLDOMノードタイプ


DOMは、ドキュメントをノードオブジェクトの階層として表示します。


自分で試してみてください-例

以下の例では、XMLファイルbooks.xmlを使用しています。

××

ヘッダ


ノードタイプ

次の表に、さまざまなW3Cノードタイプと、それらが子として持つ可能性のあるノードタイプを示します。

Node Type Description Children
Document Represents the entire document (the root-node of the DOM tree) Element (max. one), ProcessingInstruction, Comment, DocumentType
DocumentFragment Represents a "lightweight" Document object, which can hold a portion of a document Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
DocumentType Provides an interface to the entities defined for the document None
ProcessingInstruction Represents a processing instruction None
EntityReference Represents an entity reference Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
Element Represents an element Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReference
Attr Represents an attribute Text, EntityReference
Text Represents textual content in an element or attribute None
CDATASection Represents a CDATA section in a document (text that will NOT be parsed by a parser) None
Comment Represents a comment None
Entity Represents an entity Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
Notation Represents a notation declared in the DTD None


ノードタイプ-戻り値

次の表に、各ノードタイプに対してnodeNameプロパティとnodeValueプロパティが返すものを示します。

Node Type nodeName returns nodeValue returns
Document #document null
DocumentFragment #document fragment null
DocumentType doctype name null
EntityReference entity reference name null
Element element name null
Attr attribute name attribute value
ProcessingInstruction target content of node
Comment #comment comment text
Text #text content of node
CDATASection #cdata-section content of node
Entity entity name null
Notation notation name null

NodeTypes-名前付き定数

NodeType Named Constant
1 ELEMENT_NODE
2 ATTRIBUTE_NODE
3 TEXT_NODE
4 CDATA_SECTION_NODE
5 ENTITY_REFERENCE_NODE
6 ENTITY_NODE
7 PROCESSING_INSTRUCTION_NODE
8 COMMENT_NODE
9 DOCUMENT_NODE
10 DOCUMENT_TYPE_NODE
11 DOCUMENT_FRAGMENT_NODE
12 NOTATION_NODE