You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Richard Hurt <rh...@thepoint.net> on 2000/09/07 14:45:59 UTC

xalan bug

I didn't know who to report this bug to.  The bug tracker is down and I
can't seem to get into any of the mailing lists.  So, I thought I would
send it to you.  Below is my USENET post.  You can view the threads
here:
http://www.deja.com/viewthread.xp?AN=665684111.1&search=thread&recnum=%3c8p3g70$64d$1@nnrp1.deja.com%3e%231/1&group=comp.lang.java.programmer&frpage=viewthread.xp

Thanx!
  Richard
=================================================

Hello,

 I am a Java novice attempting to port a Perl script I wrote to Java.
This program
 transforms XML to HTML via XSL.  I can't get the
 XMLProccessor to recognize my xml file.  It works from the xerces
command line,
 but it wont work from Java.  I know it's probably
 something stupid, Java just cant seem to find the file.  I even put
sanity checks in
 to check for canRead() on the File object.

 Arrrrgggghhh....  :/

 BTW: I am on WindowsNT 4.0(sp5) running Java 1.3.0.


 -------- Begin Version ---------
 >>>>>>> Xalan Version 1.2D02, XML4J Version Xerces 1.1.3<<<<<<<
 --------- End Version ----------


 -------- Begin output ---------
 c:\1.xml; Line 0; Column 0
 XSL Error: Could not parse c:\1.xml document!
 XSL Error: SAX Exception
 File "c:\1.xml" not found.
 ---------- End output ---------


 -------- Begin Java ---------
 import java.io.*;
 import java.util.*;
 import org.xml.sax.SAXException;
 import org.apache.xalan.xslt.*;

 public class xmltest {

 public static void main (String[] args) {
   try {
   SimpleTransform ("c:\\1.xml", "c:\\1.xsl", "c:\\1.html");
   }
   catch (IOException e) {
   System.out.println(e);
   }
   catch (org.xml.sax.SAXException e) {
   System.out.println(e);

   }
 }


 public static void SimpleTransform(String xmlSource, String
 xslSource, String outputURL)
   throws java.io.IOException,
   java.net.MalformedURLException,
   org.xml.sax.SAXException
 {
   // Have the XSLTProcessorFactory obtain a interface to a
   // new XSLTProcessor object.
   XSLTProcessor processor =
 XSLTProcessorFactory.getProcessor();

   // Have the XSLTProcessor processor object transform
   processor.process(new XSLTInputSource(xmlSource),
         new
 XSLTInputSource(xslSource),
         new
 XSLTResultTarget(outputURL));

 }
 }
 --------- End Java ----------

 --
 Thanx!
   Richard