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

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

Chú ý rằng chúng tôi đã nhận xét ra các kiểm tra cho các kích cỡ không đồng đều bởi vì thử nghiệm đó là không hợp lệ trong sự hiện diện của bản sao. Ví dụ, một bộ có thể có ba lần xuất hiện của một phần tử với chuỗi giá trị foo, trong khi có một yếu tố duy nhất foo. | xsl import href tree-control.xslt xsl param name collapse xsl variable name collapse-test select concat collapse xsl template match mode name xsl if test not ancestor contains collapse-test concat local-name . xsl apply-imports xsl if xsl template xsl template match mode value xsl if test not ancestor contains collapse-test concat local-name . xsl apply-imports xsl if xsl template xsl template match mode line-break xsl if test not ancestor contains collapse-test concat local-name . xsl apply-imports xsl if xsl template xsl template match mode indent xsl choose xsl when test self contains collapse-test concat local-name . xsl for-each select ancestor xsl text xsl text xsl for-each xsl text x- xsl text xsl when xsl when test ancestor contains collapse-test concat local- name . xsl otherwise xsl apply-imports xsl otherwise xsl choose xsl template xsl stylesheet Example 5-34. Output with collapse Employee PayPeriod o- ExpenseReport x- Employee x- PayPeriod o- Expenses o- Expense - Date 12 20 01 - Account 12345 Desc Goofing off instead of going to confrence. - Lodging 500.00 Transport 50.00 Fuel 0 - Meals 300.00 - Phone 10 0 - Entertainment 1000.00 - other 300.00 o- Expense - Date 12 20 01 - Account 12345 Desc On the beach - Lodging 500.00 Transport 50.00 Fuel 0 - Meals 200.00 - Phone 2 0 - Entertainment 300.00 - other 100.00 There is literally no end to the variety of custom tree formats you can create from overrides to the basic stylesheet. In object-oriented circles this technique is called the template-method pattern. It involves building the skeleton of an algorithm and allowing subclasses to redefine certain steps without changing the algorithm s structure. In the case of XSLT importing stylesheets take the place of subclasses. The power of this example does not stem from the fact that creating tree-like rendering is difficult it is not. Instead the power lies in the ability to reuse the example s structure while considering only the aspects you want to change. .

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