XML by Example- P8

Tham khảo tài liệu 'xml by example- p8', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | The Right Level of Abstraction 335 Similarly you need to easily recognize high-level structures. In the following document it is easy to recognize that there is a name an address and a phone number. John Doe 34 Fountain Square Plaza Cincinnati OH 45202 US 513-555-8889 This structure results in the following markup entry name John Doe name address 34 Fountain Square Plaza Cincinnati OH 45202 US address tel 513-555-8889 tel entry The difficulty is finding the appropriate granularity. Is the previous example enough Unlikely. It is probably best to mark more. For example entry name John Doe name address street 34 Fountain Square Plaza street region OH region postal-code 45202 postal-code locality Cincinnati locality country US country address tel 513-555-8889 tel entry Is this enough or do you need to further break some of the elements such as name fname John fname lname Doe lname name 336 Chapter 10 Modeling for Flexibility The question is Where do you stop What is the correct granularity for an XML document Unfortunately there are no strict criteria. Your experience will guide you. It is however a good idea to mark up as much as is convenient. The end user s convenience is the best guideline to use when deciding where to stop breaking a document into smaller pieces. Indeed if the DTD is too detailed and requires the user to identify details it won t work. The document may be highly structured but upon closer analysis most of the markup will prove to be incorrect. This problem is often experienced by database administrators who have very good data schemas but very poor information in the database. For example if you were to ask users to break the street into further components such as street nr 34 nr name Fountain Square name type Plaza type street It probably wouldn t work. Realistically few people would know where to insert the markup. Is it type Plaza type or street nr 34 nr name Fountain name type Square Plaza type street The only way to know when to stop breaking

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
272    22    1    27-11-2024
Đã 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.