XML이란? - 기본개요
2011. 4. 4. 22:09ㆍ카테고리 없음
@ XML (eXtensible Markup Language)
- XML은 기존 HTML이 가지고 있는 태그(tag)의 한계와 SGML의 복잡성을 보완하기 위해 만들어진 것으로, 웹에서의 데이터(data)및 구조(structure)화된 문서들을 위한 보편적인 표준
- 이름에서 보여지듯 XML은 고정된(fixed) 태그를 가지고 있던 HTML과 달리 문서의 내용에 관련된 태그를 사용자가 정의(definition)하여 확장할 수 있도록 하여 내용 정보의 중요성을 강조
- 또한 XSL을 사용하여 문서의 외양을 표현하기 때문에, 내부 구조와 표현의 분리를 통한 다양한 활용 가능성을 제공함으로써 인터넷에서 전달되어야 할 많은 정보들을 기술하는데 있어 사용자와 개발자 모두에게 편리함을 제공
* eXtensible? - SGML이나 HTML처럼 이미 정해진 태그에 대한 제약을 받지 않는다. 자신만의 애플리케이션(application)에 맞게끔 구성할 수 있다.
* SGML을 간단하게 한 버전(version)이다. 그리고 우리가 잘 알고 있는 HTML과 비교해 보면 더 쉽게 이해가 될 것이다. 만일 내가 hello라는 말을 웹페이지에 보이고 싶다면 다음 처럼 쓸것이다.
<h1><font=bold>Hello!!</font></h1>
그런데 XML이라면
<greeting>Hello!!</greeting>
이라고 쓸 수 있다.
HTML의 경우 화면에 글자를 보이게만 하는 목적으로 작성되었다. 그래서 컴퓨터의 경우 Hello! 라는 것은 단순히 문자의 배열로 인식되겠지만 XML에서는 Hello! 라는 말에 대한 정보를 태그로서 표시할 수 있다는 것이다.컴퓨터가 Data에 대한 정보를 알게 되면 우리는 Data처리를 훨씬 간편하게 할수 있다.
@ XML의 특징
- 단순성 : XML은 다른 코드셋이 아닌 일반 text로 되어 있어 쉽게 판독이 가능하며, H/W or S/W에 의존하지 않으므로 simple해질 수 있는 특징을 가지고 있다.
- 표준성 : W3C가 주도하므로 스펙(Spec)의 표준화를 이룰 수 있다.
- 구조성 : data에 구조를 부여한다. XML은 데이터를 설명하는 의미가 담긴 태그를 제공할 뿐만 아니라 특정 구조를 저장하고 있다.
- 확장성 : 사용자 임의대로의 무한한 태그 확장이 이루어질 수 있으며, 상황에 따라 적절한 태그의 부여가 가능하다.
- 스타일시트 : 문서의 논리구조를 기술하기 위한 언어로 XSL과 같은 표준 스타일 시트언어가 존재한다.
- Character Set : UTF-8 or UTF16 코드가 가능한데, 모든 XML프로세서는 16bit Unicode를 지원 하도록 하므로 한글과 같은 2byte 문자권의 데이터도 처리가 가능하다.
@ XML, SGML, HTML, XHTML 관계 (Eng .ver)
HTML
- A markup language supporting hypertext links being used on the web
- A fixed language with a fixed syntax
- The HTML specification is maintained by W3C (The World Wide Web Consortium)
- The latest version is HTML 4.01
- Web browsers can read and display HTML documents
- An application of SGML (Standard Generalized Markup Language)
SGML
- A set of rules for creating markup languages
- Document structure is marked up using tags
(<example>, </example>) - A markup language—an application of SGML—is formally described in a DTD (Document Type Definition)
- Document structure is marked up using tags
- Developed by Charles F. Goldfarb and colleagues at IBM in the 1970s
- Accepted as an ISO-standard for document exchange in 1986 (ISO 8879)
SGML: Advantages
- Separating structure and content from presentation
- Digital preservation
- Plain text with only character data—not proprietary binary formats
- Human readable
- Quite easy to write software applications that can read and process the documents (in theory...)
SGML: Usage
- Technical documentation
- The graphic industry
- Too complex to be widely used
- Few SGML editors could compete with word processing software like Microsoft Word
From SGML to XML
- The first SGML success story: HTML!
- HTML: Fixed, with limited semantics
- SGML: General, but too complex
- The solution: XML!
XML
- Extensible Markup Language
- XML 1.0 became a W3C Recommendation in 1998
- A set of rules for designing text formats to structure data
- A "lightweight" version of SGML
- The parts of SGML which are hard to implement, have been removed
- Smaller parsers/processors that can fit into web browsers
- Easier to use for document creators
XML applications
- XHTML (The Extensible HyperText Markup Language)
- A reformulation of HTML in XML 1.0
- Example: View source of this document