tailieunhanh - Java 2 Bible Enterprise Edition phần 4

Lớp này quy định cụ thể những gì được thực hiện ở đầu và cuối của thẻ với các doStartTag () và doEndTag () phương pháp. Thứ hai, lập trình nhập cảnh, được gọi là một mô tả tập tin thư viện thẻ (TLD), trong một tập tin XML. Nhập bao gồm các tên sẽ được sử dụng để đề cập đến thẻ này, lớp học Java mà nó đề cập đến và các thông tin khác | Chapter 10 Building an XML Foundation Here is a line. I think I ll insert a break. br Here is a line separated from the previous one by a break. An element can contain text or one or more other elements or both. You can see this in the resume and JavaBeans examples. If you keep in mind the idea that elements are nodes on a tree and can be moved and manipulated then it will make sense to you that elements must be properly nested. For example the following is not allowed outer inner outer inner If you want to pick up the entire inner element and place it before the outer element you would be taking the end tag for outer with you. Instead you have to properly nest as follows outer inner inner outer In these last two snippets we ve omitted the indentation that we usually include for readability. There was no way to properly indent the first snippet and we didn t want to imply in the second one that the indentation was why the second one properly parsed. Another of the rules is that XML is case-sensitive. Again many of us have gotten sloppy in HTML and written something like the following html Body . body HTML As Java developers this restriction shouldn t bother us. We often use different cases to indicate a class and an instance of the class. To declare an object of type Dog named dog we might write something like the following Dog dog new Dog The point isn t whether or not you like this naming convention but that you aren t in need of case-sensitivity training. As you choose an element name you should make sure that it starts with a letter or underscore and that it doesn t contain any spaces. Following your Java naming conventions you should choose names that are descriptive and that help you or other developers understand what you are describing. Namespaces You need namespaces in XML for the same reasons that you use packages in Java. You may have constructed your own version of a resume wherein your concept of an address is different from mine. To distinguish your .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.