Parent Directory | Revision Log | Patch
--- cocoon/trunk/src/java/org/apache/cocoon/serialization/TextSerializer.java 2005/04/26 16:42:48 164814 +++ cocoon/trunk/src/java/org/apache/cocoon/serialization/TextSerializer.java 2005/04/26 16:43:13 164815 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed 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. @@ -18,6 +18,8 @@ package org.apache.cocoon.serialization; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.cocoon.CascadingIOException; +import org.apache.cocoon.xml.XMLUtils; + import org.xml.sax.SAXException; import org.xml.sax.Attributes; import org.xml.sax.helpers.AttributesImpl; @@ -38,7 +40,7 @@ import java.io.OutputStream; * should wrap all the text inside it. * * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a> - * @version CVS $Id: TextSerializer.java,v 1.3 2004/03/05 13:02:58 bdelacretaz Exp $ + * @version $Id$ */ public class TextSerializer extends AbstractTextSerializer { @@ -73,23 +75,23 @@ public class TextSerializer extends Abst this.setContentHandler(handler); this.setLexicalHandler(handler); } catch (Exception e) { - final String message = "Cannot set TextSerializer outputstream"; + final String message = "Cannot set TextSerializer outputstream"; throw new CascadingIOException(message, e); } } public void startElement(String uri, String loc, String raw, Attributes a) - throws SAXException { + throws SAXException { this.hasRootElement = true; super.startElement(uri, loc, raw, a); } public void characters(char c[], int start, int len) - throws SAXException { + throws SAXException { if (!this.hasRootElement) { this.hasRootElement = this.hadNoRootElement = true; getLogger().warn("Encountered text before root element. Creating <text> wrapper element."); - super.startElement("", "text", "text", new AttributesImpl()); + super.startElement("", "text", "text", XMLUtils.EMPTY_ATTRIBUTES); } super.characters(c, start, len); }
infrastructure at apache.org | ViewVC Help |
Powered by ViewVC 1.1.26 |