B1:Tạo 1 java application,có các thành phần như sau
B2:Tạo file student.xml
B3:Code cho hàm main
Kết quả: ta có 4 thẻ member
Source code:
Module 4:Create an XML document parser application.The application should use a DOM parser to parse an XML document containing the names of employees of an organization, ABC Apparels Ltd, and then print the names of all the employees.
B1:Tạo 1 java application,có các thành phần như sau
B2:Tạo file Employees.xml
B3:Code cho hàm main
Kết quả:ta thu được danh sách các employee
Nhận xét: Việc xử dụng DOM giúp cho việc truy xuất tới các thẻ đơn giản hơn SAX rất nhiều,việc code cũng đơn giản hơn
-Về cách làm việc với DOM tương tự như với SAX
Không có nhận xét nào:
Đăng nhận xét