Cấu trúc XML well-form
Cơ sở ,kỹ thuật và Ứng dụng của XML
Bài 1: Cú pháp < Check well-form>
Một trang XML bắt buộc phải có root<gốc> giống như cặp thẻ <html></html> trong HTML.
Các thẻ có thẻ mở thì phải có thẻ đóng.
VD: <name></name>
VD: <name></name>
1.Ví dụ một trang "name.xml".
<?xml version="1.0" encoding="UTF-8"?>
<name>
<first_name></first_name>
<mid_name></mid_name>
<last_name></last_name>
</name>
nhấn F7 để check well-form.
Về mặt cú pháp nó khá giống so với HTML nên khá dễ để làm được.
2. Bài tập trên lớp.
December 11, 2002
Melvile Dewey
Columbia University
New York, NY
Dear Melvile,
I have been reading your ideas concerning the nature of librarianship, and I find them very intriguing. I would love the opportunity to discuss with you the role of the card catalog in today's libraries considering the advent to World Wide Web. Specifically, how are things like Google and Amazon.com changing our patrons' expectations of library services? Mr. Cutter and I will be discussing these ideas at the next Annual Meeting, and we are available at the follow dates/times:
* Monday, 2-4
* Tuesday, 3-5
* Thursday, 1-3
We hope you can join us.
Sincerely, S. R. Ranganathan
Viết cấu trúc của lá thư và check well-form.
Tạo 1 file: letter.xml
Tạo 1 file: letter.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE letter SYSTEM "letter.dtd">
<letter>
<To>
<date>December 11, 2002</date>
<name>
<firstname>Melvile </firstname>
<lastname>Dewey </lastname>
</name>
<address>
<school>Columbia University </school>
<State>New York, NY </State>
</address>
</To>
<Greeting>Dear Melvile, </Greeting>
<body>
<p>
I have been reading your ideas concerning the nature of librarianship, and
<i>I find them <b>very</b> intriguing.</i>
I would love the opportunity to discuss with you the role of the card catalog in today's libraries considering the advent to World Wide Web Specifically, how are things like <b>Google </b> and <b>Amazon.com </b>changing our patrons expectations of library services? Mr. Cutter and I will be discussing these ideas at the next Annual Meeting, and we are available at the follow dates/times: </p>
<list>
<item>* Monday, 2-4 </item>
<item>* Tuesday, 3-5 </item>
<item>* Thursday, 1-3 </item>
</list>
<p>
We hope you can join us.
</p>
<list>
<item>* Monday, 2-4 </item>
<item>* Tuesday, 3-5 </item>
<item>* Thursday, 1-3 </item>
</list>
</body>
<signature>Sincerely, S. R. Ranganathan </signature>
</letter>
<!DOCTYPE letter SYSTEM "letter.dtd">
<letter>
<To>
<date>December 11, 2002</date>
<name>
<firstname>Melvile </firstname>
<lastname>Dewey </lastname>
</name>
<address>
<school>Columbia University </school>
<State>New York, NY </State>
</address>
</To>
<Greeting>Dear Melvile, </Greeting>
<body>
<p>
I have been reading your ideas concerning the nature of librarianship, and
<i>I find them <b>very</b> intriguing.</i>
I would love the opportunity to discuss with you the role of the card catalog in today's libraries considering the advent to World Wide Web Specifically, how are things like <b>Google </b> and <b>Amazon.com </b>changing our patrons expectations of library services? Mr. Cutter and I will be discussing these ideas at the next Annual Meeting, and we are available at the follow dates/times: </p>
<list>
<item>* Monday, 2-4 </item>
<item>* Tuesday, 3-5 </item>
<item>* Thursday, 1-3 </item>
</list>
<p>
We hope you can join us.
</p>
<list>
<item>* Monday, 2-4 </item>
<item>* Tuesday, 3-5 </item>
<item>* Thursday, 1-3 </item>
</list>
</body>
<signature>Sincerely, S. R. Ranganathan </signature>
</letter>
Nhấn F7 để check well-form.
Chúc các bạn thành công!
Chúc các bạn thành công!
No Comment to " Cấu trúc XML well-form "