[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Castor -> XSLT

Subject: Castor -> XSLT
From: Jason Russ <JRuss@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Oct 2000 10:56:10 -0400
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.