The source for the test.class
package mypackage;
import java.io.*;
import java.util.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import oracle.xml.parser.v2.*;
import org.xml.sax.helpers.*;
import java.net.*;
import MyDocumentBuilder;
public class test
{
public test()
{
}
public void normalize(String user, String pass, String systemChoice) throws Exception
{
try {
SAXParser saxParser = new SAXParser();
MyDocumentBuilder docBuilder = new MyDocumentBuilder();
saxParser.setContentHandler(docBuilder);
saxParser.parse(fileNameToURL("C:/David/xml/test.xml"));
XMLDocument xdoc = docBuilder.getDocument();
PrintWriter out = new PrintWriter(new FileWriter("c:/David/xml/temp.xml"), true);
out.print("<?xml version='1.0' encoding='UTF-8'?>");
xdoc.print(out);
Document doc = parsing.parseXmlFile("c:/David/xml/temp.xml",false);
parsing.visit(doc, 0, user, pass, systemChoice);
}
catch (Exception ex) {
System.out.println("Caught an exception: \n" + ex);
}
}
public static URL fileNameToURL(String fileName) throws Exception
{
File file = new File(fileName);
String path = file.getAbsolutePath();
char fSep = file.separatorChar;
path = path.replace(fSep, '/');
if (path.length() > 0 && path.charAt(0) != '/')
path = '/' + path;
return new URL("file", null, path);
}
}
_______________________________________________
Tex