E D R , A S I H C RSS

Document Object Model

{{| |}}

1. DOM

DOM_Inspector.png

{{|
Document Object Model (DOM) is an application programming interface to access HTML and XML documents. It is programming language and platform independent. Behind the interface the document is represented with an object-oriented model.

Different variants of DOMs were initially implemented by web browsers to manipulate elements in an HTML document. This prompted the World Wide Web Consortium (W3C) to come up with a series of standard specifications for DOM (hence called W3CDOM).

DOM puts no restrictions on the document's underlying data structure. A well-structured document can take the tree form using DOM.

Most XML parsers (e.g., Xerces) and XSL processors (e.g., Xalan) have been developed to make use of the tree structure. Such an implementation requires that the entire content of a document be parsed and stored in memory. Hence, DOM is best used for applications where the document elements have to be randomly accessed and manipulated. For XML-based applications which involve a one-time selective read/write per parse, DOM presents a considerable overhead on memory. The SAX model is advantageous in such a case in terms of speed and memory consumption.
|}}

DOM� HTML, XML문서를 다루는 API�다. �것� 프로그래� 언어와 플랫�� 비종���다. �터페�스� 뒷쪽�서 � 문서는 �체지향 모�로 다루어진다.
초기�는 웹 브�우저가 HTML� 요소를 다루기위해서 �기 다른 형태� DOM� 만들었다. �러� 것� W3C가 DOM� 대한 표준(W3CDOM)를 지정하게�었다.
DOM� 그 문서� 하부� ��터 구조�는 어떠한 제약사항� �질 않는다. 잘 만들어진 문서는 DOM� �용해서 트리 구조를 취할 수 있다.
대부분� XML파서들 그리고 XSL 처리기들� 트리구조를 사용할 수 있�� 개발�었다. 그러한 구현물들� 메모리 안�서 문서� 전체 내용� 파싱�고 저장�는 것� 필요했다. 따�서 DOM� 임�로 접근하고 다루어 질 수 있는 document 요소를 가지는 �용프로그래�서 사용하기좋다. XML기반� �용프로그램들� 한번 파싱� 할때 �거나, 쓸수 밖� 없기 때문� DOM� 메모리 ��서 �당한 오버헤드� 요소를 가지고 있다. SAX 모�� ��, 메모리� 비효율성 면� 있어서 ��� 가진 모��다.

2. 바깥고리

3. Thread

요즘 XML� 대해서 보고 있는�... 하� DOM, DOM하길래.. ㅡ.ㅡ 먼가했�니 ��보다 엄청난 개�� 아니네요. - eternalbleu

XML � 대해서 파싱하는 API 방� �야기. DOM 모��� SAX 모��� 하는것. �터페�스 �으로는 DOM � 쉽긴 함. SAX 는 좀 � low-level 하다고 할까. (SAX 파서를 �용해서 DOM 모�� 만들어내는 경우가 많�) SAX 는 Tokenizer 가 해당 XML 문서를 분�하는 중� �벤트� 대한 �벤트 핸들� 코드를 작성하는 것�므로. 그대신 모든 ��먼트 노드 ��터가 필요한건 아니니, SAX API 로 XML� 파싱하면서 �접 개발�가 쓸 DOM �체를 구성하거나, 아니면 XPath 를 �용하는게 좋겠지.

DOM API 쓰는 코드와 SAX API 쓰는 코드는 XML�서 한글 처리하기 페�지중 소스코드를 참조. XPath 는 PyKug:HowToUseXPath를 참조. --1002
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:09
Processing time 0.0097 sec