TAILIEUCHUNG - Oracle XSQL- P3

Oracle XSQL- P3Welcome 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. | 20 Chapter 1 The most common problem encountered with XSQL is with the symbol. This symbol is also an operator in SQL so its special status in XML causes problems. The following XSQL page will produce an error xml version page connection demo xmlns xsql urn oracle-xsql xsql query select from emp where sal 50000 xsql query page When the XML parser encounters the it thinks that it has encountered a new tag. When it encounters the next character a space it gives up. There are two workarounds 1 Use the escape sequence as demonstrated in the following code or 2 use CDATA which is covered in the next section. xml version page connection demo xmlns xsql urn oracle-xsql xsql query select from emp where sal lt 50000 xsql query page CDATA The CDATA entity allows you to declare a section of character data off-limits to the XML parser. When the parser encounters the CDATA declaration it skips all characters inside of it. Here is an example that resolves the earlier problem with the operator xml version page connection demo xmlns xsql urn oracle-xsql xsql query CDATA select from emp where sal 50000 xsql query page CDATA entities are useful any time that you have sections that shouldn t be processed because they also take a load of the processor. Comments No programming language is complete without comments. The syntax for comments in XML is as follows. It is identical to HTML comments. An XML Comment Introducing Oracle XSQL 21 Namespaces As discussed earlier XML allows you to create your own languages. However what if someone else has developed a schema that you want to use There is the chance that element names from this other schema will conflict with yours. XML has a solution for this namespaces. Namespaces allow you to make your elements globally unique. It does this by attaching your element names to a Universal Resource Identifier URI . A Uniform Resource Locator URL is an example of a URI as is a Uniform Resource Name URN . Even if you use an extremely common

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