[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Castor -> XSLT
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|