cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarlath Lyons <jar.ly...@activeindexing.com>
Subject Short term fix for associating stylesheets with an XML document
Date Fri, 14 Apr 2000 13:45:28 GMT
The attached class should be of some use ....

I happen to be starting with a stream, so I use it like below ....

It's a rather simple api ... you create a Hashtable of lines you want to
add by
setting the Hashtable key to the destination line number.

To make it really flexible, you'd probably need to use a Vector instead
of a
Hashtable in order to insert multiple lines at 'line 1' .... but I want
higher performance ...
I don't want to be constantly scanning through all the Vector elements.
..../



----------

Hashtable styleSheetInfo = new Hashtable();

String styleSheet = ResourceBundle.....getString("stylesheet.vanilla");
...OR ...
String styleSheet = "<?xml-stylesheet
href=\"http://a.b.c/std/xsl/vanilla.xsl\"
type=\"text/xsl\"?>\n<?cocoon-process type=\"xslt\"?>";

//
// we want to add the stylesheet tags right after the first line ...
//
styleSheetInfo.put(new Integer(1),styleSheet);

FilterLineNumberReader flnr = new FilterLineNumberReader(new
InputStreamReader(... input stream ....),styleSheetInfo);


... read away .....




--
Jar Lyons
Senior Software Engineer
ActiveIndexing.com

jar.lyons@activeindexing.com
(206) 387-5117

100 West Harrison, Suite 310
Seattle, WA  98119



Mime
View raw message