Oracle XML Class Generator for Java
Release Notes for Version 9.2.0.6.0 (Production)
Contents
Release 9.2.0.6.0 (Prod)
Overview
Features
Bugs Fixed
Demos
API
Documentation
Previous Releases
Release 9.2.0.4.0
Release 9.2.0.3.0
Release 9.2.0.2.0
Release 9.0.2.0.0D
Release 9.0.2.0.0C
Release 9.0.2.0.0B
Release 9.0.2.0.0A
Release 9.0.0.0.0
Release 2.0.0.0.0
Release 1.0.1.0.0
Release 1.0.0.1.0
Release 1.0.0.0.0
Overview
Oracle XML Class Generator for Java creates java class source
files from an XML DTD or Schema. The generated classes can be used
programmatically to construct XML documents.
The Oracle XML Class Generator requires Oracle XML Parser and Oracle
Schema
Parser.
The Class Generator consists of DTD Class Generator and the Schema
Class
Generator which could be invoked from a command line utility called
oracg. Depending on the input argument, the oracg utility generates
the
java classes using the DTD Class Generator or Schema Class Generator
The various input arguments supported are:
| -help |
Prints the help message text |
| -version |
Prints the release version |
| -dtd [-root <rootName>] <DTD File> |
The input file is a DTD file or DTD based XML file |
| -schema <Schema File> |
The input file is a schema file or schema based XML file |
| -outputDir <Output Dir> |
The directory name where the java source is generated |
| -package <Package Name> |
The package name(s) of the generated java classes |
| -comment |
Generate comments for the generated java source |
Please post any questions, comments, or bug reports to the XML Forum
on the Oracle Technology Network at http://technet.oracle.com.
Features
Features of DTD Class Generator
The DTD Class Generator supports the following features:
-
Creates XML documents compliant with the W3C XML 1.0 Recommendation
-
Supports creation and printing of XML documents with the character
encodings supported by Oracle XML Parser.
-
Validates the XML document generated by the DTD Class Generator.
-
Optionally generates javadoc comments on the generated source files.
-
Support data binding feature. An XML instance document could be given
as input to load the instance data to the generated classes.
-
Set/Get methods are added corresponding to the child nodes of an element
and the addNode method is deprecated.
Features of Schema Class Generator
The Schema Class Generator generates a java class corresponding
to each top
level element (global element), top level simpleType element and
complexType element and top level attributes. All the generated
classes
extends the base class CGXSDElement which actually stores information
about
the child elements and attributes pertaining to the java object
corresponing to the element.
The type hierarchy among the elments and simpleType/complexType
elements
is maintained in the generated class. If the top level complexType/simpleType
element extends another complexType/simpleType element, then the
class
corresponding to them will extend the class correspondig to the
base type
simpleType or complexType element. Otherwise, they extend CGXSDElement
class.
Namespace issue
-
The java classes are generated in a package for each namespace. If
there is no namespace defined, then the classes are generated in the default
package.
-
If there is a namespace defined then the user need to specify the package
name through the command line utiltiy. The number of packages specified
should match the command line arguments else an error is thrown. The packages
are created in the directory specified by the packge name. For example
if the package name is given as "package1" corresponding to the namespace
"ns1" then the java classes corresponding to the elements, attributes and
types belonging to the namespace "ns1" will be generated in the package
"package1".
-
There is a single distinct symbol space within a given target namespace
for each kind of definition and declaration component identified in XML
Schema, except that within a target namespace, simple type definitions
and complex type definitions share a symbol space. Within a given symbol
space, names are unique, but the same name may appear in more than one
symbol space without conflict. For example, the same name can appear in
both a type definition and an element declaration, without conflict or
necessary relation between the two. -
The name clash between the classes generated for the components
of different symbol space is taken care in the following manner:
- the classes corresponding to all top level attributes are generated
in a directory called "attributes" inside the package.
- the classes corresponding to all the top level types i.e simpleType
and complexType are generated in a directory called "types".
Details about classes generated for top level element
-
A class corresponding to the element name is generated in the package
associated with the namespace.
-
The element has a method called setType to set the type of the element
in the element class. The setType should takes fully resolved pacakge name
to avoid conflict.
-
If the element has inline simpleType or complexType, a public static
class inside the element class is created which follows all the rules specified
in the simpleType/complexType. The name of the public static class is Element
name suffixed by Type. e.g if the element name is PurchaseOrder which has
an inline complexType definition, then the public static inner class will
have the name PurchaseOrder_Type
-
The element "name" and "namespace" is stored inside the element class
(which could be used for serialization & validation )
-
A validate method is provided inside the elements to accept an XMLSchema
object to validate.
-
A print method is provided inside the element to print the node.
ComplexType Element
-
If the complexType element is a top level element, then a class is
generted inside the directory "types" in the package assoicated with the
namespace of the compelxType element. If the complexType element extends
a base type element, then the class corresponding to the complexType
element also extends the base Type element. Otherwise, it extends the CGXSDElement
class.
-
If not top level, see element rules for collapsing type into the element
defining it (create an inner class inside the element).
-
The name and namespace of the complexType element is stored in local
variables called "name" and "namespace".
-
The class contains fields corresponding to the attributes. The fields
are made protected, so that they can be accessed from subtypes. To avoid
conflict between the variables corresponding the attributes and the attribute
stored by the Schema Classgenerator itself (like "name" and "namespace"),
all the local variables corresponding to the attributes are prefixed by
"a". For example, if an attribute "name" is present in the complexType
element, then the variable corresponding to that will be "aname".
i.e <attribute name="name" type="string"/> will translate into a local
variable String aname;
-
The fields are added only for the attributes that are not present in
the base type. To avoid conflict between the
-
The class contains methods to set and get attributes.
-
Generate methods to add the local element.
-
Generate method to get all the child elements - getChildElements()
: This function will return a vector of all the child elements.
Details about classes generated for top level SimpleType
Element
-
A class is generated for each top level simpleType element inside the
direcotry called "types" in the package associated with the namespace of
the simpleType element.
-
The hierarchy of the simpleType element is maintained in the generated
class. If the simpleType element extends a base class then the class corresponding
to the simpleType element also extends the base class corresponding to
the base element. Otherwise the simpleType element extends the CGXSDElement
class.
-
The class contains a field to store the simpleType value.
-
The constructor of the simpleType element class sets the schema facets
The constructor sets the simpleType data value (XSDDataValue) in
the constructor after validating against the facets.
Bugs Fixed
Release 9.2.0.4.0
Bugs Fixed
Release 9.2.0.3.0
July 23, 2002
Bugs Fixed
Release 9.2.0.2.0
February 1, 2002
Bugs Fixed
Release 9.0.2.0.0D
Dec 1, 2001
Bugs Fixed
-
Bug #2038949: NO NAMESPACE CHOICE IF THE XML SCHEMA DON'T HAVE TARGET
NAMESPACE
Release 9.0.2.0.0C
Oct 1, 2001
New Features
-
Data Binding Feature is added in this release to the DTD Class Generator.
An XML instance document could be given as input to load the instance data
to the generated classes.
-
Set/Get methods are added corresponding to the child nodes of an element
and the addNode method is deprecated.
Bugs Fixed
-
Bug #1980263: JAVA.LANG.NULLPOINTEREXCEPTION ERROR DURING CLASS GENERATION
Release 9.0.2.0.0B
Aug 1, 2001
Bugs Fixed
-
Bug #1824085: No -root element api for oracg
Release 9.0.2.0.0A
June 15, 2001
Bugs Fixed
-
Bug #1711683: NULLPOINTEREXCEPTION TRYING WSDL 1.1 XML SCHEMA
Release 9.0.0.0.0
Jan 25, 2001
Release 2.0.0.0.0
October 12, 2000
New features
-
A command line utility called oracg is included to invoke the DTD and
Schema Class generator to generateclasses based on DTD and Schema respectively.
-
This release includes Schema Class Generator (Beta version) based
on Schema Specification (W3CWorking Draft 22 September 2000)
Bugs fixed
-
Bug# 1410656 :The generated files searches the java CLASSPATH
to locate and load the DTD file.
Release 1.0.2.0.0
May 18, 2000
Bugs fixed
-
Bug #1179636 - Add support for adding CData Section Bug fix for
-
Bug #1305125 - Cannot insatiate multiple document classes
Release 1.0.1.0.0
September 30, 1999
This release of XML Class Generator requires XML Parser Version
2.
NOTE: See v2changes.txt and the .diff difference files in the sample
directory for changes required to use XML Parser Version 2
Bugs Fixed
-
Bug #959042: Fixed the default encoding of XML output;
-
Bug #959057: validateContent function need to throw InvalidContentException
This is the first production release.
Release 1.0.0.1.0
April 9, 1999
Bugs Fixed
-
Bug #860168 to handled DTD having Java keywords as attributes. Added
functionality to serialize the DTD, instead of re-parsing the text DTD.
Release 1.0.0.0.0
January 15, 1999
The Oracle XML Class Generator, written in Java, will generate a
set of Java source files based on an input DTD. The generated Java source
files can then be used to construct, optionally validate, and print a XML
document that is compliant to the DTD specified. This is an early beta
release.
The licensing agreement is found in LICENSE. The XML Class
Generator is currently available only for testing purposes. We expect
to make it available for commercial use in the future.
Please post any questions, comments, or bug reports to the XML Forum
on the Oracle Technology Network at http://technet.oracle.com
The Oracle XML Class Generator requires Oracle XML Parser. The XML
Document, printed by the generated classes, confirms to the W3C recommendation
for Extensible Markup Language (XML) 1.0.
The Oracle XML Class Generator can optionally generate validating
Java source files. It also optionally generates Javadoc comments in the
source files.
The Oracle XML Class Generator supports the following encodings
for printing the XMLDocument: UTF-8, UTF-16, ISO-10646-UCS-2, ISO-10646-UCS-4,
US-ASCII, EBCDIC-CP-US, ISO-8859-1, andShift_SJIS. ASCII is
the default encoding if none is specified. Any other ASCII or EBCDIC
based encodings that are supported by the JDK may be used.