TAILIEUCHUNG - xslt cookbook phần 3

XSLT. Michael Kay cuộc gọi bối cảnh nhạy cảm và cây biến tạm thời. Bối cảnh nhạy cảm biến phát sinh trong lồng nhau cho mỗi vòng khi vòng lặp bên trong phải đề cập đến bối cảnh hiện nay của vòng lặp bên ngoài. 4-12 Ví dụ, đoạn mã được vay mượn từ 4-14 Ví dụ trong công thức , product1 là một bối cảnh nhạy cảm biến cần thiết, | XSLT. Michael Kay calls them context-sensitive and temporary-tree variables. Context-sensitive variables arise in nested for-each loops when the inner loop must refer to the current context of the outer loop. In Example 4-12 the code fragment is borrowed from Example 4-14 in Recipe product1 is a necessary context-sensitive variable while product2 simply helps clarify the code. Example 4-12. A context-sensitive variable xsl template name process-products xsl param name products xsl for-each select products xsl variable name product1 select . xsl for-each select products xsl variable name product2 select . Don t analyze the product against itself -- xsl if test generate-id product1 generate-id product2 xsl call-template name show-products-sold-in-common xsl with-param name product1 select product1 xsl with-param name product2 select product2 xsl call-template xsl if xsl for-each xsl for-each xsl template Temporary-tree variables arise when you want to store the result of XSLT code in a variable. This scenario arises most often when capturing the value returned by the call to a template see Example 4-13 . Example 4-13. Storing a temporary tree xsl varaible name result-tree xsl call-template name compute-something xsl varaible XSLT and for the processors that support it allow such variables to be processed as node sets which is very convenient if you want to do anything significant with them. XSLT calls them result-tree fragments and you cannot do much more than output them without first applying a nonstandard extension node-set function. With 20 20 hindsight result-tree fragments are the classic example of a really bad idea. However when XSLT was developed it was unclear how it would be used and whether technical problems would prevent the creation of temporary node trees. Use xsl key if nodes will be selected by static criteria frequently Of all the optimization methods keys those of xsl key are the most likely to give you the biggest bang

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.