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문서는 스스로를 설명하고 간단한 구문을 사용한다:
<?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> |
The first line is the XML declaration. It defines the XML version (1.0) and the encoding used (ISO-8859-1 = Latin-1/West European character set).
첫번째 줄은 XML 선언이다. 이는 XML 버젼(1.0)과 사용된 인코딩(ISO-8859-1 = Latin-1/West European character set)을 정의한다.
The next line describes the root element of the document (like saying: "this document is a note"):
다음 줄은 ("이 문서는 노트(note)이다" 라고 말하는 것처럼) 문서의 루트 엘레먼트(요소)를 나타낸다.
<note> |
The next 4 lines describe 4 child elements of the root (to, from, heading, and body):
다음 네 줄은 루트의 4개의 자식 엘레먼트(to, from, heading, body)를 나타낸다.
<to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> |
And finally the last line defines the end of the root element:
그리고 마지막 줄은 루트 엘레먼트의 끝을 정의한다.
</note> |
You can assume, from this example, that the XML document contains a note to Tove from Jani.
당신은 예시로부터 XML문서는 Jani에서 Tove에게 보내는 노트를 포함한다고 가정할 수 있다.
Don't you agree that XML is pretty self-descriptive?
당신은 XML이 스스로를 잘 설명한다는 점을 동의하지 않는가?
XML Documents Form a Tree Structure
XML문서는 트리 구조를 형성한다.
XML documents must contain a root element. This element is "the parent" of all other elements.
XML 문서들은 루트 엘레먼트를 포함해야 한다. 이 엘레먼트는 모든 다른 엘레먼트들의 "부모"이다.
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문서에서 이 엘레먼트들은 문서 트리를 형성한다. 트리는 루트에서 시작하고 트리의 최고 낮은 레벨로 가지를 펴 나간다.
All elements can have sub elements (child elements):
모든 엘레먼트들은 자식 엘레먼트를 가질 수 있다.
<root> <child> <subchild>.....</subchild> </child> </root> |
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 image above represents one book in the XML below:
위의 그림은 밑의 XML 밑에 있는 한 book(책)을 표현하였다.
<bookstore> <book category="COOKING"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="WEB"> <title lang="en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book> </bookstore> |
The root element in the example is <bookstore>. All <book> elements in the document are
contained within <bookstore>.
이 예제의 루트 엘레먼트는 "bookstore(책가계)"이다. 이 문서에서 모든 book(책) 엘레먼트들은 bookstore(책가계) 안에 포함되어 있다.
The <book> element has 4 children: <title>,< author>, <year>, <price>.
book(책) 엘레먼트는 4개의 자식이 있다 : title(제목), author(저자), year(년도), price(가격).
'컴퓨터 공부 > 번역' 카테고리의 다른 글
6. XML 속성 (0) | 2009.05.13 |
---|---|
5. XML 엘레먼트 (0) | 2009.05.13 |
4. XML 구문 규칙 (0) | 2009.05.13 |
2. 어떻게 XML이 사용될 수 있을까? (0) | 2009.05.12 |
1. XML 소개 (0) | 2009.05.12 |