Building Oracle XML Applications phần 9

Kiểu ví dụ chọn một chuỗi giá trị cho một biến urlBase của: và một chuỗi giá trị cho một biến urlArgs của công ty = tại & t / mobilcom, trong đó có một số không gian, một ký hiệu, và một dấu gạch chéo. Để kiểm tra sự chuyển đổi này ví dụ, bạn có thể sử dụng bất kỳ tập tin XML như là nguồn gốc và hãy thử như sau: | xsl value-of select oracleUrl EncodeURLArgs text xsl when xsl choose xsl template xsl stylesheet This example stylesheet selects a string value for a urlBase variable of http SomeService and a string value for a urlArgs variable of company at t mobilcom which contains some spaces an ampersand and a slash. To test this example transformation you can use any XML file as the source and try the following With James Clark s xt XSLT processor xt With Michael Kay s Saxon XSLT processor saxon With the Oracle XSLT Processor oraxsl All three processors produce the following identical output http SomeService company at 20 26 20t 20 2F 20mobilecom We can write a stylesheet that refers to extension functions in several different namespaces only one of which we re expecting to be usable by the current processor at transformation time because an XSLT processor signals errors only if you actually try to use the function. By wrapping the extension function in a named template that uses xsl choose and function-available to selectively invoke the correct function we can avoid the situation of ever invoking a function that is not available. Debugging Your XSLT Java Extension Functions You will certainly need to debug your XSLT Java extension functions to make sure they are working correctly. Using JDeveloper you have two choices for how to do this both straightforward. If you are using XSLT in combination with XSQL Pages you can follow the steps we outlined earlier for debugging XSQL page action handlers. If you set breakpoints in the Java code for your own XSLT extension functions the debugger will stop at your breakpoint when your function is invoked by the XSLT processor. If you want to debug from the command line you can use JDeveloper remote debugging support to debug the command-line Oracle XSLT processor.

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
141    114    11    29-05-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.