mmidy 99/12/15 14:37:28
Modified: samples/pipe transform.java
Log:
fix pipe test
Revision Changes Path
1.4 +6 -29 xml-xalan/samples/pipe/transform.java
Index: transform.java
===================================================================
RCS file: /home/cvs/xml-xalan/samples/pipe/transform.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- transform.java 1999/12/14 15:08:18 1.3
+++ transform.java 1999/12/15 22:37:28 1.4
@@ -91,38 +91,15 @@
throws java.io.IOException,
java.net.MalformedURLException,
org.xml.sax.SAXException
- {
- String parserLiaisonClassName = Constants.LIAISON_CLASS;
- XMLParserLiaison xmlProcessorLiaison;
-
- try
- {
- Class parserLiaisonClass = Class.forName(parserLiaisonClassName);
- Constructor parserLiaisonCtor =
parserLiaisonClass.getConstructor(null);
- xmlProcessorLiaison
- = (XMLParserLiaison)parserLiaisonCtor.newInstance(null);
- }
- catch(Exception e)
- {
-
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ERROR0025, new
Object[] {parserLiaisonClassName})); //"Could not create XML Processor Liaison:
"+parserLiaisonClassName);
- return;
- }
-
- XSLTProcessor processor =
XSLTProcessorFactory.getProcessor(xmlProcessorLiaison);
+ {
+ XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
StylesheetRoot stylesheet = processor.processStylesheet("foo.xsl");
- XSLTProcessor processor2 =
XSLTProcessorFactory.getProcessor(xmlProcessorLiaison);
StylesheetRoot stylesheet2 = processor.processStylesheet("foo2.xsl");
-
- FileOutputStream outputStream = null;
-
- outputStream = new FileOutputStream("foo.out");
-
- processor.setDocumentHandler(new
StylesheetHandler((XSLTEngineImpl)processor2,stylesheet2));
- processor2.setOutputStream(System.out);
-
+
+ processor.setOutputStream(System.out);
- Node sourceTree = processor.getSourceTreeFromInput(new
XSLTInputSource("foo.xml"));
- stylesheet.process(processor, sourceTree, new
XSLTResultTarget(outputStream));
+ stylesheet.process(new XSLTInputSource("foo.xml"),
+ new XSLTResultTarget(processor));
}
}