ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Leuschner" <david.leusch...@comnet-solutions.de>
Subject bug-fix for XSLTProcess.java and XalanLiaison.java
Date Thu, 05 Oct 2000 17:15:46 GMT
Hi,

I had some problems using the <style> target with Xalan 1.2D02. First, the
filename for the stylesheet was changed so the path was duplicated
(c:\test\stylesheets\sheet.xsl -->
c:\test\stylesheets\c:\test\stylesheets\sheet.xsl) and second the
XSLTInputSource-Document was instanciated using a normal filename and not an
URI.
The fixes I applied can be found below.

Regards

	David

<---- XSLTProcess.java ---->
line 141: >>
	try {
	    // Create a new XSL processor with the specified stylesheet
	    if (xslFile != null) {
// why? --> String file = new File(baseDir,xslFile.toString()).toString();
		String file = xslFile.getAbsolutePath(); // <-- works using
getAbsolutePath()...
		log("Loading stylesheet " + file, Project.MSG_INFO);
                liaison.setStylesheet( file );
	    }
	} catch (Exception ex) {
	    log("Failed to read stylesheet " + xslFile, Project.MSG_INFO);
            throw new BuildException(ex);
	}

<---- XalanLiaison.java ---->
line 78: >>
    public void setStylesheet(String fileName) throws Exception {
      xslSheet = new XSLTInputSource (new
java.io.File(fileName).toURL().toString());
    };

    public void transform(String infile, String outfile) throws Exception {
      processor.process(new XSLTInputSource(new
java.io.File(infile).toURL().toString()), xslSheet,
                        new XSLTResultTarget(outfile));
    }


Mime
View raw message