TAILIEUCHUNG - XML by Example- P6

Tham khảo tài liệu 'xml by example- p6', 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ả | Why Another API 235 After the opening tag the parser sees the content of the name element XML Training. It generates an event by passing the application the content as a parameter. The next event indicates the closing tag for the name element. The parser has completely parsed the name element. It has fired five events so far three events for the name element one event for the declaration and one for product opening tag. The parser now moves to the first price element. It generates two events for each price element one event for the opening tag and one event for the closing tag. Even though the closing tag is reduced to the character in the opening tag the parser generates an event for it. The parser passes the element s parameters to the application in the event for the opening tag. There are four price elements so the parser generates eight events as it parses them. Finally the parser meets product s closing tag and it generates its last event. As Figure illustrates taken together the events describe the document tree to the application. An opening tag event means going one level down in the tree whereas a closing tag element means going one level up in the tree. Figure How the parser builds the tree implicitly An event-based interface is the most natural interface for a parser. Indeed the parser simply has to report what it sees. Note that the parser passes enough information to build the document tree of the XML documents but unlike an object-based parser it does not explicitly build the tree. 236 Chapter 8 Alternative API SAX NOTE If needed the application can build a DOM tree from the events it receives from the parser. In fact several object-based parsers are built around an event-based parser. Internally they use an event-based parser and they create objects in response to the events the parser generates. Why Use Event-Based Interfaces Which type of interface do you use An object-based or an event-based interface Unfortunately there is no clean-cut .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.