9i rel 2 xml dev kit gd

774 1.6K 0
9i rel 2 xml dev kit gd

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Oracle9 i XML Developer’s Kits Guide - XDK Release 2 (9.2) March 2002 Part No. A96621-01 Oracle9i XML Developer’s Kits Guide - XDK, Release 2 (9.2) Part No. A96621-01 Copyright © 2001, 2002 Oracle Corporation. All rights reserved. Primary Author: Jack Melnick Contributing Authors: Mark Bauer, Shelley Higgins, Steve Muench, Mark Scardina, Jinyu Wang Contributors: Sandeepan Banerjee, Kishore Bhamidipati, Bill Han, K. Karun, Murali Krishnaprasad, Bruce Lowenthal, Anjana Manian, Meghna Mehta, Nick Montoya, Ravi Murthy, Den Raphaely, Blaise Ribet, Tarvinder Singh, Tomas Saulys, Tim Yu, Jim Warner, Simon Wong, Kongyi Zhou Graphic Designer: Valarie Moore The Programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent and other intellectual and industrial property laws. Reverse engineering, disassembly or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation. If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on behalf of the U.S. Government, the following notice is applicable: Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disclosure of the Programs, including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the Programs. Oracle is a registered trademark, and Oracle Press, Oracle8i, Oracle9i, PL/SQL, Pro*C/C++, Pro*COBOL, SQL*Plus, OracleMobile, Oracle Discoverer, Oracle Store, Express, Oracle7, and Pro*C are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. iii Contents Send Us Your Comments xxvii Preface xxix What’s New in XDK? xxxvii Part I XML Developer’s Kits (XDK) 1 Overview of XML Developer’s Kits and Components Oracle XML Components: Overview 1-2 Development Tools and Other XML-Enabled Oracle9i Features 1-3 XDK for Java 1-6 XDK for JavaBeans 1-6 XDK for C 1-7 XDK for C++ 1-7 XDK for PL/SQL 1-7 XML Parsers 1-8 XSL Transformation (XSLT) Processor 1-9 XML Class Generator 1-10 XML Transviewer JavaBeans 1-11 Oracle XSQL Page Processor and Servlet 1-12 Servlet Engines That Support XSQL Servlet 1-13 JavaServer Pages Platforms That Support XSQL Servlet 1-13 Oracle XML SQL Utility (XSU) 1-16 iv Generating XML from Query Results 1-17 XML Document Structure: Columns Are Mapped to Elements 1-17 TransX Utility 1-18 Oracle Text 1-19 XML Gateway 1-19 Oracle XML Components: Generating XML Documents 1-19 Using Oracle XML Components to Generate XML Documents: Java 1-20 Using Oracle XML Components to Generate XML Documents: C 1-22 Using Oracle XML Components to Generate XML Documents: C++ 1-24 Using Oracle XML Components to Generate XML Documents: PL/SQL 1-26 Frequently Asked Questions (FAQs): Oracle XML-Enabled Technology 1-28 Frequently Asked Questions About the XDK 1-28 What XML Components Do I Need to Install? 1-28 What Software Is Needed to Build an XML Application? 1-29 XML Questions 1-29 Are There XDK Utilities That Translate Data from Other Formats to XML? 1-30 Can Oracle Generate a Database Schema from a Rational Rose Generated XML File? 1-30 Does Oracle Offer Any Tools to Create and Edit XML Documents? 1-31 How Can I Format XML Documents as PDF? 1-31 How Do I Load a Large XML Document into the Database? 1-31 Can SQL*Loader Support Nesting? 1-32 Frequently Asked Questions About Previous Oracle Releases 1-33 Can I Use Parsers from Different Vendors? 1-33 Is There XML Support in Oracle Release 8.0.6? 1-34 Can I Do Data Transfers to Other Vendors Using XML from Oracle Release 7.3.4? 1-34 If I Use Versions Prior to Oracle8i Can I Use Oracle XML Tools? 1-34 Can I Create Magnetic Tape Files with Oracle XML? 1-35 Frequently Asked Questions About Browsers that Support XML 1-35 Which Browsers Support XML? 1-35 Frequently Asked Questions About XML Standards 1-35 Are There Advantages of XML Over EDI? 1-35 What B2B Standards and Development Tools Does Oracle Support? 1-36 What Is Oracle Corporation’s Direction Regarding XML? 1-37 What Is Oracle Corporation’s Plans for XML Query? 1-37 Are There Standard DTDs That We Can Use for Orders, Shipments, and So On? 1-37 v Frequently Asked Questions About XML, CLOBs, and BLOBs 1-38 Is There Support for XML Messages in BLOBs? 1-38 Frequently Asked Questions About Maximum File Sizes 1-38 What Is the Maximum XML File Size When Stored in CLOBs? 1-38 Are There Any Limitations on the Size of an XML File? 1-38 What Is the Maximum Size for an XML Document? 1-38 Frequently Asked Questions About Inserting XML Data into Tables 1-39 What Do I Need to Insert Data Into Tables Using XML? 1-39 Frequently Asked Questions About XML Performance in the Database 1-39 Where Can I Find Information About the Performance of XML and Oracle? 1-39 How Can I Speed Up the Record Retrieval in XML Documents? 1-40 Frequently Asked Questions About Multiple National Languages 1-40 How Do I Put Information in Chinese into XML? 1-40 Frequently Asked Questions About Reference Material 1-41 What Are Some Recommended XML and XSL Books? 1-41 2 Getting Started with XDK for Java and JavaBeans Installation of the XDK for Java 2-2 Installation Steps for XDK for Java 2-2 What Are the XDK for Java Components? 2-3 Environment Settings for XDK for Java 2-5 XSU Setup 2-6 XSQL Servlet Setup 2-7 XDK for Java with Globalization Support 2-16 XDK Dependencies 2-16 Installation of the XDK for JavaBeans 2-17 XDK for JavaBeans Components 2-19 Setting Up the XDK for JavaBeans Environment 2-21 XDK for JavaBeans with Globalization Support 2-22 3 Getting Started with XDKs for C/C++ and PL/SQL Installation of XDK for C 3-2 Getting the XDK for C 3-2 UNIX Environment Setup 3-3 Windows NT Environment Setup 3-4 vi Installation of the XDK for C++ 3-13 Getting the XDK for C++ 3-14 Setting the UNIX Environment for C++ 3-15 Windows NT Environment Setup 3-16 Installation of XDK for PL/SQL 3-25 Setting the Environment for XDK for PL/SQL 3-26 Installing XDK for PL/SQL into the Database 3-27 Loading XDK for PL/SQL 3-29 Part II XDK for Java 4 XML Parser for Java XML Parser for Java: Features 4-2 XSL Transformation (XSLT) Processor 4-4 Namespace Support 4-5 Oracle XML Parsers Validation Modes 4-5 Parsers Access XML Document’s Content and Structure 4-6 DOM and SAX APIs 4-7 DOM: Tree-Based API 4-8 SAX: Event-Based API 4-8 Guidelines for Using DOM and SAX APIs 4-9 XML Compressor 4-10 XML Serialization/Compression 4-10 Running the XML Parser for Java Samples 4-11 XML Parser for Java - XML Example 1: class.xml 4-13 XML Parser for Java - XML Example 2: Using DTD employee — employee.xml 4-14 XML Parser for Java - XML Example 3: Using DTD family.dtd — family.xml 4-14 XML Parser for Java - XSL Example 1: XSL (iden.xsl) 4-14 XML Parser for Java - DTD Example 1: (NSExample) 4-15 Using XML Parser for Java: DOMParser() Class 4-15 XML Parser for Java Example 1: Using the Parser and DOM API 4-17 Comments on DOMParser() Example 1 4-21 Using XML Parser for Java: DOMNamespace() Class 4-22 XML Parser for Java Example 2: Parsing a URL — DOMNamespace.java 4-22 Using XML Parser for Java: SAXParser() Class 4-26 vii XML Parser for Java Example 3: Using the Parser and SAX API (SAXSample.java) 4-28 XML Parser for Java Example 4: (SAXNamespace.java) 4-32 oraxml - Oracle XML parser 4-36 Using JAXP 4-37 JAXP Example: (JAVAExamples.java) 4-37 JAXP Example: (oraContentHandler.java 4-45 Frequently Asked Questions About DTDs 4-48 Why Can’t My Parser Find the DTD File? 4-48 Can I Validate an XML File Using an External DTD? 4-48 Does Oracle Perform DTD Caching? 4-48 How Does the XML Parser for Java Recognize External DTDs? 4-49 How Do I Load External DTDs from a JAR File? 4-49 Can I Check the Correctness of an XML Document Using Their DTD? 4-50 How Do I Parse a DTD Object Separately from My XML Document? 4-50 Is the XML Parser Case-Sensitive? 4-50 How Do I Extract Embedded XML from a CDATA Section? 4-51 Why Am I Getting an Error When I Call DOMParser.parseDTD()? 4-52 Is There a Standard Extension for External Entity References in an XML Document? 4-54 Frequently Asked Questions About DOM and SAX APIs 4-55 How Do I Use the DOM API to Count Tagged Elements? 4-55 How Does the DOM Parser Work? 4-55 How Do I Create a Node with a Value to Be Set Later? 4-55 How Do I Traverse the XML Tree? 4-55 How Do I Extract Elements from an XML File? 4-55 Does a DTD Validate the DOM Tree? 4-56 How Do I Find the First Child Node Element Value? 4-56 How Do I Create DocType Node? 4-56 How Do I Use the XMLNode.selectNodes() Method? 4-56 How Does the SAX API Determine the Data Value? 4-57 How Does SAXSample.java Call Methods? 4-58 Does the DOMParser Use the org.xml.sax.Parser Interface? 4-58 How Do I Create a New Document Type Node with DOM API? 4-58 How Do I Query for First Child Node’s Value of a Certain Tag? 4-59 Can I Generate an XML Document from Data in Variables? 4-59 How Do I Use the DOM API to Print Data in the Element Tags? 4-60 viii How Do I Build XML Files from Hash Table Value Pairs? 4-60 XML Parser for Java: WRONG_DOCUMENT_ERR on Node.appendChild() 4-60 Will WRONG_DOCUMENT_ERR Result from This Code Fragment? 4-61 Why Are Only the Child Nodes Inserted? 4-61 Why Do I Get DOMException when Setting Node Value? 4-61 How Can I Force the SAX Parser to Not Discard Characters Following Whitespace? 4-62 Frequently Asked Questions About Validation 4-62 What Are the Rules for Locating DTDs? 4-62 Can Multiple Threads Use a Single XSLProcessor/Stylesheet? 4-62 Can I Use Document Clones in Multiple Threads? 4-63 Frequently Asked Questions About Character Sets 4-63 How Do I Parse iso-8859-1-encoded Documents with Special Characters? 4-63 How Do I Parse XML Stored in NCLOB with UTF-8 Encoding? 4-63 Is There Globalization Support Within XML? 4-65 How Do I Parse a Document Containing Accented Characters? 4-65 How Do I Store Accented Characters in an XML Document? 4-66 Frequently Asked Questions: Adding an XML Document as a Child 4-67 How Do I Add an XML Document as a Child to Another Element? 4-67 How Do I Add an XML Document Fragment as a Child to an XML Document? 4-68 Frequently Asked General Questions About XML Parser 4-69 Why Do I Get an Error on Installing the XML Parser? 4-69 How Do I Remove the XML Parser from the Database? 4-69 What Does an XML Parser Do? 4-70 How Do I Convert XML Files into HTML Files? 4-70 Does the XML Parser Validate Against XML Schema? 4-70 How Do I Include Binary Data in an XML Document? 4-70 What Is XML Schema? 4-71 Does Oracle Participate in Defining the XML/XSL Standard? 4-71 How Do I Find XDK Version Numbers? 4-71 Are Namespace and Schema Supported? 4-71 Can I Use JDK 1.1.x with XML Parser for Java v2? 4-71 How Do I Sort the Result Within the Page? 4-71 Do I Need Oracle9i to Run XML Parser for Java? 4-72 Can I Dynamically Set the Encoding in an XML File? 4-72 How Do I Parse a String? 4-72 ix How Do I Display an XML Document? 4-72 How Do I Use System.out.println() and Special Characters? 4-72 How Do I Insert Characters <, >, =, ’, ", and & in XML Documents? 4-73 How Do I Use Special Characters in the Tags? 4-73 How Do I Parse XML from Data of Type String? 4-74 How Do I Extract Data from an XML Document into a String? 4-74 Is Disabling Output Escaping Supported? 4-74 Can I Delimit Multiple XML Documents with a Special Character? 4-74 How Do I Use Entity References with the XML Parser for Java? 4-75 Can I Divide and Store an XML Document Without a DDL Insert? 4-75 In Querying, Can I Perform Hierarchical Searches Across XML Documents? 4-75 How Do I Merge XML Documents? 4-75 How Do I Find the Value of a Tag? 4-77 How Do I Grant the JAVASYSPRIV Role to a User? 4-77 How Do I Include an External XML File in Another XML File? 4-78 Does the Parser Come with a Utility to View the Parsed Output? 4-78 From Where Can I Download OraXSL, the Parser’s Command Line Interface? 4-80 Does Oracle Support Hierarchical Mapping? 4-80 What Good Books for XML/XSL Can You Recommend? 4-81 Are There XML Developer Kits for the HP/UX Platform? 4-82 How Do I Compress Large Volumes of XML Documents? 4-82 How Do I Generate an XML Document Based on Two Tables? 4-83 5 XSLT Processor for Java Using XML Parser for Java: XSLT Processor 5-2 XSLT Processor for Java Example 5-3 XSLT Processor for Java: Command-Line Interface, oraxsl 5-6 oraxsl - Oracle XSL processor 5-6 XML Extension Functions for XSLT Processing 5-7 XSLT Processor Extension Functions: Introduction 5-7 Static Versus Non-Static Methods 5-8 Constructor Extension Function 5-8 Return Value Extension Function 5-9 Datatypes Extension Function 5-10 Oracle XSLT Built-In Extensions: ora:node-set and ora:output 5-10 x Frequently Asked Questions About the XSLT Processor and XSL 5-13 Why Am I Getting an HTML Error in XSL? 5-13 Is the Output Method “html” Supported in the XSL Parser? 5-14 Can I Prevent XSL from Returning a Meta-Tag in Netscape 4.0? 5-15 How Do I Work Around a Display Bug in the Browser? 5-16 Where Can I Get More Information on XSL Error Messages? 5-16 How Do I Generate the HTML "Less Than" (<) Character? 5-16 Why Does HTML “<“ Conversion Work in oraxsl But Not in XSLSample.java? 5-17 Where Can I Find XSLT Examples? 5-18 Where Can I Find a List of XSLT Features? 5-18 How Do I Use XSL to Convert an XML Document to Another Form? 5-18 Where Can I Find More Information on XSL? 5-20 Can the XSL Processor Produce Multiple Outputs? 5-20 6 XML Schema Processor for Java Introducing XML Schema 6-2 How DTDs and XML Schema Differ 6-2 XML Schema Features 6-3 Oracle XML Schema Processor for Java Features 6-6 Supported Character Sets 6-6 What’s Needed to Run XML Schema Processor for Java 6-7 XML Schema Processor for Java Directory Structure 6-7 XML Schema Processor for Java Usage 6-8 Modes for Schema Validation 6-8 Using the XML Schema API 6-9 How to Run the XML Schema for Java Sample Program 6-10 Makefile for XML Schema Processor for Java 6-11 XML Schema for Java Example 1: cat.xsd 6-12 XML Schema for Java Example 2: catalogue.xml 6-14 XML Schema for Java Example 3: catalogue_e.xml 6-14 XML Schema for Java Example 4: report.xml 6-15 XML Schema for Java Example 5: report.xsd 6-16 XML Schema for Java Example 6: report_e.xml 6-18 XML Schema for Java Example 7: XSDSample.java 6-18 XML Schema for Java Example 8: XSDSetSchema.java 6-20 [...]... DOMElement Using PL/SQL Parser? 20 -10 20 -10 20 -13 20 -16 20 -16 20 -16 20 -17 20 -17 20 -19 20 -19 20 -20 20 -21 20 -21 20 -22 20 -23 20 -23 20 -23 20 -23 20 -24 20 -24 20 -24 20 -24 20 -25 20 -25 20 -25 20 -25 20 -26 20 -26 20 -26 20 -26 20 -26 20 -26 20 -26 20 -27 20 -27 xxi I Am Using XML Parser with DOM; Why Can I Not Get the Actual Data? Can the XML Parser for PL/SQL Produce Non -XML Documents? I Cannot Run the Sample File Did... exception:java.lang.ClassCastException?" 21 20 -27 20 -27 20 -27 20 -27 20 - 32 20- 32 20- 32 20-33 20 -33 20 -34 20 -34 20 -34 XSLT Processor for PL/SQL Using the XML Parser for PL/SQL: XSLT Processor (DOM Interface) 21 -2 XML Parser for PL/SQL: XSLT Processor — Default Behavior 21 -4 XML Parser for PL/SQL Example: XSL — iden.xsl 21 -5 22 XML Schema Processor for PL/SQL Oracle XML Schema Processor for PL/SQL... (PL/SQL) XSU Generating XML Example 2: Printing CLOB to Output Buffer XSU Generating XML Example 3: Changing ROW and ROWSET Tag Names XSU Generating XML Example 4: Using setMaxRows() and setSkipRows() Setting Stylesheets in XSU (PL/SQL) xxii 22 -2 22- 2 22 -3 22 -4 22 -6 22 -6 23 -2 23 -2 23 -2 23-3 23 -3 23 -4 23 -5 Binding Values in XSU (PL/SQL) XSU Generating XML Example 5: Binding... Interface) XML Parser for PL/SQL: Default Behavior Using XML Parser for PL/SQL Examples in the Sample Directory Setting Up the Environment to Run the Sample Programs Running domsample Running xslsample XML Parser for PL/SQL Example: XML — family .xml xx 18 -2 18 -2 18 -2 18-3 18-3 18-4 18-5 20 -2 20 -2 20 -2 20-5 20 -5 20 -5 20 -6 20 -7 20 -9 XML Parser for... 23 -8 23 -8 23 -9 23 -10 23 -11 23 - 12 23- 12 23- 12 23-13 23 -14 23 -16 23 -16 23 -16 Tools and Frameworks That Support XDK Developing XML Applications with JDeveloper Introducing JDeveloper JDeveloper Covers the Complete Development Life Cycle JDeveloper Runs on Windows, Linux, and Solaris™ Operating Environment Java Alone Is Not Enough XML Tools in JDeveloper ... Support B 26 -2 26-3 26 -3 26 -4 26 -4 26 -5 26 -5 26 -5 26 -6 26 -6 26 -8 A -2 A -2 A -2 A -2 A-3 A-3 A-3 A-5 A-5 A-5 A-5 A-6 A-7 A-8 A-8 A-9 XDK for PL/SQL: Specifications XML Parser for PL/SQL Oracle XML Parser Features Namespace Support Validating and Non-Validating Mode Support B -2 B -2 B-3 B-3 xxv Example Code IXML Parser for PL/SQL... messages .xml? How Do I Move Complex XML Documents to a Database? 25 24 - 12 24- 12 24-13 24 -14 24 -15 24 -15 24 -16 24 -17 24 -18 Introduction to BC4J Introducing Business Components for Java (BC4J) 25 -2 What Is the Business Components Framework? 25 -4 Using Business Components 25 -4 Advantages at BC4J Design Time 25 -5 Advantages at BC4J Runtime 25 -5... 24 -3 24 -3 24 -3 24 -5 24 -6 24 -7 24 -7 24 -8 24 -9 24 -9 24 -9 24 -11 24 -11 xxiii Procedure for Building Applications in JDeveloper Using XSQL Servlet from JDeveloper JDeveloper XSQL Example 2: Employee Data from Table emp: emp.xsql JDeveloper XSQL Example 3: Employee Data with Stylesheet Added Frequently Asked Questions About JDeveloper and XML Applications How Do I Construct an XML. .. 11-7 11-8 12- 2 12- 2 12- 4 12- 4 12- 5 12- 5 12- 6 12- 6 12- 8 XDK for C/C++ XML Parser for C Accessing XML Parser for C XML Parser for C Features Specifications Memory Allocation Thread Safety Data Types Index Error Message Files Validation Modes XML Parser for C Usage XML Parser... Development What’s Needed to Run JDeveloper XSQL Component Palette Page Selector Wizard XDK Features in JDeveloper Oracle XDK Integration in JDeveloper Developing Web Applications in JDeveloper Using XSQL Pages Building XML Applications with JDeveloper JDeveloper XDK Example 1: BC4J Metadata 24 -2 24 -2 24-3 . Oracle9 i XML Developer’s Kits Guide - XDK Release 2 (9 .2) March 20 02 Part No. A96 621 -01 Oracle9i XML Developer’s Kits Guide - XDK, Release 2 (9 .2) Part No. A96 621 -01 Copyright © 20 01, 20 02 Oracle. XDK? xxxvii Part I XML Developer’s Kits (XDK) 1 Overview of XML Developer’s Kits and Components Oracle XML Components: Overview 1 -2 Development Tools and Other XML- Enabled Oracle9i Features 1-3 XDK. End, OracleXML 8-17 Generating XML Using the XSU Command Line 8-17 XSU’s OracleXML getXML Options 8-19 Inserting XML Using XSU’s Command Line (putXML) 8 -20 XSU OracleXML putXML Options 8 -22 XSU Java

Ngày đăng: 18/04/2014, 10:24

Mục lục

    Send Us Your Comments

    How to Order this Manual

    Downloading Release Notes, Installation Guides, White Papers

    How to Access this Manual On-Line

    What’s New in XDK?

    Part I XML Developer’s Kits (XDK)

    1 Overview of XML Developer’s Kits and Components

    Oracle XML Components: Overview

    Development Tools and Other XML-Enabled Oracle9i Features

    XDK for PL/SQL

Tài liệu cùng người dùng

Tài liệu liên quan