Oracle9 i XML API Reference - XDK and Oracle XML DB Release 2 (9.2) March 2002 Part No. A96616-01 Oracle9i XML API Reference - XDK and Oracle XML DB, Release 2 (9.2) Part No. A96616-01 Copyright © 2001, 2002 Oracle Corporation. All rights reserved. Primary Author: Roza Leyderman Contributing Authors: Joan Gregoire, Shelley Higgins, Diana Lorentz, Jack Melnick, Cathy Shea Contributors: Nipun Agarwal, Chandramouli Balasubramaniam, Sivasankaran Chandrasekar, Dan Chiba, Mark Drake, Fei Ge, Stanley Guan, Bill Han, Wenyn He, Sam Idicula, Anish Karmarkar, K. Karun, Bhushan Khaladkar, Muralidhar Krishnaprasad, Bruce Lowenthal, Ian Macky, Anjana Manian, Anand Manikutty, Meghna Mehta, Nick Montoya, Steve Muench, Subramanian Muralidhar, Ravi Murthy, Anguel Novoselsky, Visar Nimani, Tomas Saulys, Mark Scardina, Eric Sedlar, Tarvinder Singh, Jinyu Wang, Jim Warner, Simon Wong, Neal Wyse, Tim Yu, Kongyi Zhou 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 Oracle9i, SQL*Plus, PL/SQL, Oracle Store, Oracle Press, and ConText are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. iii Contents List of Tables Send Us Your Comments xix Preface xxi What’s New with XML Enabled Technology? xxxi Part I XDK for Java Packages 1 XML Parser for Java DefaultXMLDocumentHandler Class 1-2 DocumentBuilder Class 1-11 DOMParser Class 1-26 NodeFactory Class 1-33 oraxml class 1-39 SAXAttrList Class 1-40 SAXParser Class 1-47 XMLParseException Class 1-53 XMLParser Class 1-58 XMLToken Class 1-69 XMLTokenizer Class 1-72 NSName Class 1-76 XMLError Class 1-78 XMLException Class 1-93 iv 2 Document Object Model (DOM) NSResolver Interface 2-3 PrintDriver Interface 2-4 AttrDecl Class 2-10 DTD Class 2-15 ElementDecl Class 2-24 XMLAttr Class 2-31 XMLCDATA Class 2-39 XMLComment Class 2-42 XMLDeclPI Class 2-46 XMLDocument Class 2-52 XMLDocumentFragment Class 2-79 XMLDOMException Class 2-81 XMLDOMImplementation 2-82 XMLElement Class 2-86 XMLEntity Class 2-102 XMLEntityReference Class 2-107 XMLNode Class 2-110 XMLNotation Class 2-133 XMLNSNode Class 2-138 XMLOutputStream Class 2-147 XMLPI Class 2-153 XMLPrintDriver Class 2-157 XMLRangeException Class 2-164 XMLText Class 2-165 3 XML Processing for Java (JAXP) JXDocumentBuilder Class 3-2 JXDocumentBuilderFactory Class 3-6 JXSAXParser Class 3-10 JXSAXParserFactory Class 3-13 JXSAXTransformerFactory Class 3-16 JXTransformer Class 3-24 v 4 XSLT Processing for Java oraxsl Class 4-2 XPathException Class 4-4 XSLException Class 4-6 XSLExtensionElement Class 4-7 XSLProcessor Class 4-10 XSLStylesheet Class 4-18 XSLTContext Class 4-21 5 Compression for Java CXMLHandlerBase Class 5-2 CXMLParser Class 5-14 6 XML Schema Processing XMLSchema Class 6-2 XMLSchemaNode 6-5 XSDAttribute Class 6-8 XSDBuilder Class 6-11 XSDComplexType Class 6-15 XSDConstrainingFacet Class 6-19 XSDDataValue Class 6-22 XSDElement Class 6-24 XSDException 6-30 XSDGroup Class 6-31 XSDIdentity Class 6-34 XSDNode Class 6-36 XSDSimpleType Class 6-38 XSDConstantValues Interface 6-44 XSDValidator Class 6-52 7 XML Class Generation for Java CGDocument Class 7-2 CGNode Class 7-5 CGXSDElement Class 7-15 vi DTDClassGenerator Class 7-19 InvalidContentException Class 7-23 oracg Class 7-24 SchemaClassGenerator Class 7-25 8 XML SQL Utility for Java OracleXMLQuery Class 8-2 OracleXMLSave Class 8-19 OracleXMLSQLException Class 8-31 OracleXMLSQLNoRowsException Class 8-35 9 XSQL Pages Publishing Framework for Java oracle.xml.xsql Package 9-2 XSQLActionHandler Interface 9-3 XSQLActionHandlerImpl Class 9-5 XSQLPageRequest Interface 9-7 XSQLParserHelper Class 9-19 XSQLRequest Class 9-22 XSQLRequestObjectListener Interface 9-25 XSQLServletPageRequest Class 9-26 XSQLStylesheetProcessor Class 9-32 XSQLConnectionManager Interface 9-35 XSQLConnectionManagerFactory Interface 9-37 XSQLDocumentSerializer Interface 9-38 10 Oracle XML JavaBeans oracle.xml.async Package 10-2 DOMBuilder Class 10-3 DOMBuilderBeanInfo Class 10-14 DOMBuilderErrorEvent Class 10-16 DOMBuilderErrorListener Interface 10-18 DOMBuilderEvent Class 10-19 DOMBuilderListener Interface 10-21 ResourceManager Class 10-23 vii XSLTransformer Class 10-25 XSLTransformerBeanInfo Class 10-31 XSLTransformerErrorEvent Class 10-33 XSLTransformerErrorListener Interface 10-35 XSLTransformerEvent Class 10-36 XSLTransformerListener Interface 10-38 oracle.xml.dbviewer Package 10-40 DBViewer Class 10-41 DBViewerBeanInfo Class 10-67 oracle.xml.srcviewer Package 10-69 XMLSourceView Class 10-70 XMLSourceViewBeanInfo Class 10-88 oracle.xml.transviewer Package 10-90 DBAccess Class 10-91 DBAccessBeanInfo Class 10-100 XMLTransformPanel Class 10-102 XMLTransformPanelBeanInfo Class 10-103 XMLTransViewer Class 10-105 oracle.xml.treeviewer Package 10-107 XMLTreeView Class 10-108 XMLTreeViewBeanInfo Class 10-111 oracle.xml.differ Package 10-113 XMLDiff Class 10-114 XMLDiffBeanInfo Class 10-124 11 Simple Object Access Protocol (SOAP) for Java oracle.soap.server Package 11-2 Handler Interface 11-3 Provider Interface 11-8 ProviderManager Interface 11-11 ServiceManager Interface 11-15 ContainerContext Class 11-19 Class Logger 11-24 ProviderDeploymentDescriptor Class 11-30 RequestContext Class 11-35 viii ServiceDeploymentDescriptor Class 11-43 SOAPServerContext Class 11-55 UserContext Class 11-59 oracle.soap.transport Package 11-67 OracleSOAPTransport Interface 11-67 oracle.soap.transport.http Package 11-69 OracleSOAPHTTPConnection Class 11-69 oracle.soap.util.xml Package 11-74 XmlUtils Class 11-74 12 TransX Utility for Java TransX Utility Command Line Interface 12-2 TransX Utility Application Programming Interface 12-4 loader Class 12-4 TransX Interface 12-5 Part II XDK for C Packages 13 XML Parser for C Parser APIs 13-2 W3C SAX APIs 13-29 W3C DOM APIs 13-38 Namespace APIs 13-83 14 XSLT Processor for C Data Structures and Types of XSLT APIs 14-2 15 XML Schema Processor for C XML Schema Processor for C 15-2 ix Part III XDK for C++ Packages 16 XML Parser for C++ Attr Class 16-2 CDATASection Class 16-4 Comment Class 16-4 CharacterData Class 16-4 Document Class 16-8 DocumentType Class 16-16 DOMImplementation Class 16-17 Element Class 16-19 Entity Class 16-24 EntityReference Class 16-25 NamedNodeMap Class 16-25 Node Class 16-28 NodeList Class 16-39 Notation Class 16-41 ProcessingInstruction Class 16-42 Text Class 16-43 XMLParser Class 16-44 C++ SAX APIs 16-60 C++ DOM API's 16-69 17 XSLT Processor for C++ XSLProcessor Class 17-2 XPObject Class 17-3 XPath Class 17-6 18 XML Schema Processor for C++ XMLSchema Class 18-2 19 XML Class Generator for C++ Overview of the XML Class Generator for C++ 19-2 Relevant XML Standards 19-3 x XMLClassGenerator Class 19-4 generated Class (for DTD) 19-5 generated Class (for Schema) 19-9 Part IV XDK for PL/SQL 20 XML SQL Utility (XSU) for PL/SQL DBMS_XMLQuery Package 20-2 DBMS_XMLSave Package 20-20 Part V XML Database Support: Oracle XML DB for Java 21 Java API for XMLType XDBAttribute Class 21-3 XDBCData Class 21-3 XDBCharData Class 21-3 XDBComment Class 21-4 XDBDocument Class 21-4 XDBDomImplementation Class 21-5 XDBElement Class 21-6 XDBEntity Class 21-6 XDBNamedNodeMap Class 21-6 XDBNode Class 21-7 XDBNodeList Class 21-8 XDBNotation Class 21-8 XDBProcInst Class 21-8 XDBText Class 21-9 XMLType Class 21-9 22 Oracle XML DB API for Java Beans Mapping for XML Schema to Java Beans Classes and Methods 22-2 Mapping for Java Beans API to XML Schema, SQL, and Java Beans Data Types 22-2 [...]... 13-39 13-84 14 -2 14-5 14-6 15 -2 15-3 16 -2 16-4 16-8 16-16 16-17 16-19 16 -24 16 -25 16 -28 16-39 16-41 16- 42 16-44 16-61 16-69 17-3 17-6 18 -2 19-3 19-7 19-11 20 -2 20 -2 20-3 20 -20 20 -20 20 -20 21 -2 21-9 22 -2 xvii 22 2 23–1 24 –1 25 –1 25 2 25–3 25 –4 26 –1 27 –1 28 –1 28 2 28–3 29 –1 30–1 31–1 32 1 33–1 34–1 35–1 35 2 35–3 35–4 35–5 35–6 xviii Mapping From XML Schema, SQL, and Java Data Types 22 -2 Summary of... XMLEntityReference 2- 107 Fields of XMLNode 2- 110 Summary of Methods of XMLNode 2- 1 12 Summary of Methods of XMLNotation 2- 133 Summary of Methods XMLNSNode 2- 138 xiii 2 21 2 22 2 23 2 24 2 25 2 26 3–1 3 2 3–3 3–4 3–5 3–6 3–7 4–1 4 2 4–3 4–4 4–5 4–6 4–7 4–8 5–1 5 2 6–1 6 2 6–3 6–4 6–5 6–6 6–7 6–8 6–9 6–10 6–11 6– 12 6–13 6–14 7–1 7 2 7–3 7–4 xiv Fields of XMLOutputStream... 1–16 1–17 1–18 1–19 2 1 2 2 2–3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2–13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 Summary of Methods of DefaultXMLDocumentHandler 1 -2 Summary of Methods of DocumentBuilder 1-11 Fields of DOMParser 1 -26 Summary of Methods of DOMParser 1 -26 Summary of Methods of NodeFactory 1-33 Command-line interface of oraxml 1-39... "Java API for XMLType" Chapter 22 , "Oracle XML DB API for Java Beans" Chapter 23 , "Resource APIs for Java/JNDI" PART VI XML Database Support: Oracle XML DB for PL/SQL This section describes PL/SQL APIs for Oracle XML DB xxiii Chapter 24 , "XMLType API for PL/SQL" Chapter 25 , "PL/SQL DOM API for XMLType" Chapter 26 , "PL/SQL Parser API for XMLType" Chapter 27 , "PL/SQL XSLT Processing for XMLType" Chapter 28 ,... Methods of XMLCDATA 2- 39 Summary of XMLComment 2- 42 Summary of Methods of XMLDeclPI 2- 46 Summary of Methods of XMLDocument 2- 52 Summary of Methods of XMLDocumentFragment 2- 79 Summary of Methods of XMLDOMImplementation 2- 82 Summary of Methods of XMLElement 2- 86 Summary of Methods of XMLEntity 2- 1 02 Summary of Methods of XMLEntityReference... Package 25 -2 26 PL/SQL Parser API for XMLType DBMS_XMLPARSER Package 26 -2 27 PL/SQL XSLT Processing for XMLType DBMS_XSLPROCESSOR Package 27 -2 28 DBMS_XMLSCHEMA and Catalog Views for PL/SQL DBMS_XMLSCHEMA Package 28 -2 Catalog Views 28 -10 29 Resource Management and Access Control for PL/SQL DBMS_XDB Package 29 -2 30 Generating... 14–1 14 2 14–3 15–1 15 2 16–1 16 2 16–3 16–4 16–5 16–6 16–7 16–8 16–9 16–10 16–11 16– 12 16–13 16–14 16–15 17–1 17 2 18–1 19–1 19 2 19–3 20 –1 20 2 20–3 20 –4 20 –5 20 –6 21 –1 21 2 22 1 Data Structures Namespace APIs Summary of SAX Callback Functions Summary of Oracle SAX Extension Callback Functions Data Structures of W3C DOM APIs Summary of Functions of W3C DOM APIs .. .23 Resource APIs for Java/JNDI XDBContext Class XDBContextFactory Class XDBNameParser Class XDBNamingEnumeration Class XDBResource Class Part VI 24 23 -2 23-3 23 -3 23 -3 23 -4 XML Database Support: Oracle XML DB for PL/SQL XMLType API for PL/SQL XMLType 24 -2 25 PL/SQL DOM API for XMLType DBMS_XMLDOM Package... 23 -4 Summary of Functions and Procedures of XMLType 24 -3 DBMS_XMLDOM Types 25 -3 Defined Constants for DBMS_XMLDDOM 25 -4 Exceptions for DBMS_XMLDDOM 25 -5 Summary of Methods of DBMS_XMLDOM 25 -6 Summary of Subprograms of DBMS_XMLPARSER 26 -2 Summary of Subprograms of DBMS_XSLPROCESSOR 27 -2 Constants of DBMS_XMLSCHEMA 28 -2 Summary... regarding the accessibility of these Web sites xxx What’s New with XML Enabled Technology? This section describes the following new features: s XML Developer’s Kits Features Introduced in Oracle9i Release 2 (9 .2) s XML Database Features Introduced in Oracle9i Release 2 (9 .2) xxxi XML Developer’s Kits Features Introduced in Oracle9i Release 2 (9 .2) s XML Schema Processor for Java Supports the W3C Schema recommendation . Support: Oracle XML DB for PL/SQL 24 XMLType API for PL/SQL XMLType 24 -2 25 PL/SQL DOM API for XMLType DBMS_XMLDOM Package 25 -2 26 PL/SQL Parser API for XMLType DBMS_XMLPARSER Package 26 -2 27 PL/SQL. 2- 31 XMLCDATA Class 2- 39 XMLComment Class 2- 42 XMLDeclPI Class 2- 46 XMLDocument Class 2- 52 XMLDocumentFragment Class 2- 79 XMLDOMException Class 2- 81 XMLDOMImplementation 2- 82 XMLElement Class 2- 86 XMLEntity. of XMLEntityReference 2- 107 2 17 Fields of XMLNode 2- 110 2 18 Summary of Methods of XMLNode 2- 1 12 2–19 Summary of Methods of XMLNotation 2- 133 2 20 Summary of Methods XMLNSNode 2- 138 xiv 2 21