cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cocoon Wiki] Update of "UseCocoonXMLSerializerCode" by AlexanderKlimetschek
Date Thu, 10 May 2007 10:36:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification.

The following page has been changed by AlexanderKlimetschek:
http://wiki.apache.org/cocoon/UseCocoonXMLSerializerCode

------------------------------------------------------------------------------
  #FORMAT Java
-     public static InputStream getInputStream(...my params...)
+     public InputStream getInputStream(...my params...)
              throws IOException, SourceNotFoundException {
  
          Serializer serializer = createSerializer();
@@ -23, +23 @@

          }
      }
      
-     private static Serializer createSerializer() {
+     private Serializer createSerializer() {
          // we use Cocoons XMLSerializer here which is configurable in terms
          // of the Transformer Implementation to use (some are buggy, so we
          // want to ensure which one is used)
@@ -35, +35 @@

          
          DefaultConfiguration serializerConfig = 
              new DefaultConfiguration("serializer", null);
-         serializerConfig.setAttribute("class", "org.apache.cocoon.serialization.XMLSerializer");
+ 
+         // here we use cocoon's serializer
+         serializerConfig.setAttribute("class",
+             "org.apache.cocoon.serialization.XMLSerializer");
+ 
-         serializerConfig.addChild(transformerConfig);
+         serializerConfig.addChild(transformerConfig);        
-         
          
          XMLSerializer serializer = new XMLSerializer();
          serializer.enableLogging(new NullLogger());

Mime
View raw message