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 - 문서 객체


Document 객체는 전체 XML 문서를 나타냅니다.


XML 문서 객체

Document 개체는 XML 문서 트리의 루트이며 문서 데이터에 대한 기본 액세스를 제공합니다.

요소 노드, 텍스트 노드, 주석, 처리 지침 등은 문서 외부에 존재할 수 없으므로 Document 개체에는 이러한 개체를 생성하는 메서드도 포함됩니다. 노드 개체에는 해당 개체가 생성된 문서와 연결하는 ownerDocument 속성이 있습니다.

문서 개체 속성

Property Description
childNodes Returns a NodeList of child nodes for the document
doctype Returns the Document Type Declaration associated with the document
documentElement Returns the root node of the document
documentURI Sets or returns the location of the document
domConfig Returns the configuration used when normalizeDocument() is invoked
firstChild Returns the first child node of the document
implementation Returns the DOMImplementation object that handles this document
inputEncoding Returns the encoding used for the document (when parsing)
lastChild Returns the last child node of the document
nodeName Returns the name of a node (depending on its type)
nodeType Returns the node type of a node
nodeValue Sets or returns the value of a node (depending on its type)
xmlEncoding Returns the XML encoding of the document
xmlStandalone Sets or returns whether the document is standalone
xmlVersion Sets or returns the XML version of the document

문서 개체 메서드

Method Description
adoptNode(sourcenode) Adopts a node from another document to this document, and returns the adopted node
createAttribute(name) Creates an attribute node with the specified name, and returns the new Attr object
createAttributeNS(uri,name) Creates an attribute node with the specified name and namespace, and returns the new Attr object
createCDATASection() Creates a CDATA section node
createComment() Creates a comment node
createDocumentFragment() Creates an empty DocumentFragment object, and returns it
createElement() Creates an element node
createElementNS() Creates an element node with a specified namespace
createEntityReference(name) Creates an EntityReference object, and returns it
createProcessingInstruction(target,data) Creates a ProcessingInstruction object, and returns it
createTextNode() Creates a text node
getElementById(id) Returns the element that has an ID attribute with the given value. If no such element exists, it returns null
getElementsByTagName() Returns a NodeList of all elements with a specified name
getElementsByTagNameNS() Returns a NodeList of all elements with a specified name and namespace
importNode(nodetoimport,deep) Imports a node from another document to this document. This method creates a new copy of the source node. If the deep parameter is set to true, it imports all children of the specified node. If set to false, it imports only the node itself. This method returns the imported node
normalizeDocument()  
renameNode() Renames an element or attribute node


DocumentType 개체 속성

각 문서에는 값이 null 또는 DocumentType 개체인 DOCTYPE 속성이 있습니다.

DocumentType 개체는 XML 문서에 대해 정의된 엔터티에 대한 인터페이스를 제공합니다.

Property Description
name Returns the name of the DTD
publicId Returns the public identifier of the DTD
systemId Returns the system identifier of the external DTD

DocumentImplementation 객체 메소드

DOMImplementation 객체는 문서 객체 모델의 특정 인스턴스와 독립적인 작업을 수행합니다.

Method Description
createDocument(nsURI, name, doctype) Creates a new DOM Document object of the specified doctype
createDocumentType(name, pubId, systemId) Creates an empty DocumentType node
getFeature(feature, version) Returns an object which implements the APIs of the specified feature and version, if the is any
hasFeature(feature, version) Checks whether the DOM implementation implements a specific feature and version

ProcessingInstruction 개체 속성

ProcessingInstruction 개체는 처리 명령을 나타냅니다.

처리 명령은 XML 문서의 텍스트에 프로세서별 정보를 유지하는 방법으로 사용됩니다.

Property Description
data Sets or returns the content of this processing instruction
target Returns the target of this processing instruction