You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by di...@apache.org on 2001/01/04 17:03:12 UTC

cvs commit: xml-cocoon/src/org/apache/cocoon/xml/dom SVGBuilder.java

dims        01/01/04 08:03:10

  Modified:    lib      Tag: xml-cocoon2 batik-all.jar
               src/org/apache/cocoon/serialization Tag: xml-cocoon2
                        SVGSerializer.java
  Added:       src/org/apache/cocoon/xml/dom Tag: xml-cocoon2
                        SVGBuilder.java
  Log:
  Clean up SVG implementation.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1777 -1789xml-cocoon/lib/Attic/batik-all.jar
  
  	<<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.19  +2 -32     xml-cocoon/src/org/apache/cocoon/serialization/Attic/SVGSerializer.java
  
  Index: SVGSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/SVGSerializer.java,v
  retrieving revision 1.1.2.18
  retrieving revision 1.1.2.19
  diff -u -r1.1.2.18 -r1.1.2.19
  --- SVGSerializer.java	2001/01/03 13:49:00	1.1.2.18
  +++ SVGSerializer.java	2001/01/04 16:03:05	1.1.2.19
  @@ -32,7 +32,7 @@
   import java.io.ByteArrayInputStream;
   import java.io.ByteArrayOutputStream;
   
  -public class SVGSerializer extends DOMBuilder implements Composer, Serializer, Configurable {
  +public class SVGSerializer extends SVGBuilder implements Composer, Serializer, Configurable {
   
       /** The <code>ContentHandler</code> receiving SAX events. */
       private ContentHandler contentHandler=null;
  @@ -62,15 +62,6 @@
       public void configure(Configuration conf) throws ConfigurationException {
           this.config = conf;
   
  -        try {
  -            log.debug("Looking up " + Roles.PARSER);
  -            // First, get a DOM parser for the DOM Builder to work with.
  -            super.factory= (Parser) this.manager.lookup(Roles.PARSER);
  -        } catch (Exception e) {
  -            log.error("Could not find component", e);
  -            throw new ConfigurationException("Could not find Parser", e);
  -        }
  -
           mimetype = this.config.getAttribute("mime-type");
           log.debug("SVGSerializer mime-type:" + mimetype);
       }
  @@ -132,28 +123,7 @@
               transcoder.addTranscodingHint(
                           TranscodingHints.KEY_XML_PARSER_CLASSNAME,
   		                "org.apache.xerces.parsers.SAXParser");
  -
  -            // TODO: FIXME(DIMS) - batik is flaky in accepting DOM and don't 
  -            // support SAX yet. So we have to create a Byte Array as an input
  -            // stream for them.
  -            ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
  -            BufferedOutputStream ostream = new BufferedOutputStream(bytestream);
  -
  -            OutputFormat outformat = new OutputFormat();
  -            SerializerFactory serializerFactory = 
  -                        SerializerFactory.getSerializerFactory(Method.XML);
  -            org.apache.xml.serialize.Serializer serializer = 
  -                        serializerFactory.makeSerializer(outformat);
  -            serializer.setOutputByteStream(ostream);
  -            serializer.asDOMSerializer().serialize(doc);
  -
  -            // Use the Byte Array as the InputSource for the transcoder.
  -            InputSource inputSource = new InputSource(new ByteArrayInputStream
  -                                                        (bytestream.toByteArray()));
  -
  -            // TODO: FIXME(DIMS) - Why do they need a SystemId?
  -            inputSource.setSystemId("http://xml.apache.org");
  -            transcoder.transcodeToStream(inputSource,this.output);
  +            transcoder.transcodeToStream(doc,this.output);
   
               this.output.flush();
           } catch (Exception ex) {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +122 -0    xml-cocoon/src/org/apache/cocoon/xml/dom/Attic/SVGBuilder.java