Oracle® XML API Reference 10g Release 1 (10.1) Part No. B10789-01 December 2003 Oracle XML API Reference, 10g Release 1 (10.1) Part No. B10789-01 Copyright © 2001, 2003 Oracle Corporation. All rights reserved. Contributing Authors: Stanley Guan, Dmitry Lenkov, Roza Leyderman, Ian Macky, Anguel Novoselsky, Tomas Saulys, Mark Scardina 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 Store, Oracle9i, PL/SQL, and SQL*Plus are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. iii Contents Send Us Your Comments . xxxi Preface . xxxiii Audience . xxxiv Organization . xxxiv Related Documentation . xxxv Conventions xxxvi Documentation Accessibility xxxviii What's New in Oracle XML API Reference? . xli 10g Release 1 (10.1) . xli Part I XML APIs for C 1 Mapping Between Old and New C APIs C Package Changes 1-2 Initializing and Parsing Sequence Changes 1-3 Datatype Mapping between oraxml and xml Packages 1-5 Method Mapping between oraxml and xml Packages 1-7 2 Datatypes for C C Datatypes 2-2 xmlcmphow . 2-3 iv xmlctx . 2-3 xmlerr . 2-4 xmlistream . 2-4 xmliter . 2-5 xmlnodetype 2-5 xmlostream 2-6 xmlpoint . 2-7 xmlrange 2-7 xmlshowbits . 2-8 xmlurlacc 2-8 xmlurlhdl . 2-9 xmlurlpart 2-9 xmlxptrloc 2-10 xmlxptrlocset . 2-10 xmlxslobjtype 2-10 xmlxslomethod 2-10 xmlxvm . 2-11 xmlxvmcomp . 2-11 xmlxvmflags 2-11 xmlxvmobjtype . 2-11 xpctx 2-12 xpexpr . 2-12 xpobj . 2-12 xsdctx 2-12 xslctx . 2-13 xvmobj 2-13 3 Package Callback APIs for C Callback Methods . 3-2 XML_ACCESS_CLOSE_F 3-2 XML_ACCESS_OPEN_F . 3-3 XML_ACCESS_READ_F . 3-3 XML_ALLOC_F 3-4 XML_ERRMSG_F . 3-5 XML_FREE_F 3-5 v XML_STREAM_CLOSE_F 3-6 XML_STREAM_OPEN_F 3-6 XML_STREAM_READ_F 3-7 XML_STREAM_WRITE_F 3-8 4 Package DOM APIs for C Attr Interface 4-2 XmlDomGetAttrLocal 4-3 XmlDomGetAttrLocalLen . 4-3 XmlDomGetAttrName . 4-4 XmlDomGetAttrNameLen 4-5 XmlDomGetAttrPrefix . 4-6 XmlDomGetAttrSpecified . 4-7 XmlDomGetAttrURI 4-7 XmlDomGetAttrURILen 4-8 XmlDomGetAttrValue . 4-9 XmlDomGetAttrValueLen 4-10 XmlDomGetAttrValueStream . 4-11 XmlDomGetOwnerElem . 4-11 XmlDomSetAttrValue 4-12 XmlDomSetAttrValueStream . 4-13 CharacterData Interface . 4-14 XmlDomAppendData 4-14 XmlDomDeleteData . 4-15 XmlDomGetCharData . 4-16 XmlDomGetCharDataLength . 4-16 XmlDomInsertData 4-17 XmlDomReplaceData . 4-18 XmlDomSetCharData 4-19 XmlDomSubstringData . 4-19 Document Interface 4-21 XmlDomCreateAttr 4-22 XmlDomCreateAttrNS . 4-23 XmlDomCreateCDATA . 4-24 XmlDomCreateComment 4-25 vi XmlDomCreateElem 4-26 XmlDomCreateElemNS . 4-27 XmlDomCreateEntityRef . 4-28 XmlDomCreateFragment 4-28 XmlDomCreatePI 4-29 XmlDomCreateText 4-30 XmlDomFreeString . 4-31 XmlDomGetBaseURI 4-32 XmlDomGetDTD 4-32 XmlDomGetDecl . 4-33 XmlDomGetDocElem . 4-34 XmlDomGetDocElemByID 4-34 XmlDomGetDocElemsByTag 4-35 XmlDomGetDocElemsByTagNS 4-36 XmlDomGetLastError 4-37 XmlDomGetSchema . 4-37 XmlDomImportNode . 4-38 XmlDomIsSchemaBased 4-39 XmlDomSaveString 4-40 XmlDomSaveString2 4-40 XmlDomSetBaseURI . 4-41 XmlDomSetDTD . 4-42 XmlDomSetDocOrder 4-43 XmlDomSetLastError . 4-43 XmlDomSync . 4-44 DocumentType Interface . 4-45 XmlDomGetDTDEntities . 4-45 XmlDomGetDTDInternalSubset . 4-46 XmlDomGetDTDName . 4-46 XmlDomGetDTDNotations . 4-47 XmlDomGetDTDPubID . 4-48 XmlDomGetDTDSysID 4-48 Element Interface 4-50 XmlDomGetAttr 4-51 XmlDomGetAttrNS 4-51 vii XmlDomGetAttrNode . 4-52 XmlDomGetAttrNodeNS 4-53 XmlDomGetChildrenByTag 4-53 XmlDomGetChildrenByTagNS 4-54 XmlDomGetElemsByTag . 4-55 XmlDomGetElemsByTagNS . 4-56 XmlDomGetTag 4-56 XmlDomHasAttr . 4-57 XmlDomHasAttrNS . 4-58 XmlDomRemoveAttr . 4-58 XmlDomRemoveAttrNS 4-59 XmlDomRemoveAttrNode . 4-60 XmlDomSetAttr 4-60 XmlDomSetAttrNS . 4-61 XmlDomSetAttrNode 4-62 XmlDomSetAttrNodeNS . 4-62 Entity Interface 4-64 XmlDomGetEntityNotation 4-64 XmlDomGetEntityPubID 4-65 XmlDomGetEntitySysID . 4-65 XmlDomGetEntityType . 4-66 NamedNodeMap Interface . 4-67 XmlDomGetNamedItem . 4-67 XmlDomGetNamedItemNS 4-68 XmlDomGetNodeMapItem 4-69 XmlDomGetNodeMapLength 4-69 XmlDomRemoveNamedItem . 4-70 XmlDomRemoveNamedItemNS 4-71 XmlDomSetNamedItem 4-71 XmlDomSetNamedItemNS . 4-72 Node Interface . 4-74 XmlDomAppendChild 4-76 XmlDomCleanNode . 4-76 XmlDomCloneNode . 4-77 XmlDomFreeNode . 4-78 viii XmlDomGetAttrs 4-78 XmlDomGetChildNodes . 4-79 XmlDomGetDefaultNS 4-80 XmlDomGetFirstChild . 4-80 XmlDomGetFirstPfnsPair 4-81 XmlDomGetLastChild . 4-81 XmlDomGetNextPfnsPair . 4-82 XmlDomGetNextSibling 4-83 XmlDomGetNodeLocal . 4-83 XmlDomGetNodeLocalLen . 4-84 XmlDomGetNodeName 4-85 XmlDomGetNodeNameLen 4-86 XmlDomGetNodePrefix 4-87 XmlDomGetNodeType 4-87 XmlDomGetNodeURI 4-89 XmlDomGetNodeURILen . 4-89 XmlDomGetNodeValue . 4-90 XmlDomGetNodeValueLen 4-91 XmlDomGetNodeValueStream 4-92 XmlDomGetOwnerDocument 4-93 XmlDomGetParentNode . 4-93 XmlDomGetPrevSibling 4-94 XmlDomGetSourceEntity 4-95 XmlDomGetSourceLine . 4-95 XmlDomGetSourceLocation . 4-96 XmlDomHasAttrs . 4-96 XmlDomHasChildNodes . 4-97 XmlDomInsertBefore 4-97 XmlDomNormalize 4-98 XmlDomNumAttrs . 4-98 XmlDomNumChildNodes 4-99 XmlDomPrefixToURI . 4-99 XmlDomRemoveChild . 4-100 XmlDomReplaceChild . 4-101 XmlDomSetDefaultNS . 4-101 ix XmlDomSetNodePrefix . 4-102 XmlDomSetNodeValue . 4-102 XmlDomSetNodeValueLen . 4-103 XmlDomSetNodeValueStream . 4-104 XmlDomValidate 4-105 NodeList Interface 4-106 XmlDomFreeNodeList . 4-106 XmlDomGetNodeListItem 4-106 XmlDomGetNodeListLength 4-107 Notation Interface . 4-109 XmlDomGetNotationPubID . 4-109 XmlDomGetNotationSysID 4-109 ProcessingInstruction Interface . 4-111 XmlDomGetPIData 4-111 XmlDomGetPITarget . 4-112 XmlDomSetPIData . 4-112 Text Interface 4-114 XmlDomSplitText . 4-114 5 Package Range APIs for C DocumentRange Interface 5-2 XmlDomCreateRange 5-2 Range Interface 5-3 XmlDomRangeClone . 5-4 XmlDomRangeCloneContents . 5-4 XmlDomRangeCollapse 5-5 XmlDomRangeCompareBoundaryPoints . 5-5 XmlDomRangeDeleteContents . 5-6 XmlDomRangeDetach . 5-7 XmlDomRangeExtractContents . 5-7 XmlDomRangeGetCollapsed 5-8 XmlDomRangeGetCommonAncestor . 5-8 XmlDomRangeGetDetached . 5-9 XmlDomRangeGetEndContainer . 5-9 XmlDomRangeGetEndOffset 5-10 x XmlDomRangeGetStartContainer 5-10 XmlDomRangeGetStartOffset . 5-11 XmlDomRangeIsConsistent 5-12 XmlDomRangeSelectNode 5-12 XmlDomRangeSelectNodeContents 5-13 XmlDomRangeSetEnd . 5-13 XmlDomRangeSetEndBefore 5-14 XmlDomRangeSetStart 5-15 XmlDomRangeSetStartAfter . 5-15 XmlDomRangeSetStartBefore . 5-16 6 Package SAX APIs for C SAX Interface . 6-2 XmlSaxAttributeDecl . 6-3 XmlSaxCDATA . 6-3 XmlSaxCharacters . 6-4 XmlSaxComment 6-5 XmlSaxElementDecl . 6-5 XmlSaxEndDocument 6-6 XmlSaxEndElement 6-6 XmlSaxNotationDecl 6-7 XmlSaxPI 6-8 XmlSaxParsedEntityDecl . 6-8 XmlSaxStartDocument . 6-9 XmlSaxStartElement . 6-10 XmlSaxStartElementNS . 6-10 XmlSaxUnparsedEntityDecl 6-11 XmlSaxWhitespace . 6-12 XmlSaxXmlDecl 6-13 7 Package Schema APIs for C Schema Interface . 7-2 XmlSchemaClean 7-2 XmlSchemaCreate . 7-3 XmlSchemaDestroy 7-3 [...]... APIs for C XML Interface 9-2 xi XmlAccess XmlCreate XmlCreateDTD XmlCreateDocument XmlDestroy XmlFreeDocument XmlGetEncoding XmlHasFeature XmlIsSimple XmlIsUnicode XmlLoadDom XmlLoadSax XmlLoadSaxVA... Old and New C APIs" Chapter 13, "Package XSLTVM APIs for C" Part II, "XML APIs for C++" This part provides information about XML related C++ APIs: ■ Chapter 14, "Package Ctx APIs for C++" ■ Chapter 15, "Package Dom APIs for C++" ■ Chapter 16, "Package IO APIs for C++" ■ Chapter 17, "Package OracleXml APIs for C++" ■ Chapter 18, "Package Parser APIs for C++" ■ Chapter 19, "Package Tools APIs for C++"... XPath APIs for C++" ■ Chapter 21, "Package XPointer APIs for C++" ■ Chapter 22, "Package Xsl APIs for C++" Related Documentation For more information, see these Oracle resources: ■ Oracle Database Concepts ■ Oracle Database SQL Reference ■ Oracle Database Application Developer's Guide - Object-Relational Features ■ Oracle Database New Features ■ Oracle XML Developer's Kit Programmer's Guide ■ Oracle XML. .. XMLXVM_DEBUG_F XmlXvmCreate XmlXvmDestroy XmlXvmEvaluateXPath XmlXvmGetObjectBoolean XmlXvmGetObjectNSetNode XmlXvmGetObjectNSetNum XmlXvmGetObjectNumber XmlXvmGetObjectString XmlXvmGetObjectType XmlXvmGetOutputDom XmlXvmResetParams XmlXvmSetBaseURI... XmlXvmSetBytecodeBuffer XmlXvmSetBytecodeFile XmlXvmSetBytecodeURI XmlXvmSetDebugFunc XmlXvmSetOutputDom XmlXvmSetOutputEncoding XmlXvmSetOutputSax XmlXvmSetOutputStream XmlXvmSetTextParam XmlXvmTransformBuffer XmlXvmTransformDom XmlXvmTransformFile... XmlSaveDom XmlVersion 10 Package XPath APIs for C XPath Interface XmlXPathCreateCtx XmlXPathDestroyCtx XmlXPathEval XmlXPathGetObjectBoolean XmlXPathGetObjectFragment XmlXPathGetObjectNSetNode XmlXPathGetObjectNSetNum XmlXPathGetObjectNumber XmlXPathGetObjectString...XmlSchemaErrorWhere XmlSchemaLoad XmlSchemaLoadedList XmlSchemaSetErrorHandler XmlSchemaSetValidateOptions XmlSchemaTargetNamespace XmlSchemaUnload XmlSchemaValidate XmlSchemaVersion 8 Package Traversal APIs for C DocumentTraversal Interface XmlDomCreateNodeIter... XmlXPtrLocGetRange XmlXPtrLocGetType XmlXPtrLocToString XPtrLocSet Interface XmlXPtrLocSetFree XmlXPtrLocSetGetItem XmlXPtrLocSetGetLength 12 Package XSLT APIs for C XSLT Interface XmlXslCreate XmlXslDestroy XmlXslGetBaseURI XmlXslGetOutput... "Package Callback APIs for C" ■ Chapter 4, "Package DOM APIs for C" ■ Chapter 5, "Package Range APIs for C" ■ Chapter 6, "Package SAX APIs for C" ■ Chapter 7, "Package Schema APIs for C" ■ Chapter 8, "Package Traversal APIs for C" ■ Chapter 9, "Package XML APIs for C" ■ Chapter 10, "Package XPath APIs for C" ■ Chapter 11, "Package XPointer APIs for C" ■ Chapter 12, "Package XSLT APIs for C" ■ xxxiv... your local Oracle Support Services xxxi xxxii Preface This reference describes Oracle XML Developer's Kits (XDK) and Oracle XML DB APIs It primarily lists the syntax of functions, methods, and procedures associated with these APIs This preface contains these topics: ■ Audience ■ Organization ■ Related Documentation ■ Conventions xxxiii Audience This guide is intended for developers building XML applications . Oracle XML API Reference 10g Release 1 (10.1) Part No. B10789-01 December 2003 Oracle XML API Reference, 10g Release 1 (10.1). and Oracle Corporation disclaims liability for any damages caused by such use of the Programs. Oracle is a registered trademark, and Oracle Store, Oracle9 i,