Đang chuẩn bị liên kết để tải về tài liệu:
xslt cookbook phần 2

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

có thể được thiết kế dễ dàng. Nếu nó không phải là kiểm chứng, nó không phải là một yêu cầu. Suzanne Robertson nói, bằng ngôn ngữ hơi khác nhau về "phù hợp với tiêu chuẩn" - một giải pháp phù hợp với yêu cầu: thiết kế hệ thống có thể sử dụng các tiêu chuẩn để đáp ứng | 2.6 Computing Sums and Products 2.6.1 Problem You need to sum or multiply functions of numbers contained in a node set. 2.6.2 Solution The abstract form of sum for processors that support tail-recursive optimization is as follows xsl template name math sum -- Initialize nodes to empty node set -- xsl param name nodes select . xsl param name result select 0 xsl choose xsl when test not nodes xsl value-of select result xsl when xsl otherwise -- call or apply template that will determine value of node unless the node is literally the value to be summed -- xsl variable name value xsl call-template name some-function -of- a-node xsl with-param name node select nodes 1 xsl call-template xsl variable -- recurse to sum rest -- xsl call- template name math sum xsl with-param name nodes select nodes position 1 xsl with-param name result select result value xsl call -template xsl otherwise xsl choose xsl template Two techniques can handle a large number of nodes in the absence of tail-recursive optimization. The first is commonly called divide and conquer. The idea behind this technique is to reduce the amount of work by at least a factor of two on each recursive step xsl template name math sum-dvc xsl param name nodes select . xsl param name result select 0 xsl param name dvc-threshold select 100 xsl choose xsl when test count nodes lt dvc-threshold xsl call-template name math sum xsl with-param name nodes select nodes xsl with-param name result select result xsl call-template xsl when xsl otherwise xsl variable name half select floor count nodes div 2 xsl variable name sum1 xsl call-template name math sum-dvc xsl with-param name nodes select nodes position lt half xsl with-param name result select result xsl with-param name dvc-threshold select dvc-threshold xsl call-template xsl variable xsl call-template name math sum-dvc xsl with-param name nodes select nodes position half xsl with-param name result select sum1 xsl with-param name dvc-threshold select dvc-threshold xsl .

Đã 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.