This chapter contains these topics:
Note:Use the new unified C++ API in
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.
The XML Schema processor for C++ supports the W3C XML Schema Recommendation. This makes writing custom applications that process XML documents straightforward, and means that a standards-compliant XML Schema processor is part of the XDK on each operating system where Oracle is ported.
XML Schema processor for C++ has the following features:
Supports simple and complex types
Built upon the XML parser for C++
Supports the W3C XML Schema Recommendation
The XML Schema processor for C++ class is
See Also:Oracle Database XML C++ API Reference schema validator interface
SchemaValidator is an abstract template class to handle XML schema-based validation of XML documents.
The XML Schema processor for C++ can be called as an executable by invoking
bin/schema in the install area. This takes the arguments:
XML instance document
Optionally, a default schema
Optionally, the working directory
Table 23-1 lists the options (can be listed if the option is invalid or -h is the option):
||Always exit with code 0 (success).|
||Specify default input file encoding.|
||Specify output/data/presentation encoding.|
||Help. Prints these choices.|
||Ignore provided schema.|
||Print document instance to
||Force the Unicode path.|
||Version - display version, then exit.|
The XML Schema processor for C++ 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 M
Make.bat in the
xdk/demo/cpp/schema directory for details on how to build your program.
Error message files in different languages are provided in the
xdk/demo/cpp/schema contains a sample application that illustrates how to use Oracle XML Schema processor for C++ with its API. Table 23-2 lists the sample files provided.
||Makefile to build the sample programs and run them, verifying correct output.|
||Trivial program which invokes the XML Schema for C++ API|
||Sample schema, instance document, expected output respectively, after running
||Second sample schema's, instance document, expected output respectively, after running
||Third sample schema's, instance document, expected output respectively, after running
To build the sample programs, run
To build the programs and run them, comparing the actual output to expected output: