You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Stefan Geelen <st...@xentri.com> on 2002/02/28 19:38:17 UTC
javax.xml.transform.TransformerException: java.io.IOException:
Hi,
I have a XML file that calls an XSL file for transforming to a new XML file:
In XML file:
<?xml version="1.0" encoding="UTF-16" standalone="no" ?>
<?xml-stylesheet href="invoices.xsl" type="text/xsl"?>
In XSL file:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" doctype-system="test.dtd" encoding="UTF-16"/>
Transforming on a Windows2000 or NT PC give no problems.
Converting on a Windows ME PC gives following error:
javax.xml.transform.TransformerException: java.io.IOException: The system cannot find the path specified.
Code extract where error occurs:
try { // Check if xml has link to stylesheet
System.err.println("Looking for XSL file...");
Source stylesheet = tFactory.getAssociatedStylesheet(new StreamSource(xmlfile),media, title, charset);
transformer = tFactory.newTransformer(stylesheet);
System.err.println("XSL Stylesheet found...");
try {
transformer.transform(source, new javax.xml.transform.sax.SAXResult(handler));
} catch (Exception e) { //Error in transforming
System.err.println("Error in transformer.transform method...");
System.err.println("source: "+source.toString());
}
} catch (Exception e) { //No stylesheet in xml
System.err.println("No XSL stylesheet found...");
transformer = tFactory.newTransformer();
transformer.transform(source, new javax.xml.transform.sax.SAXResult(handler));
}
Question is which path is being looked for ?
The .xml and .xsl files are in the same directory.
Regards,
Stefan