Skip Headers

Oracle9i XML Developer's Kits Guide - XDK
Release 2 (9.2)

Part Number A96621-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

18
XML Schema Processor for C++

This chapter contains the following sections:

Oracle XML Schema Processor for C++ Features

The XML Schema Processor for C++ is a companion component to the XML Parser for C++ that allows support to simple and complex datatypes into XML applications with Oracle9i.

The XML Schema Processor for C++ supports the W3C XML Schema Recommendation, with the goal being that it be 100% fully conformant when XML Schema becomes a W3C Recommendation. This makes writing custom applications that process XML documents straightforward in the Oracle9i environment, and means that a standards-compliant XML Schema Processor is part of the Oracle9i platform on every operating system where Oracle9i is ported.

See Also:

Chapter 4, "XML Parser for Java", for more information about XML Schema and why you would want to use XML Schema.

Oracle XML Schema for C++ Features

XML Schema Processor for C++ has the following features:

The XML Schema Processor for C++ class is XMLSchema.

See Also:

Oracle9i XML API Reference - XDK and Oracle XML DB

Online Documentation

Documentation for Oracle XML Schema Processor for C++ is located in the doc directory in your install area.

Standards Conformance

The Schema Processor conforms to the following standards:

XML Schema Processor for C++: Provided Software

Table 18-1 lists the supplied files and directories with this release:

Table 18-1 XML Schema Processor for C++: Supplied Files
Directory an d Files Description

license.html

Licensing agreement

readme.html

This file

bin

Schema processor executable, "schema"

doc

API documentation

include

header files

lib

XML/XSL/Schema & support libraries

mesg

Error message files

sample

Example usage of the Schema processor

Table 18-2 lists the included libraries:

Table 18-2 XML Schema Processor for C++: Supplied Libraries
Included Library Description

libxml9.a

XML Parser/XSL Processor

libxsd9.a

XML Schema Processor

libcore9.a

CORE functions

libnls9.a

Globalization Support

Invoking XML Schema Processor for C++

The XML Schema Processor can be called as an executable by invoking bin/schema in the install area. This takes two arguments:

The Schema processor can also be invoked by writing code using the supplied APIs. The code must be compiled using the headers in the include/ subdirectory and linked against the libraries in the lib/ subdirectory. See Makefile in the sample/ subdirectory for details on how to build your program.

An error message file is provided in the mesg/ subdirectory. Currently, the only message file is in English although message files for other languages may be supplied in future releases.

XML Schema Processor for C++ Usage Diagram

Figure 18-1 illustrates the calling sequence of XMl Schema Processor for C++, as follows:

The sequence of calls to the processor is: initialize, validate, validate,..., validate, terminate.

  1. The initialize call is invoked once at the beginning of a session; it returns a Schema context which is used throughout the session.
  2. The instance document to be validated is first parsed with the XML parser.
  3. The XML context for the instance is then passed to the Schema validate function, along with an optional schema URL.
  4. If no explicit schema is defined in the instance document, the default schema will be used.
  5. More documents may then be validated using the same schema context.
  6. When the session is over, the Schema tear down function is called, which releases all memory allocated by the loaded schemas.

Figure 18-1 XML Schema Processor for C++ Usage Diagram

Text description of adxml093.gif follows
Text description of the illustration adxml093.gif


Running the Provided XML Schema Sample Programs

This directory contains a sample XML Schema application that illustrates how to use Oracle XML Schema Processor with its API. Table 18-3 lists the provided sample files.

Table 18-3 XML Schema for C++ Samples Provided  
Sample File Description

Makefile

Makefile to build the sample programs and run them, verifying correct output.

xsdtest.cpp

Trivial program which invokes the XML Schema for C++ API

car.{xsd,xml,std}

Sample Schema, instance document, expected output respectively, after running xsdtest on them.

aq.{xsd,xml,std}

Second sample Schema's, instance document, expected output respectively, after running xsdtest on them.

pub.{xsd,xml,std}

Third sample Schema's, instance document, expected output respectively, after running xsdtest on them.

To build the sample programs, run make.

To build the programs and run them, comparing the actual output to expected output, run make sure.


Go to previous page Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback