TAILIEUCHUNG - Oracle XSQL- P24

Oracle XSQL- P24Welcome to the exciting world of eXtended Structured Query Language (XSQL) development! What’s so exciting? Efficiency and ease of use. XSQL isn’t some razzle-dazzle technology to wow your users. It also isn’t the latest X standard du jour that no one can stop talking about until you ask, “But what does it do for me today?” The problem with all of the great stuff out there is that no one technology does it all. | 440 Chapter 14 An XSQL Error Template Developing an error handling template is just like developing any other template. Here you ll develop a stylesheet that can be imported into other stylesheets so that you can use the same error handling routines throughout your application. Then you ll look at ways to override the basic error handling stylesheet for specific cases. Here is the error handling stylesheet itself xml version xsl stylesheet xmlns xsl http 1999 XSL Transform version xsl template match xsql-error xsl param name error-mesg Error xsl param p table border 1 tr td h3 xsl value-of select error-mesg h3 td tr tr td b XSQL Action Handler b xsl value-of select @action td tr tr td b Code b xsl value-of select @code td tr xsl apply-templates table p xsl template xsl template match message tr td b Message b xsl value-of select . td tr xsl template xsl template match statement tr td b Statement b xsl value-of select . td tr xsl template xsl stylesheet Now you just need to add the following xsl import to all of your stylesheets xsl import href Notice that you are doing an import this time not an include. The reasoning is that you can override the default template on a page-by-page basis. For instance if this error comes up in you know that it was caused by a bad search string. You can put the following template in to handle the error xsl template match xsql-error Fix your broken search string xsl apply-imports xsl template Building XSQL Web Applications 441 This will give the error and then invoke the template that resides in the xsql stylesheet. It is also possible to give more refined messages based on the error code that was returned. This one interprets the error based on the error code that was returned xsl template match xsql-error @code 911 Hey Don t use single quotes in your searches. They aren t allowed. xsl template Because you know what the error is you don t need to trouble the

TỪ KHÓA LIÊN QUAN
TÀI LIỆU HOT