cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r491639 - in /cocoon/trunk/core/cocoon-pipeline: cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/ cocoon-pipeline-components/src/main/resources/META-INF/cocoon/spring/ cocoon-pipeline-impl/src/main/java/org/apache/c...
Date Mon, 01 Jan 2007 21:41:03 GMT
Author: danielf
Date: Mon Jan  1 13:41:02 2007
New Revision: 491639

URL: http://svn.apache.org/viewvc?view=rev&rev=491639
Log:
Refactoring of AbstractTextSerializer to make the extending serializers HTMLSerializer, TextSerializer
and XMLSerializer POJOs. The Avalon functionality is kept for backward compatibility. There
is also a (deactivated) Spring configuration file that not is complete yet as we still have
to find a way for handling the mime settings for sitemap components.
I have only been able to do limited testing of the new functionality as the mime type handling
not work yet while configuring the serializers as Spring beans. But they at least seem to
be set up correctly.

Added:
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/resources/META-INF/cocoon/spring/cocoon-core-serializers.notyet
Modified:
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/HTMLSerializer.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/TextSerializer.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/XMLSerializer.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/serialization/AbstractTextSerializer.java

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/HTMLSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/HTMLSerializer.java?view=diff&rev=491639&r1=491638&r2=491639
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/HTMLSerializer.java
(original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/HTMLSerializer.java
Mon Jan  1 13:41:02 2007
@@ -44,6 +44,14 @@
  */
 
 public class HTMLSerializer extends AbstractTextSerializer {
+    
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.serialization.AbstractTextSerializer#init()
+     */
+    public void init() throws Exception {
+        super.init();
+        this.format.put(OutputKeys.METHOD,"html");        
+    }
 
     /**
      * Set the configurations for this serializer.

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/TextSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/TextSerializer.java?view=diff&rev=491639&r1=491638&r2=491639
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/TextSerializer.java
(original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/TextSerializer.java
Mon Jan  1 13:41:02 2007
@@ -52,6 +52,15 @@
      * Set to true after first XML element
      */
     private boolean hadNoRootElement;
+    
+    
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.serialization.AbstractTextSerializer#init()
+     */
+    public void init() throws Exception {
+        super.init();
+        this.format.put(OutputKeys.METHOD, "text");
+    }
 
     /**
      * Set the configurations for this serializer.

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/XMLSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/XMLSerializer.java?view=diff&rev=491639&r1=491638&r2=491639
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/XMLSerializer.java
(original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/serialization/XMLSerializer.java
Mon Jan  1 13:41:02 2007
@@ -33,6 +33,14 @@
 
 public class XMLSerializer extends AbstractTextSerializer {
 
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.serialization.AbstractTextSerializer#init()
+     */
+    public void init() throws Exception {
+        super.init();
+        this.format.put(OutputKeys.METHOD,"xml");
+    }
+
     /**
      * Set the configurations for this serializer.
      */

Added: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/resources/META-INF/cocoon/spring/cocoon-core-serializers.notyet
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/resources/META-INF/cocoon/spring/cocoon-core-serializers.notyet?view=auto&rev=491639
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/resources/META-INF/cocoon/spring/cocoon-core-serializers.notyet
(added)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-components/src/main/resources/META-INF/cocoon/spring/cocoon-core-serializers.notyet
Mon Jan  1 13:41:02 2007
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
+    "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- @version $Id$ -->
+
+<!--+
+    | Serializers consume SAX events and produce a character stream. Every
+    | pipeline needs to be terminated by a serializer.
+    |
+    | FIXME: this configuration file is not complete yet, it still lacks a mechanism for
+    | setting the mime-type of the serializers.
+    +-->
+<beans default-init-method="init">
+
+  <!-- Abstract parent bean that sets the default encoding from the settings bean -->
+  <bean name="org.apache.cocoon.serialization.AbstractTextSerializer" class="org.apache.cocoon.serialization.AbstractTextSerializer"
abstract="true">
+    <property name="defaultEncoding">
+      <bean class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
+        <property name="targetBeanName" value="org.apache.cocoon.configuration.Settings"/>
+        <property name="propertyPath" value="containerEncoding"/>
+      </bean>
+    </property>
+  </bean>
+
+  <!-- mime-type="text/xml" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/xml" class="org.apache.cocoon.serialization.XMLSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer"/>
+
+  <!-- mime-type="text/html" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/html" class="org.apache.cocoon.serialization.HTMLSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer">
+	<property name="format">
+	  <props>
+	    <prop key="doctype-public">-//W3C//DTD HTML 4.01 Transitional//EN</prop>
+	    <prop key="doctype-system">http://www.w3.org/TR/html4/loose.dtd</prop>
+	  </props>
+	</property>
+  </bean>
+
+  <!-- mime-type="text/vnd.wap.wml" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/wml" class="org.apache.cocoon.serialization.XMLSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer">
+	<property name="format">
+	  <props>
+	    <prop key="doctype-public">-//WAPFORUM//DTD WML 1.1//EN</prop>
+	    <prop key="doctype-system">http://www.wapforum.org/DTD/wml_1.1.xml</prop>
+	    <prop key="encoding">ASCII</prop>
+	    <prop key="omit-xml-declaration">yes</prop>
+	  </props>
+	</property>
+  </bean>
+
+  <!--+
+      | Compact HTML for Small Information Appliances,
+      | based on http://www.w3.org/TR/1998/NOTE-compactHTML-19980209/
+      + -->
+  <!-- mime-type="text/html" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/chtml" class="org.apache.cocoon.serialization.HTMLSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer">
+	<property name="format">
+	  <props>
+	    <prop key="doctype-public">-//W3C//DTD Compact HTML 1.0 Draft//EN</prop>
+	  </props>
+	</property>
+  </bean>
+
+  <!-- mime-type="image/svg+xml" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/svgxml" class="org.apache.cocoon.serialization.XMLSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer">
+	<property name="format">
+	  <props>
+	    <prop key="doctype-public">-//W3C//DTD SVG 1.0//EN</prop>
+	    <prop key="doctype-system">http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd</prop>
+	  </props>
+	</property>
+  </bean>
+
+  <!--+
+      | You can choose from Strict, Transitional, or Frameset XHTML.
+      | For Strict XHTML set doctype to:
+      |   <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
+      |   <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
+      | For Transitional XHTML set doctype to:
+      |   <doctype-public>-//W3C//DTD XHTML 1.0 Transitional//EN</doctype-public>
+      |   <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doctype-system>
+      | For Frameset XHTML set doctype to:
+      |   <doctype-public>-//W3C//DTD XHTML 1.0 Frameset//EN</doctype-public>
+      |   <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</doctype-system>
+      |
+      | Default XHTML doctype in Cocoon is XHTML Strict. If you want to use more than one
+      | XHTML DTD simultaneously, you can define several XHTML serializers.
+      +-->
+  <!-- mime-type="text/html" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/xhtml" class="org.apache.cocoon.serialization.XMLSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer">
+	<property name="format">
+	  <props>
+	    <prop key="doctype-public">-//W3C//DTD XHTML 1.0 Strict//EN</prop>
+	    <prop key="doctype-system">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</prop>
+	    <prop key="encoding">UTF-8</prop>
+	  </props>
+	</property>
+  </bean>
+
+  <!-- mime-type="application/xhtml+xml" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/xhtml11" class="org.apache.cocoon.serialization.XMLSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer">
+	<property name="format">
+	  <props>
+	    <prop key="doctype-public">-//W3C//DTD XHTML 1.1//EN</prop>
+	    <prop key="doctype-system">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</prop>
+	    <prop key="encoding">UTF-8</prop>
+	  </props>
+	</property>
+  </bean>
+
+  <!-- mime-type="text/plain" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/text" class="org.apache.cocoon.serialization.TextSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer"/>
+
+  <!-- mime-type="model/vrml" -->
+  <bean name="org.apache.cocoon.serialization.Serializer/vrml" class="org.apache.cocoon.serialization.TextSerializer"
+        scope="prototype" parent="org.apache.cocoon.serialization.AbstractTextSerializer"/>
+</beans>
\ No newline at end of file

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/serialization/AbstractTextSerializer.java?view=diff&rev=491639&r1=491638&r2=491639
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
(original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
Mon Jan  1 13:41:02 2007
@@ -27,11 +27,14 @@
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.util.TraxErrorHandler;
+import org.apache.cocoon.util.avalon.CLLoggerWrapper;
 import org.apache.cocoon.xml.AbstractXMLPipe;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.apache.cocoon.xml.XMLUtils;
 
 import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.NOPValidity;
 import org.xml.sax.Attributes;
@@ -43,6 +46,7 @@
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactoryConfigurationError;
 import javax.xml.transform.sax.SAXTransformerFactory;
 import javax.xml.transform.sax.TransformerHandler;
 import javax.xml.transform.stream.StreamResult;
@@ -58,6 +62,9 @@
  */
 public abstract class AbstractTextSerializer extends AbstractSerializer
         implements Configurable, Serviceable, CacheableProcessingComponent {
+    
+    /** The default logger for this class. */
+    private Log logger = LogFactory.getLog(getClass());
 
     /**
      * Cache for avoiding unnecessary checks of namespaces abilities.
@@ -73,7 +80,7 @@
     /**
      * The <code>Properties</code> used by this serializer.
      */
-    protected final Properties format = new Properties();
+    protected Properties format = new Properties();
 
     /**
      * The pipe that adds namespaces as xmlns attributes.
@@ -83,7 +90,57 @@
     /**
      * The caching key
      */
-    private String cachingKey = "1";
+    private String cachingKey;
+
+    private String transformerFactoryClass;
+    
+    private String defaultEncoding = null;
+
+    /**
+     * Set the properties used for transformer handler used by the serializer
+     * see {@link OutputKeys} for possible settings.
+     * 
+     * @param format
+     */
+    public void setFormat(Properties format) {
+        this.format = format;
+    }
+
+    /**
+     * Set the default encoding. This will be overided if the encoding is set
+     * in the format properties. This is mainly useful together with Spring
+     * bean inheritance.
+     * 
+     * @param defaultEncoding
+     */
+    public void setDefaultEncoding(String defaultEncoding) {
+        this.defaultEncoding = defaultEncoding;
+    }
+
+    /**
+     * Initialize logger, caching key, transformer handler and namespace pipe
+     *
+     * @throws Exception 
+     */
+    public void init() throws Exception {
+        this.enableLogging(new CLLoggerWrapper(this.logger));
+        if (!this.format.containsKey(OutputKeys.ENCODING) && this.defaultEncoding
!= null)
+            this.format.put(OutputKeys.ENCODING, this.defaultEncoding);
+        this.cachingKey = createCachingKey(format);
+        this.initTransformerFactory();
+        this.initNamespacePipe();
+    }
+
+    /**
+     * Optionally set the transformer factory used for creating the transformer
+     * handler that is used for serialization. Otherwise the standard transformer
+     * factory is used ({@link TransformerFactory}).
+     * 
+     * @param transformerFactoryClass the name of the class
+     */
+    public void setTransformerFactory(String transformerFactoryClass) {
+        this.transformerFactoryClass = transformerFactoryClass;
+    }
 
     /**
      * Interpose namespace pipe if needed.
@@ -156,6 +213,8 @@
 
     /**
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+     * 
+     * @deprecated use property injection instead
      */
     public void service(ServiceManager manager) throws ServiceException {
         final Settings settings = (Settings)manager.lookup(Settings.ROLE);
@@ -168,6 +227,8 @@
 
     /**
      * Set the configurations for this serializer.
+     * 
+     * @deprecated use property injection instead
      */
     public void configure(Configuration conf) throws ConfigurationException {
         // configure buffer size
@@ -187,69 +248,75 @@
         String standAlone = conf.getChild("standalone").getValue(null);
         String version = conf.getChild("version").getValue(null);
 
-        final StringBuffer buffer = new StringBuffer();
-
         if (cdataSectionElements != null) {
             format.put(OutputKeys.CDATA_SECTION_ELEMENTS, cdataSectionElements);
-            buffer.append(";cdata-section-elements=").append(cdataSectionElements);
         }
         if (dtPublic != null) {
             format.put(OutputKeys.DOCTYPE_PUBLIC, dtPublic);
-            buffer.append(";doctype-public=").append(dtPublic);
         }
         if (dtSystem != null) {
             format.put(OutputKeys.DOCTYPE_SYSTEM, dtSystem);
-            buffer.append(";doctype-system=").append(dtSystem);
         }
         if (encoding != null) {
             format.put(OutputKeys.ENCODING, encoding);
-            buffer.append(";encoding=").append(encoding);
         }
         if (indent != null) {
             format.put(OutputKeys.INDENT, indent);
-            buffer.append(";indent=").append(indent);
         }
         if (mediaType != null) {
             format.put(OutputKeys.MEDIA_TYPE, mediaType);
-            buffer.append(";media-type=").append(mediaType);
         }
         if (method != null) {
             format.put(OutputKeys.METHOD, method);
-            buffer.append(";method=").append(method);
         }
         if (omitXMLDeclaration != null) {
             format.put(OutputKeys.OMIT_XML_DECLARATION, omitXMLDeclaration);
-            buffer.append(";omit-xml-declaration=").append(omitXMLDeclaration);
         }
         if (standAlone != null) {
             format.put(OutputKeys.STANDALONE, standAlone);
-            buffer.append(";standalone=").append(standAlone);
         }
         if (version != null) {
             format.put(OutputKeys.VERSION, version);
-            buffer.append(";version=").append(version);
         }
 
-        if ( buffer.length() > 0 ) {
-            this.cachingKey = buffer.toString();
+        this.cachingKey = createCachingKey(format);
+
+        this.transformerFactoryClass = conf.getChild("transformer-factory").getValue(null);
+        this.initTransformerFactory();
+
+        this.initNamespacePipe();
+
+    }
+
+    /**
+     * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
+     */
+    public void recycle() {
+        super.recycle();
+    
+        if (this.namespacePipe != null) {
+            this.namespacePipe.recycle();
         }
-        
-        String tFactoryClass = conf.getChild("transformer-factory").getValue(null);
-        if (tFactoryClass != null) {
+    }
+
+    private void initTransformerFactory() throws ConfigurationException, TransformerFactoryConfigurationError
{
+        if (transformerFactoryClass != null) {
             try {
-                this.tfactory = (SAXTransformerFactory) ClassUtils.newInstance(tFactoryClass);
+                this.tfactory = (SAXTransformerFactory) ClassUtils.newInstance(transformerFactoryClass);
                 if (getLogger().isDebugEnabled()) {
-                    getLogger().debug("Using transformer factory " + tFactoryClass);
+                    getLogger().debug("Using transformer factory " + transformerFactoryClass);
                 }
             } catch (Exception e) {
-                throw new ConfigurationException("Cannot load transformer factory " + tFactoryClass,
e);
+                throw new ConfigurationException("Cannot load transformer factory " + transformerFactoryClass,
e);
             }
         } else {
             // Standard TrAX behaviour
             this.tfactory = (SAXTransformerFactory) TransformerFactory.newInstance();
         }
         tfactory.setErrorListener(new TraxErrorHandler(getLogger()));
+    }
 
+    private void initNamespacePipe() {
         // Check if we need namespace as attributes.
         try {
             if (needsNamespacesAsAttributes()) {
@@ -260,18 +327,56 @@
         } catch (Exception e) {
             getLogger().warn("Cannot know if transformer needs namespaces attributes - assuming
NO.", e);
         }
-
     }
 
     /**
-     * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
+     * Create the caching key from the formating properties used by the
+     * transformer handler that is used for serialization.
+     * @param format 
+     *
      */
-    public void recycle() {
-        super.recycle();
+    protected static String createCachingKey(Properties format) {
+        final StringBuffer buffer = new StringBuffer();
+        String value = null;
+        
+        // Use lookup of the property values instead of just iterating through the
+        // enumeration of them to give the caching key a  deterministic order of its parts
 
-        if (this.namespacePipe != null) {
-            this.namespacePipe.recycle();
+        if ((value = format.getProperty(OutputKeys.CDATA_SECTION_ELEMENTS)) != null) {
+            buffer.append(";cdata-section-elements=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.DOCTYPE_PUBLIC)) != null) {
+            buffer.append(";doctype-public=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.DOCTYPE_SYSTEM)) != null) {
+            buffer.append(";doctype-system=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.ENCODING)) != null) {
+            buffer.append(";encoding=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.INDENT)) != null) {
+            buffer.append(";indent=").append(value);
         }
+        if ((value = format.getProperty(OutputKeys.MEDIA_TYPE)) != null) {
+            buffer.append(";media-type=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.METHOD)) != null) {
+            buffer.append(";method=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.OMIT_XML_DECLARATION)) != null) {
+            buffer.append(";omit-xml-declaration=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.STANDALONE)) != null) {
+            buffer.append(";standalone=").append(value);
+        }
+        if ((value = format.getProperty(OutputKeys.VERSION)) != null) {
+            buffer.append(";version=").append(value);
+        }
+
+        if ( buffer.length() > 0 )
+            return buffer.toString();
+        else
+            return "1";
     }
 
     /**



Mime
View raw message