You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Callum Elliott <c....@student.lboro.ac.uk> on 2000/02/17 00:10:21 UTC
Compiling Problems
Hi,
Any ideas why this piece of code works
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
Reader styleReader = null;
Reader dataReader = null;
try {
styleReader = new
FileReader("e:\\javawebserver2.0\\meridian\\report\\InvoiceRegisterStandard.
xsl");
dataReader = new
FileReader("e:\\javawebserver2.0\\meridian\\report\\InvoiceRegisterTest.xml"
);
} catch (FileNotFoundException f) {
System.out.println("file not found");
}
XSLTInputSource styleSource = new XSLTInputSource(styleReader);
XSLTInputSource dataSource = new XSLTInputSource(dataReader);
XSLTResultTarget resultTarget = new XSLTResultTarget(out);
processor.process(dataSource, styleSource, resultTarget);
But when I try to process Documents instead of files, like this (data and
xsl are Documents passed to the function)
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
StringReader dataReader = new
StringReader(data.getDocumentElement().toString());
StringReader styleReader = new
StringReader(xsl.getDocumentElement().toString());
Document out = new org.apache.xerces.dom.DocumentImpl();
XSLTInputSource styleSource = new XSLTInputSource(styleReader);
XSLTInputSource dataSource = new XSLTInputSource(dataReader);
XSLTResultTarget resultTarget = new XSLTResultTarget(out);
processor.process(dataSource, styleSource, resultTarget);
I've got a feeling that is the data.getDocumentElement().toString());
TIA
Callum Elliott