3 import java.io.InputStream;
4 import java.io.IOException;
5 import java.io.OutputStream;
6 import org.xml.sax.SAXException;
7 import com.icl.saxon.trax.Transformer;
8 import com.icl.saxon.trax.Templates;
9 import com.icl.saxon.trax.Result;
10 import com.icl.saxon.PreparedStyleSheet;
11 import org.xml.sax.InputSource;
14 * Title: XmlSaxonStyler
15 * Description: Implement XmlStyler
16 * Copyright: Copyright (c) 2001
22 public class XmlSaxonStyler implements XmlStyler{
24 private XmlSaxonStyler() {}
25 private static XmlSaxonStyler styler = new XmlSaxonStyler();
26 public static XmlSaxonStyler getInstance(){
30 public void style( String styleKey, InputStream is, OutputStream os )
33 Templates styleSheet = XslStyleCache.getPreparedStyleSheet( styleKey );
34 Transformer transformer = styleSheet.newTransformer();
35 transformer.transform( new InputSource( is ), new Result( os ) );
38 public void style( Transformer transformer, InputStream is, OutputStream os )
41 transformer.transform( new InputSource( is ), new Result( os ) );