This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Castor -> XSLT
- To: XSL-List at mulberrytech dot com
- Subject: Castor -> XSLT
- From: Jason Russ <JRuss at Korson-McGregor dot com>
- Date: Thu, 26 Oct 2000 10:56:10 -0400
- Organization: Korson-McGregor
- Reply-To: xsl-list at mulberrytech dot com
Can someone please tell me how one
would go about piping the output of castor
to an XSLT processor (specifically Xalan)?
I have been trying many ways do this in
the last day but to no avail. Here is my
latest attempt.
public void run() throws Exception {
Iterator iter =
CoreCentral.instance().getContactSet().iterator();
// create XSLT Engine
// Have the XSLTProcessorFactory obtain a interface to a
// new XSLTProcessor object.
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
// create and set the stylesheet to be used
StylesheetRoot stylesheet =
processor.processStylesheet("contacts-html.xsl");
processor.setStylesheet(stylesheet);
// create and set the document handler for the XSLT Engine
org.xml.sax.DocumentHandler dh =
sylesheet.getSAXSerializer(System.out);
processor.setDocumentHandler(dh);
// Create a File to marshal to
// create a Castor marshaller and send the output to the XSLT
Engine
Marshaller marshaller = new Marshaller(processor);
marshaller.setMarshalAsDocument(true);
while (iter.hasNext()) {
Object o = iter.next();
// Marshal the contact object
try{
marshaller.marshal(o);
}
catch(MarshalException e){
e.printStackTrace();
}
catch(ValidationException e){
e.printStackTrace();
}
}
}
--
Jason L. Russ
Software Consultant
Korson-McGregor, A Software Technology Company
(Formerly known as Software Architects)
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list