I tried this and still kept throwing back the same error to me.
So I took it out of tomcat and this is the code I have. I get another error and please have a look at the code and let me know where I am possibly wrong. I brief what I am trying to achieve is:

1. Sending input fields to a web site and getting results from it.
2. The HTML that I get back is converted to XHTML.
3. I am now applying an XSL (custom made for the HTML page), to parse it and bring it out. At the moment I am just attempting to get it back to the system display but later I would like to convert it to a text file.

So here is my code for the class that I have:
***************************
import java.net.*;
import java.io.*;
import org.w3c.tidy.*;
import javax.xml.parsers.*;
import javax.xml.*;
import org.xml.sax.SAXException;
import com.icl.saxon.expr.StringValue;
import org.apache.xerces.*;
import org.apache.xerces.jaxp.*;

/**
 * Title:        Harvester Web Interface
 * Description:
 * Copyright:    Copyright (c) 2002
 * Company:      Analytika
 * @author Prabhu Chandrasekhar
 * @version 1.0
 */

public class URLContact
{
  public URLContact()
  {
    try
    {
      System.out.println("I Am Here");
      URLReader();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
  public static void main(String args[])
  {
    System.out.println("Hello World");
    URLContact uc = new URLContact();
  }
  public void URLReader() throws Exception
  {
    String lastName = "Jones";
    String firstName = "Allen";
    URL myUrl = new URL("http://www.myurl.com");
    URLConnection myConn = myUrl.openConnection();
    Tidy tidy = new Tidy();

    myConn.setDoOutput(true);
    PrintWriter pw = new PrintWriter(myConn.getOutputStream());
    FileOutputStream out;
    BufferedInputStream in;
    pw.println("LASTNAME=" + lastName + "&FIRSTNAME=" + firstName );
    pw.close();

    tidy.setXHTML(true);
    try
    {
      tidy.setErrout(pw);
      in = new BufferedInputStream(myConn.getInputStream());
      out = new FileOutputStream("C:/test/test.xml");
      tidy.parse(in,out);
      tidy.setXmlTags(true);
      writeOut();
    }
    catch (IOException e)
    {
      System.out.println(this.toString() + e.toString());
    }
  }
  private void writeOut()
  {
    File xmlFile = new File("file:///C|/test/test.xml");
    File xsltFile= new File("file:///C|/test/xsl/OK.xsl");

    //javax.xml.parsers.SAXParserFactory spf = javax.xml.parsers.SAXParserFactory.newInstance();
    //spf.setNamespaceAware(true);
    javax.xml.transform.Source xmlSource =
      new javax.xml.transform.stream.StreamSource(xmlFile);
    javax.xml.transform.Source xsltSource =
      new javax.xml.transform.stream.StreamSource(xsltFile);
    javax.xml.transform.Result result =
      new javax.xml.transform.stream.StreamResult (System.out);

    javax.xml.transform.TransformerFactory transFact =
      javax.xml.transform.TransformerFactory.newInstance();
    try
    {
      //System.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl");
      //System.setProperty("org.xml.sax.parser","org.apache.xerces.parsers.SAXParser");
      //System.out.println(System.getProperty("javax.xml.parsers.SAXParserFactory"));
      System.out.println(xsltSource);
      javax.xml.transform.Transformer trans =
        transFact.newTransformer(xsltSource);

      trans.transform(xmlSource, result);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}
*****************************
The stack trace I get is:
javax.xml.transform.TransformerConfigurationException: no more input   
at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java:123)       
at com.icl.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:127)  
at com.icl.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:79) 
at com.analytika.harvester.classes.URLContact.writeOut(URLContact.java:105)    
at com.analytika.harvester.classes.URLContact.URLReader(URLContact.java:76)    
at com.analytika.harvester.classes.URLContact.<init>(URLContact.java:29)       
at com.analytika.harvester.classes.URLContact.main(URLContact.java:39)
---------
java.io.EOFException: no more input    
at com.icl.saxon.aelfred.XmlParser.popInput(XmlParser.java:4076)       
at com.icl.saxon.aelfred.XmlParser.pushURL(XmlParser.java:3613)        
at com.icl.saxon.aelfred.XmlParser.doParse(XmlParser.java:159) 
at com.icl.saxon.aelfred.SAXDriver.parse(SAXDriver.java:320)   
at com.icl.saxon.om.Builder.build(Builder.java:258)    
at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java:113)       
at com.icl.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:127)  
at com.icl.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:79) 
at com.analytika.harvester.classes.URLContact.writeOut(URLContact.java:105)    
at com.analytika.harvester.classes.URLContact.URLReader(URLContact.java:76)    
at com.analytika.harvester.classes.URLContact.<init>(URLContact.java:29)       
at com.analytika.harvester.classes.URLContact.main(URLContact.java:39)
**********************************
Any suggestions or thoughts on this and am I missing something?

Prabhu Chandrasekhar
--------------------------------------------
FROM: Daniel ParkerDATE: 02/05/2002 20:52:27SUBJECT: RE:  [saxon] java.Lang.NoSuchMethodError This is a multi-part message in MIME format.

Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

java.Lang.NoSuchMethodErrorWhich version of tomcat are you using?  It =
sounds like you're using 3.x. =20

I recall the "java.lang.NoSuchMethodError" and finally got saxon to work =
with tomcat 3.x by applying the following steps:

(1.)  Delete jaxp.jar and parser.jar in the tomcat lib directory, =
replace them with xerces.jar.

(2.)  Modify the config file workers.properties, replacing

worker.inprocess.class_path=3D$(workers.tomcat_home)$(ps)lib$(ps)jaxp.jar=

worker.inprocess.class_path=3D$(workers.tomcat_home)$(ps)lib$(ps)parser.j=
ar

with

worker.inprocess.class_path=3D$(workers.tomcat_home)$(ps)lib$(ps)xerces.j=
ar

The cocoon installation instructions also have some comments on this =
matter (for tomcat 3.x) which you might find interesting,

http://xml.apache.org/cocoon/installing/index.html

With tomcat 4.x, things become simpler, but this version of tomcat uses =
the jaxp sax parser factory.  Moreover, this version of tomcat requires =
a validating parser, and it doesn't check whether the parser actually is =
validating.  If the AElfred parser is supplied in the system properties, =
an exception will be thrown when tomcat attempts to set validating on.

I'd recommend using the (validating) xerces 1.4.4 sax parser rather than =
AElfred parser.  It's not safe to rely on the default parser, by not =
setting system properties, because it's very likely there are several =
versions of the JAXP classes in the classpath, and who knows when you =
might get another one.  The practice by the distributors of XML tools to =
include implementations of the JAXP classes in their own jar files is, =
of course, rather insane, but that's the way it is.

Do this,

System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");=20

but also do this

System.setProperty("org.xml.parsers.sax.parser",
"org.apache.xerces.parsers.SAXParser");=20

since many third party tools base the parser choice on =
"org.xml.parsers.sax.parser" rather than use the SAXParserFactory.

Regards,
Daniel Parker
http://presentingxml.sourceforge.net/