본문 바로가기
개념/XML

XML) Student Information XML Structure

by kiseno 2025. 1. 30.
728x90
반응형
SMALL
<?xml version="1.0" encoding="UTF-8"?>
<학생정보>
    <학생>
        <학번>2019001</학번>
        <이름>홍길동</이름>
        <성별>남성</성별>
        <나이>20</나이>
        <전공>컴퓨터 공학</전공>
    </학생>
    <학생>
        <학번>2019002</학번>
        <이름>이순신</이름>
        <성별>남성</성별>
        <나이>22</나이>
        <전공>역사학</전공>
    </학생>
    <학생>
        <학번>2019003</학번>
        <이름>김영희</이름>
        <성별>여성</성별>
        <나이>21</나이>
        <전공>문학</전공>
    </학생>
</학생정보>

#### Document Declaration:
- `<?xml version="1.0" encoding="UTF-8"?>`: The XML declaration specifies that this document uses version 1.0 of XML and is encoded in UTF-8, supporting international character sets.

#### Root Element:
- `<학생정보>`: This is the root element that encapsulates all data within the document, serving as a container for the student information records. Its tag translates to "student information."

#### Student Elements:
Each `<학생>` (student) element represents a single student's information, consisting of nested elements that detail their academic and personal information.

- `<학번>`: Student ID number (e.g., "2019001"). This unique identifier is used to distinguish each student.
- `<이름>`: Student's name (e.g., "홍길동"). It holds the full name of the student.
- `<성별>`: Gender of the student (e.g., "남성" for male, "여성" for female). This tag specifies the student's gender.
- `<나이>`: Age of the student (e.g., "20"). It provides the age in years.
- `<전공>`: Major or field of study (e.g., "컴퓨터 공학" for computer engineering). This element specifies the academic discipline the student is pursuing.

#### Example of a Student Record:
```xml
<학생>
    <학번>2019001</학번>
    <이름>홍길동</이름>
    <성별>남성</성별>
    <나이>20</나이>
    <전공>컴퓨터 공학</전공>
</학생>
```
This segment represents a student with ID 2019001, named 홍길동, who is a 20-year-old male majoring in computer engineering.

#### Summary:
The XML document is well-structured, making it easy to parse and extract information about each student. By following this structure, data can be systematically organized and accessed, facilitating processes like data retrieval, reporting, and integration with other systems or applications that require student information.

728x90
반응형
LIST