Thứ Sáu, 8 tháng 8, 2014

Use validator to validate xml against a shema

Module 10.1: Create a program that accepts two command line parameters. The first parameter must specify the name of an XML document and the second parameter must specify the name of a schema. The program should validate the XML document against the specified schema by creating a DOM source on the
document.

B1: Tạo 1 java application




B2:Tạo file tomcat-users.xml




B3:Tạo file tomcat-users.xsd để validate thông tin




B4:Triển khai code cho hàm main



Kết quả:






Module 10.2 :Create a program that accepts two command line parameters. The first parameter must specify the name of an XML document and the second  parameter must specify the name of Schema. The program must also validate the XML document against the specified schema by creating a SAX source on the document.


B1: Tạo 1 java application


B2:Tạo file tomcat-users.xml



B3:Tạo file tomcat-users.xsd để validate thông tin



B4:Triển khai code cho hàm main



Kết quả:




Nhận xét:
Validate là một bước quan trọng trong việc xây dựng các ứng dụng
Validator giúp cho chúng ta kiểm soát lỗi của file xml


Không có nhận xét nào:

Đăng nhận xét