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 (...){...}
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 (...){...}