Recent posts

Recent comments

Archive

Calender

«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

출처 : w3schools - XML DTD


위 사이트의 내용을, 내맘대로 해석함. ─.─;;


An XML document with correct syntax is called "Well Formed".
문법적으로, 구문이 제대로 되어있는 XML 문서는 “Well Formed”라고 말한다.


An XML document validated against a DTD is "Well Formed" and "Valid".
DTD와 대조해서 검증이 된 (유효한) XML 문서는 “Well Formed”이면서 “Valid”한 것이다.



Valid XML Documents

XML 문서의 유효성


A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a DTD:
유효한 XML 문서는 “Well Formed” 이면서 또한 DTD의 규칙도 지키고 있는 것이다.



The DOCTYPE declaration, in the example above, is a reference to an external DTD file.
The content of the file is shown in the paragraph below.

위의 예문에서 DOCTYPE의 선언은, 외부 DTD 파일에 적혀있다.
그 파일의 내용은 아래 문단에 나와 있다.


XML DTD

The purpose of a DTD is to define the structure of an XML document.
It defines the structure with a list of legal elements:

DTD는 XML 문서의 구조(배치 형태)를 정하기 위한 것이다.
이는 허용되는 엘리먼트들의 구조를 정한다.



The DTD above is interpreted like this:
위의 DTD는 다음과 같이 해석된다.


  • !DOCTYPE note defines that the root element of the document is note
    “!DOCTYPE note”에서, 문서의 최상위 엘리먼트를 “note”로 정하고 있다.

  • !ELEMENT note defines that the note element must contain four elements: "to, from, heading, article"
    “!ELEMENT note”에서, note 엘리먼트는 반드시 네 개의 엘리먼트, “to, from, heading, article”를 포함하고 있어야 함을 정하고 있다.

  • !ELEMENT to defines the to element to be of type "#PCDATA"
    “!ELEMENT to”에서, to 엘리먼트는 “#PCDATA” 타입이라고 정하고 있다.

  • !ELEMENT from defines the from element to be of type "#PCDATA"
    “!ELEMENT from”에서, from 엘리먼트는 “#PCDATA” 타입이라고 정하고 있다.

  • !ELEMENT heading defines the heading element to be of type "#PCDATA"
    “!ELEMENT heading”에서, heading 엘리먼트는 “#PCDATA” 타입이라고 정하고 있다.

  • !ELEMENT article defines the article element to be of type "#PCDATA"
    “!ELEMENT article”에서, article 엘리먼트는 “#PCDATA” 타입이라고 정하고 있다.

!#PCDATA means parse-able text data.
“#PCDATA”는 “분석 가능한 텍스트 데이터”라는 뜻이다.


Using DTD for Entity Declaration

객체 선언용 DTD 사용법


A doctype declaration can also be used to define special characters and character strings, used in the document:

doctype 선언은 또한, 문서에서 사용될 특정 문자나 문자열을 정의내릴 때에도 이용된다.



!An entity has three parts: an ampersand (&), an entity name, and a semicolon (;).

객체는 세 부분으로 구분된다. 앤드 기호(&), 객체의 이름, 세미콜론(;)
& + nbsp(객체 이름) + ;


Why Use a DTD?

DTD를 사용하는 이유


With a DTD, independent groups of people can agree on a standard for interchanging data.

DTD를 이용하면, 서로 다른 그룹의 사람들 간에 정보를 교환할 때, 그 표준 형식에 대해서 합의를 볼 수 있다.


With a DTD, you can verify that the data you receive from the outside world is valid.
DTD를 이용하면, 외부에서 받은 데이터가 검증이 된 것인지를 확인해볼 수 있다.


If you want to study DTD, please read our DTD Tutorial.
DTD에 대해서 더 알고 싶다면, “DTD Tutorial”을 읽어보기 바란다.




이 글이 도움이 되셨나요? *^^*

'XML > w3schools' 카테고리의 다른 글

[ XML ] 12. XML의 Schema  (0) 2015.07.02
[ XML ] 10. XML 유효성 검사기  (0) 2015.07.01
[ XML ] 9. XML 문서의 형식  (0) 2015.06.26
[ XML ] 8. XML 출력하기  (0) 2015.06.25
[ XML ] 7. XML의 인코딩(Encoding)  (0) 2015.06.24