Create an XML document containing the employee details of an organization. Then create an application, which uses the DOM parser to parse the XML document into a DOM tree and traverses through it. The application should implement the TreeWalker interface to traverse all the nodes present in the DOM tree and print the value of the nodes.
 |
Tạo Java Application với file xml như sau |
 |
Code main class |
 |
Kết quả |
Demo tại
đây
Nhận xét :
-Thể hiện tốt cấu trúc tài liệu thông qua các node.
-TreeWalker duy trì các mối quan hệ thứ bậc của nhánh con, cho phép chuyển hướng của hệ thống phân cấp này.
Không có nhận xét nào:
Đăng nhận xét