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

15
XML Schema Processor for C

This chapter contains the following sections:

Oracle XML Schema Processor for C

The XML Schema Processor for C is a companion component to the XML Parser for C. It allows support for simple and complex datatypes in Oracle9i XML applications.

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:

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: Supplied Software

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

Table 15-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 15-2 lists the included libraries:

Table 15-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

National Language Support

Invoking XML Schema Processor for C

XML Schema Processor for C 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 15-1 describes the calling sequence for the 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 15-1 XML Schema Processor for C Usage Diagram

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


How to Run XML Schema for C Sample Programs

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

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

Makefile

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

xsdtest.c

Trivial program which invokes the XML Schema for C API

car.{xsd,xml,std}

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

aq.{xsd,xml,std}

Second sample schema, instance document, and expected output respectively, after running xsdtest on them.

pub.{xsd,xml,std}

Third sample schema, instance document, and 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