Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

Mark V. Scardina, Ben ChangandJinyu Wang

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






The Oracle XQuery Engine


The Oracle XQuery engine is a prototype implementation of the evolving XQuery language, with Oracle extensions. Written in Java, the engine can be invoked via its OJXQI Java API, or via its XQLPlus command-line utility. This engine can be used either within the Oracle database or outside, as in a web application server or client. The only other requirements are Oracle XDK 9i or above, an associated JDBC driver, and JDK 1.3. This prototype is based on the November 15, 2002 draft of the specification.


Setting Up the Environment


On Windows platforms, xq.zip needs to be downloaded and unzipped. The directory contains the JAR file, xquery.jar, an example XQuery file and XML file, and a Javadoc directory. The next step is to include in your CLASSPATH the location of this JAR and the JARs in the Oracle XDK, along with your desired JDK or JRE.

Similarly, on UNIX platforms, the xq.tar.gz file needs to be downloaded, unzipped, and extracted; and the CLASSPATH needs to be set properly. These distributions contain the same files and can also be used on any Oracle-supported platform with the appropriate port of the JDK or JRE.


Testing Your Installation


On both Windows and UNIX platforms, in order to test the installation, after you make sure the CLASSPATH has been set correctly, run XQLPlus via the following command:

java oracle.xquery.XQLPlus exmpl1.xql

This will process the following XQuery contained in exmpl1.xql:

<bib>
{
FOR $b IN document("bib.xml")/bib/book
WHERE $b/publisher = "Addison-Wesley" AND $b/@year > 1991
RETURN
<book year="{ $b/@year }">
{ $b/title }
</book>
}
</bib>

The preceding query parses bib.xml, iterating over all the <book> elements that it has assigned to the $b variable. For each <publisher> element, it attempts to match the string value as well as a numeric comparison against the year attribute. For each entry that satisfies both conditions, it creates an XML output of the title and year published. The matched portion of bib.xml and the result is as follows:

<bib>
<book year="1994">
<title>TCP/IP Illustrated</title>
<author><last>Stevens</last><first>W.</first></author>
<publisher>Addison-Wesley</publisher>
<price> 65.95</price>
</book>
<book year="1992">
<title>Advanced Programming in the Unix environment</title>
<author><last>Stevens</last><first>W.</first></author>
<publisher>Addison-Wesley</publisher>
<price>65.95</price>
</book>

</bib>
Result
--------------------------------------------------------
<bib>
<book year="1994">
<title>TCP/IP Illustrated</title>
</book>
<book year="1992">
<title>Advanced Programming in the Unix environment</title>
</book>
</bib>

Note that the file being queried, bib.xml, is in the query itself and is not passed on the command line.

/ 218