Sorry, missed the subject in the first one (difficult to track different
threads without subjects)...
Here we go again:

Well, trying to figure out what is going on in the CocoonRenderer
class...
I don't quite understand what is the goal of all this... Messing around
with PIs, but for what?
bos is created, but no content is ever written to it and then it calls
bos.toString in the end???

I'm confused... Kevin, can you explain what is going on here? You wrote
this, didn't you?

Thanks...
Neeme

    public static String transform( String url,
                                    String stylesheet,
                                    RunData rundata ) throws Exception {


        ByteArrayOutputStream bos= new ByteArrayOutputStream();

        String stylesheet_pi = "<?xml-stylesheet href=\"" + stylesheet +
"\" type=\"text/xsl\"?>";

        SAXPIFilter filter = new SAXPIFilter( new PrintWriter(bos), true
);
        String fileURL = JetspeedDiskCache.getInstance().getEntry( url
).getURL();
        filter.print( fileURL );

        // strip "file://"
        File file = new File ( fileURL.substring(7,fileURL.length()));
        String fileName = file.getCanonicalPath();

        //now add the stylesheet and cocoon pi(s) to this document

        StringBuffer pis = new StringBuffer();


        String[] allowed_pis = filter.getProcessingInstructions();

        for (int i = 0; i < allowed_pis.length; ++i) {
            pis.append( allowed_pis[i] + "\n" );
        }

        pis.append( stylesheet_pi + "\n");

        StringBuffer content = new StringBuffer();

        //place all the processing instructions into the content
        content.append( pis.toString() );

        //place the filtered content into the global content
        content.append( bos.toString() );


        return transformContent( fileName, content.toString(), rundata
);

    }


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to