classgen.jar - old version?

A

Andy Carson

I'm trying to compile the snippet of code available from
http://www.oracle.com/technology//tech/xml/info/htdocs/otnwp/about_oracle_xml_products.htm
that's available below.

My problem is that the generator.generate(dtd, doctype_name); requires the
dtd to be of type oracle.xml.parser.v2.DTD whilst my dtd obviously is of
type oracle.xml.parser.DTD. Is there and old version of the
classgen.jar-file that supports the oracle.xml.parser.DTD type?

import java.io.*;
import java.net.*;

import oracle.xml.parser.*;
import oracle.xml.classgen.*;
import org.w3c.dom.Element;
import org.w3c.dom.DocumentType;
(...)

public static void main (String args[])
{
String dtdFile = "MyFile.dtd";
String rootName = "CompanyQuery";
try {
XMLParser parser = new XMLParser();
XMLDocument doc = parser.getDocument();
DocumentType type = doc.getDoctype();
NamedNodeMap nodeMap = type.getAttributes();
DTD dtd = (DTD) type;
String doctype_name = null;

doctype_name = doc.getDocumentElement().getTagName();
ClassGenerator generator = new ClassGenerator();
generator.setGenerateComments(true);
generator.setOutputDirectory(".");
generator.setValidationMode(true);

generator.generate(dtd, doctype_name);
}
catch (...){...}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,416
Messages
2,571,562
Members
48,797
Latest member
shadowoftheunknown

Latest Threads

Top