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 Tree


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


XML Tree

XML의 트리 구조


XML documents form a tree structure that starts at "the root" and branches to "the leaves".
XML 문서는 “뿌리”(최상위 엘리먼트)에서 시작하여 트리 구조를 형성하면서,
“잎사귀”(최하위 엘리먼트)까지 뻗어나간다.


An Example XML Document

XML 문서의 예문


XML documents use a self-describing and simple syntax:

XML 문서의 문법은 단순하며,
문서 그 자체가 자기 자신의 설명문이 될 수 있다.
( 추가적인 덧붙임이나 주석없이, 엘리먼트만으로도 문서 내용을 설명해줄 수 있다. )



The first line is the XML declaration. It defines the XML version (1.0).
맨 첫번째 줄은 XML 문서라고 선언하고 있으며, “XML 버전 1.0”이라고 밝히고 있다.


The next line describes the root element of the document (like saying: "this document is a note"):

그 다음 줄에서는, 문서의 “루트 엘리먼트”(최상위 엘리먼트)에 대해서 언급하고 있다.
( “이 문서는 메모입니다”라고 말하려는 듯이 말이다. )


The next 4 lines describe 4 child elements of the root (to, from, heading, and article):
그 다음, 네 개의 줄에서는, “root”의 네 가지 자식 요소에 대해서 설명하고 있다.
( to, from, heading, and article )


And finally the last line defines the end of the root element:
그리고 끝으로, 맨 마지막 줄에서는, “루트 엘리먼트”가 종료됨을 알리고 있다.


You can assume, from this example, that the XML document contains a note to Tove from Jani.
따라서, 당신은 짐작할 수 있을 것이다. 이 예문이, “Tove”가 “Jani”에게 전하는 메모가 들어있는 XML 문서라는 것을.


Don't you agree that XML is pretty self-descriptive?
XML이 자기 자신을 너무나 잘 설명하고 있다는 생각이 들지 않는가?


XML Documents Form a Tree Structure

XML 문서는 트리(tree) 구조 형태로 이루어진다.


XML documents must contain a root element.
This element is "the parent" of all other elements.

XML 문서에는 하나의 루트 엘리먼트가 들어있어야 한다.
이 엘리먼트는 다른 모든 엘리먼트의 “부모” (parent)이다.


The elements in an XML document form a document tree.
The tree starts at the root and branches to the lowest level of the tree.

XML 문서의 엘리먼트들은 문서의 “트리”(tree) 를 형성한다.
트리는 “루트”(root)에서 시작해서, “트리”의 최하위 레벨 쪽으로 뻗어나간다.


All elements can have sub elements (child elements):
모든 엘리먼트는 하위 엘리먼트 (자식 요소)를 가질 수 있다.


The terms parent, child, and sibling are used to describe the relationships between elements.
Parent elements have children. Children on the same level are called siblings (brothers or sisters).


“부모”와 “자식”, 그리고 “형제”라는 용어는, 엘리먼트들 간의 관계를 설명하는 데에 사용된다.
부모 엘리먼트에게는 자식들이 있고, 같은 동급의 (같은 위치의) 자식들은 서로 형제( 혹은 자매)라고 부른다.


All elements can have text content and attributes (just like in HTML).
모든 엘리먼트에는 텍스트 내용을 담을 수 있고, 속성을 가질 수 있다. ( HTML에서 처럼).


Example


The figure above represents one book in the XML below:
위의 도표는, 아래의 XML에 나와있는 책 한 권을 표현한 것이다.



The root element in the example is <bookstore>.
All <book> elements in the document are contained within <bookstore>.


위의 예문에서, 루트 엘리먼트는 “서점” <bookstore>이다.
이 문서에서, 모든 <book> 엘리먼트는 <bookstore> 안에 들어가 있다.


<book> 엘리먼트는 네 개의 자식 엘리먼트를 가지고 있다. <title>, <author>, <year>, <price>.




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

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

[ XML ] 6. XML Namespaces  (0) 2015.06.22
[ XML ] 5. XML 엘리먼트의 속성  (0) 2015.06.22
[ XML ] 4. XML의 엘리먼트  (0) 2015.06.21
[ XML ] 3. XML 문서에서의 문법  (0) 2015.06.20
[ XML ] 1. XML 문서의 예문  (0) 2015.06.20