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 응답 AJAX XML 파일 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 <각각> XSLT <정렬> XSLT <만약> XSLT <선택> XSLT 적용 클라이언트의 XSLT 서버의 XSLT XSLT XML 편집 XSLT 예

XQuery 튜토리얼

XQuery 소개 XQuery 예제 XQuery FLWOR 엑스쿼리 HTML XQuery 용어 XQuery 구문 XQuery 추가 XQuery 선택 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 <모든 속성> XSD 대체 XSD 예

XSD 데이터

XSD 문자열 XSD 날짜 XSD 숫자 XSD 기타 XSD 참조

서비스

XML 서비스 XML WSDL XML SOAP XML RDF XML RSS

참고문헌

DOM 노드 유형 DOM 노드 DOM 노드 목록 DOM NamedNodeMap DOM 문서 DOM 요소 DOM 속성 DOM 텍스트 DOM CDATA DOM 주석 DOM XMLHttpRequest DOM 파서 XSLT 요소 XSLT/XPath 함수

XML DOM 노드 유형


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