TAILIEUCHUNG - Oracle XSQL- P17

Oracle XSQL- P17Welcome 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. | 300 Chapter 13 Unlike our previous examples you are now using a template element. This element must be defined at the top level a direct child of the root. For this reason all the HTML code should be included in a template. If you don t include all this code the XSLT processor won t find it. Generally a template that matches the root of your XSQL document includes scripts as well as a head section and any header and footer information The next example includes the remaining data from the query. Instead of a bulleted list the data is nicely formatted in a table. It also uses a call-template element to put a standard break wherever necessary. xml version xsl stylesheet version xmlns xsl http 1999 XSL Transform xsl template match page html head title Simple Stylesheet title head body h1 Simple Stylesheet h1 table border 0 th th th Name th th Job th th Salary th xsl apply-templates select ROWSET table body html xsl template xsl template match ROW tr td xsl apply-templates select @num td td xsl apply-templates select ENAME td td xsl apply-templates select JOB td td xsl apply-templates select SAL td xsl call-template name break tr xsl template xsl template name break tr td height 4 colspan 4 hr td tr xsl template xsl template match JOB SAL xsl apply-templates xsl template xsl template match ENAME b xsl apply-templates b xsl template xsl stylesheet XSLT In-Depth 301 Figure Output of stylesheet. The template produces the output seen in Figure . The JOB and SAL elements share a template while ENAME gets its own. The only named template break is referenced by xsl call-template. In practice xsl call-template is used in conjunction with parameters. Examples are found later in this chapter. Also notice that the num attribute from the ROW element is in our output. This was accomplished with xsl apply-templates select @num . Templates work against nodes not elements so you can use these template elements in conjunction with attributes. This example is

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
10    4    0    10-08-2020
1    4    0    10-08-2020
3    6    0    10-08-2020
43    6    0    10-08-2020
27    28    0    10-08-2020
TÀI LIỆU LIÊN QUAN