I have reviewed and approved the patch in XALANJ-2050 
and am committing the patch. I only made one change 
and that was to not have another method, setNewLine on
SerializationHandler, but rather use the existing
setOutputProperty() method.
diff --git a/src/org/apache/xml/serializer/DOM3Serializer.java b/src/org/apache/xml/serializer/DOM3Serializer.java
new file mode 100644
index 0000000..11a81f8
--- /dev/null
+++ b/src/org/apache/xml/serializer/DOM3Serializer.java
@@ -0,0 +1,116 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer;

+

+import java.io.IOException;

+

+import org.w3c.dom.Node;

+import org.w3c.dom.DOMErrorHandler;

+import org.w3c.dom.ls.LSSerializerFilter;

+

+/**

+ * Interface for a DOM serializer capable of serializing DOMs as specified in 

+ * the DOM Level 3 Save Recommendation.

+ * <p>

+ * The DOM3Serializer is a facet of a serializer and is obtained from the

+ * asDOM3Serializer() method of the org.apache.xml.serializer.Serializer interface. 

+ * A serializer may or may not support a level 3 DOM serializer, if it does not then the 

+ * return value from asDOM3Serializer() is null.

+ * <p>

+ * Example:

+ * <pre>

+ * Document     doc;

+ * Serializer   ser;

+ * OutputStream os;

+ * DOMErrorHandler handler;

+ * 

+ * ser = ...;

+ * os = ...;

+ * handler = ...;

+ *

+ * ser.setOutputStream( os );

+ * DOM3Serialzier dser = (DOM3Serialzier)ser.asDOM3Serializer();

+ * dser.setErrorHandler(handler);

+ * dser.serialize(doc);

+ * </pre>

+ * 

+ * @see org.apache.xml.serializer.Serializer

+ * 

+ * @xsl.usage general

+ *

+ */

+public interface DOM3Serializer {

+    /**

+     * Serializes the Level 3 DOM node. Throws an exception only if an I/O

+     * exception occured while serializing.

+     * 

+     * This interface is a public API.

+     *

+     * @param node the Level 3 DOM node to serialize

+     * @throws IOException if an I/O exception occured while serializing

+     */

+    public void serializeDOM3(Node node) throws IOException;

+

+    /**

+     * Sets a DOMErrorHandler on the DOM Level 3 Serializer.

+     * 

+     * This interface is a public API.

+     *

+     * @param handler the Level 3 DOMErrorHandler

+     */

+    public void setErrorHandler(DOMErrorHandler handler);

+

+    /**

+     * Returns a DOMErrorHandler set on the DOM Level 3 Serializer.

+     * 

+     * This interface is a public API.

+     *

+     * @return A Level 3 DOMErrorHandler

+     */

+    public DOMErrorHandler getErrorHandler();

+

+    /**

+     * Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes

+     * during serialization.

+     * 

+     * This interface is a public API.

+     *

+     * @param filter the Level 3 LSSerializerFilter

+     */

+    public void setNodeFilter(LSSerializerFilter filter);

+

+    /**

+     * Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes

+     * during serialization.

+     * 

+     * This interface is a public API.

+     *

+     * @return The Level 3 LSSerializerFilter

+     */

+    public LSSerializerFilter getNodeFilter();

+

+    /**

+     * Sets the new line character to be used during serialization

+     * @param newLine A character array corresponding to the new line character to be used.

+     */

+    public void setNewLine(char[] newLine);

+}

diff --git a/src/org/apache/xml/serializer/EmptySerializer.java b/src/org/apache/xml/serializer/EmptySerializer.java
index 427304c..fba7de2 100644
--- a/src/org/apache/xml/serializer/EmptySerializer.java
+++ b/src/org/apache/xml/serializer/EmptySerializer.java
@@ -776,4 +776,12 @@
         
     }
 
+    /**
+     * @see org.apache.xml.serializer.Serializer#asDOM3Serializer()
+     */
+    public Object asDOM3Serializer() throws IOException
+    {
+        couldThrowIOException();
+        return null;
+    }
 }
diff --git a/src/org/apache/xml/serializer/Encodings.java b/src/org/apache/xml/serializer/Encodings.java
index 6b051f1..93490f4 100644
--- a/src/org/apache/xml/serializer/Encodings.java
+++ b/src/org/apache/xml/serializer/Encodings.java
@@ -72,7 +72,8 @@
             {
                 try
                 {
-                	OutputStreamWriter osw = new OutputStreamWriter(output,_encodings[i].javaName);
+                    String javaName = _encodings[i].javaName;
+                	OutputStreamWriter osw = new OutputStreamWriter(output,javaName);
                     return osw; 
                 }
                 catch (java.lang.IllegalArgumentException iae) // java 1.1.8
@@ -127,6 +128,26 @@
     }
  
     /**
+     * Determines if the encoding specified was recognized by the
+     * serializer or not.
+     *
+     * @param encoding The encoding
+     * @return boolean - true if the encoding was recognized else false
+     */
+    public static boolean isRecognizedEncoding(String encoding)
+    {
+        EncodingInfo ei;
+
+        String normalizedEncoding = encoding.toUpperCase();
+        ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding);
+        if (ei == null)
+            ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding);
+        if (ei != null)
+            return true;
+        return false;
+    }
+    
+    /**
      * A fast and cheap way to uppercase a String that is
      * only made of printable ASCII characters.
      * <p>
diff --git a/src/org/apache/xml/serializer/SerializationHandler.java b/src/org/apache/xml/serializer/SerializationHandler.java
index ec3b4e1..fca975f 100644
--- a/src/org/apache/xml/serializer/SerializationHandler.java
+++ b/src/org/apache/xml/serializer/SerializationHandler.java
@@ -108,9 +108,29 @@
     public void setNamespaceMappings(NamespaceMappings mappings);
 
     /**
-     * Flush any pending events currently queued up in the serializer. This will
-     * flush any input that the serializer has which it has not yet sent as
-     * output.
+     * A SerializationHandler accepts SAX-like events, so
+     * it can accumulate attributes or namespace nodes after
+     * a startElement().
+     * <p>
+     * If the SerializationHandler has a Writer or OutputStream, 
+     * a call to this method will flush such accumulated 
+     * events as a closed start tag for an element.
+     * <p>
+     * If the SerializationHandler wraps a ContentHandler,
+     * a call to this method will flush such accumulated
+     * events as a SAX (not SAX-like) calls to
+     * startPrefixMapping() and startElement().
+     * <p>
+     * If one calls endDocument() then one need not call
+     * this method since a call to endDocument() will
+     * do what this method does. However, in some
+     * circumstances, such as with document fragments,
+     * endDocument() is not called and it may be
+     * necessary to call this method to flush
+     * any pending events.
+     * <p> 
+     * For performance reasons this method should not be called
+     * very often. 
      */
     public void flushPending() throws SAXException;
     
@@ -121,6 +141,5 @@
      * false if they are to be left as DTD entity references. 
      */
     public void setDTDEntityExpansion(boolean expand);
-
-
+    
 }
diff --git a/src/org/apache/xml/serializer/Serializer.java b/src/org/apache/xml/serializer/Serializer.java
index f7b01fb..933d1c6 100644
--- a/src/org/apache/xml/serializer/Serializer.java
+++ b/src/org/apache/xml/serializer/Serializer.java
@@ -218,5 +218,21 @@
      * @return True if serializer has been reset and can be reused
      */
     public boolean reset();
+
+    /**
+     * Return an Object into this serializer to be cast to a DOM3Serializer.
+     * Through the returned object the document to be serialized,
+     * a DOM (Level 3), can be provided to the serializer.
+     * If the serializer does not support casting to a {@link DOM3Serializer}
+     * interface, it should return null.
+     * <p>
+     * In principle only one of asDOM3Serializer() or asContentHander() 
+     * should be called.
+     *
+     * @return An Object to be cast to a DOM3Serializer interface into this serializer,
+     *  or null if the serializer is not DOM capable
+     * @throws IOException An I/O exception occured
+     */
+    public Object asDOM3Serializer() throws IOException;
 }
 
diff --git a/src/org/apache/xml/serializer/SerializerBase.java b/src/org/apache/xml/serializer/SerializerBase.java
index 3b9556f..1df3001 100644
--- a/src/org/apache/xml/serializer/SerializerBase.java
+++ b/src/org/apache/xml/serializer/SerializerBase.java
@@ -1568,7 +1568,21 @@
     {
         return getProp(name,false);
     }
-    
+
+    /**
+     * Return a {@link DOM3Serializer} interface into this serializer. If the
+     * serializer does not support the {@link DOM3Serializer} interface, it should
+     * return null.
+     *
+     * @return A {@link DOM3Serializer} interface into this serializer,  or null
+     * if the serializer is not DOM capable
+     * @throws IOException An I/O exception occured
+     * @see org.apache.xml.serializer.Serializer#asDOM3Serializer()
+     */
+    public Object asDOM3Serializer() throws IOException
+    {
+        return new org.apache.xml.serializer.dom3.DOM3SerializerImpl(this);
+    }
     /**
      * Get the default value of an xsl:output property,
      * which would be null only if no default value exists
diff --git a/src/org/apache/xml/serializer/ToUnknownStream.java b/src/org/apache/xml/serializer/ToUnknownStream.java
index 4bd0789..e7ed0e0 100644
--- a/src/org/apache/xml/serializer/ToUnknownStream.java
+++ b/src/org/apache/xml/serializer/ToUnknownStream.java
@@ -1305,4 +1305,12 @@
                 ch.length);
         }
     }
+
+    /**
+     * @see org.apache.xml.serializer.Serializer#asDOM3Serializer()
+     */
+    public Object asDOM3Serializer() throws IOException
+    {
+        return m_handler.asDOM3Serializer();
+    }
 }
diff --git a/src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java b/src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
new file mode 100644
index 0000000..c5daf3a
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
@@ -0,0 +1,158 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import java.io.IOException;

+

+import org.apache.xml.serializer.DOM3Serializer;

+import org.apache.xml.serializer.SerializationHandler;

+import org.apache.xml.serializer.utils.WrappedRuntimeException;

+import org.w3c.dom.DOMErrorHandler;

+import org.w3c.dom.Node;

+import org.w3c.dom.ls.LSSerializerFilter;

+

+/**

+ * This class implements the DOM3Serializer interface.

+ * 

+ * @xsl.usage internal

+ */

+public final class DOM3SerializerImpl implements DOM3Serializer {

+

+    /**

+     * Private class members

+     */

+    // The DOMErrorHandler

+    private DOMErrorHandler fErrorHandler;

+

+    // A LSSerializerFilter

+    private LSSerializerFilter fSerializerFilter;

+

+    // A LSSerializerFilter

+    private char[] fNewLine;

+

+    // A SerializationHandler ex. an instance of ToXMLStream

+    private SerializationHandler fSerializationHandler;

+

+    /**

+     * Constructor

+     * 

+     * @param handler An instance of the SerializationHandler interface. 

+     */

+    public DOM3SerializerImpl(SerializationHandler handler) {

+        fSerializationHandler = handler;

+    }

+

+    // Public memebers

+

+    /**

+     * Returns a DOMErrorHandler set on the DOM Level 3 Serializer.

+     * 

+     * This interface is a public API.

+     *

+     * @return A Level 3 DOMErrorHandler

+     */

+    public DOMErrorHandler getErrorHandler() {

+        return fErrorHandler;

+    }

+

+    /**

+     * Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes

+     * during serialization.

+     * 

+     * This interface is a public API.

+     *

+     * @return The Level 3 LSSerializerFilter

+     */

+    public LSSerializerFilter getNodeFilter() {

+        return fSerializerFilter;

+    }

+

+    /**

+     * Gets the new line character to be used during serialization

+     */

+    public char[] getNewLine() {

+        return fNewLine;

+    }

+

+    /**

+     * Serializes the Level 3 DOM node by creating an instance of DOM3TreeWalker

+     * which traverses the DOM tree and invokes handler events to serialize

+     * the DOM NOde. Throws an exception only if an I/O exception occured

+     * while serializing.

+     * This interface is a public API.

+     *

+     * @param node the Level 3 DOM node to serialize

+     * @throws IOException if an I/O exception occured while serializing

+     */

+    public void serializeDOM3(Node node) throws IOException {

+        try {

+            DOM3TreeWalker walker = new DOM3TreeWalker(fSerializationHandler,

+                    fErrorHandler, fSerializerFilter, fNewLine);

+

+            walker.traverse(node);

+        } catch (org.xml.sax.SAXException se) {

+            throw new WrappedRuntimeException(se);

+        }

+    }

+

+    /**

+     * Sets a DOMErrorHandler on the DOM Level 3 Serializer.

+     * 

+     * This interface is a public API.

+     *

+     * @param handler the Level 3 DOMErrorHandler

+     */

+    public void setErrorHandler(DOMErrorHandler handler) {

+        fErrorHandler = handler;

+    }

+

+    /**

+     * Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes

+     * during serialization.

+     * 

+     * This interface is a public API.

+     *

+     * @param filter the Level 3 LSSerializerFilter

+     */

+    public void setNodeFilter(LSSerializerFilter filter) {

+        fSerializerFilter = filter;

+    }

+

+    /**

+     * Sets a SerializationHandler on the DOM Serializer.

+     * 

+     * This interface is a public API.

+     *

+     * @param handler An instance of SerializationHandler

+     */

+    public void setSerializationHandler(SerializationHandler handler) {

+        fSerializationHandler = handler;

+    }

+

+    /**

+     * Sets the new line character to be used during serialization

+     * @param newLine A character array corresponding to the new line character to be used.

+     */

+    public void setNewLine(char[] newLine) {

+        fNewLine = newLine;

+    }

+}

diff --git a/src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java b/src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
new file mode 100644
index 0000000..59dcae7
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
@@ -0,0 +1,2147 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import java.io.File;

+import java.io.IOException;

+import java.io.Writer;

+import java.util.Enumeration;

+import java.util.Hashtable;

+import java.util.Properties;

+

+import org.apache.xml.serializer.dom3.NamespaceSupport;

+import org.apache.xml.serializer.OutputPropertiesFactory;

+import org.apache.xml.serializer.SerializationHandler;

+import org.apache.xml.serializer.utils.MsgKey;

+import org.apache.xml.serializer.utils.Utils;

+import org.apache.xml.serializer.utils.XML11Char;

+import org.apache.xml.serializer.utils.XMLChar;

+import org.w3c.dom.Attr;

+import org.w3c.dom.CDATASection;

+import org.w3c.dom.Comment;

+import org.w3c.dom.DOMError;

+import org.w3c.dom.DOMErrorHandler;

+import org.w3c.dom.Document;

+import org.w3c.dom.DocumentType;

+import org.w3c.dom.Element;

+import org.w3c.dom.Entity;

+import org.w3c.dom.EntityReference;

+import org.w3c.dom.NamedNodeMap;

+import org.w3c.dom.Node;

+import org.w3c.dom.NodeList;

+import org.w3c.dom.ProcessingInstruction;

+import org.w3c.dom.Text;

+import org.w3c.dom.ls.LSSerializerFilter;

+import org.w3c.dom.traversal.NodeFilter;

+import org.xml.sax.Locator;

+import org.xml.sax.SAXException;

+import org.xml.sax.ext.LexicalHandler;

+import org.xml.sax.helpers.LocatorImpl;

+

+/**

+ * Built on org.apache.xml.serializer.TreeWalker and adds functionality to

+ * traverse and serialize a DOM Node (Level 2 or Level 3) as specified in 

+ * the DOM Level 3 LS Recommedation by evaluating and applying DOMConfiguration 

+ * parameters and filters if any during serialization.

+ *   

+ * @xsl.usage internal

+ */

+final class DOM3TreeWalker {

+

+    /**

+     * The SerializationHandler, it extends ContentHandler and when

+     * this class is instantiated via the constructor provided, a

+     * SerializationHandler object is passed to it.

+     */

+    private SerializationHandler fSerializer = null;

+

+    /** We do not need DOM2Helper since DOM Level 3 LS applies to DOM Level 2 or newer */

+

+    /** Locator object for this TreeWalker          */

+    private LocatorImpl fLocator = new LocatorImpl();

+

+    /** ErrorHandler */

+    private DOMErrorHandler fErrorHandler = null;

+

+    /** LSSerializerFilter */

+    private LSSerializerFilter fFilter = null;

+

+    /** If the serializer is an instance of a LexicalHandler */

+    private LexicalHandler fLexicalHandler = null;

+

+    private int fWhatToShowFilter;

+

+    /** New Line character to use in serialization */

+    private char[] fNewLine = null;

+

+    /** DOMConfiguration Properties */

+    private Properties fDOMConfigProperties = null;

+

+    /** Keeps track if we are in an entity reference when entities=true */

+    private boolean fInEntityRef = false;

+

+    /** Stores the version of the XML document to be serialize */

+    private String fXMLVersion = null;

+

+    /** XML Version, default 1.0 */

+    private boolean fIsXMLVersion11 = false;

+

+    /** Is the Node a Level 3 DOM node */

+    private boolean fIsLevel3DOM = false;

+

+    /** DOM Configuration Parameters */

+    private int fFeatures = 0;

+

+    /** Flag indicating whether following text to be processed is raw text          */

+    boolean fNextIsRaw = false;

+

+    // 

+    private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";

+

+    //

+    private static final String XMLNS_PREFIX = "xmlns";

+

+    // 

+    private static final String XML_URI = "http://www.w3.org/XML/1998/namespace";

+

+    // 

+    private static final String XML_PREFIX = "xml";

+

+    /** stores namespaces in scope */

+    protected NamespaceSupport fNSBinder;

+

+    /** stores all namespace bindings on the current element */

+    protected NamespaceSupport fLocalNSBinder;

+    

+    /** stores the current element depth */

+    private int fElementDepth = 0;

+

+    // ***********************************************************************

+    // DOMConfiguration paramter settings 

+    // ***********************************************************************

+    // Parameter canonical-form, true [optional] - NOT SUPPORTED 

+    private final static int CANONICAL = 0x1 << 0;

+

+    // Parameter cdata-sections, true [required] (default)

+    private final static int CDATA = 0x1 << 1;

+

+    // Parameter check-character-normalization, true [optional] - NOT SUPPORTED 

+    private final static int CHARNORMALIZE = 0x1 << 2;

+

+    // Parameter comments, true [required] (default)

+    private final static int COMMENTS = 0x1 << 3;

+

+    // Parameter datatype-normalization, true [optional] - NOT SUPPORTED

+    private final static int DTNORMALIZE = 0x1 << 4;

+

+    // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED

+    private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5;

+

+    // Parameter entities, true [required] (default)

+    private final static int ENTITIES = 0x1 << 6;

+

+    // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer

+    private final static int INFOSET = 0x1 << 7;

+

+    // Parameter namespaces, true [required] (default)

+    private final static int NAMESPACES = 0x1 << 8;

+

+    // Parameter namespace-declarations, true [required] (default)

+    private final static int NAMESPACEDECLS = 0x1 << 9;

+

+    // Parameter normalize-characters, true [optional] - NOT SUPPORTED

+    private final static int NORMALIZECHARS = 0x1 << 10;

+

+    // Parameter split-cdata-sections, true [required] (default)

+    private final static int SPLITCDATA = 0x1 << 11;

+

+    // Parameter validate, true [optional] - NOT SUPPORTED

+    private final static int VALIDATE = 0x1 << 12;

+

+    // Parameter validate-if-schema, true [optional] - NOT SUPPORTED

+    private final static int SCHEMAVALIDATE = 0x1 << 13;

+

+    // Parameter split-cdata-sections, true [required] (default)

+    private final static int WELLFORMED = 0x1 << 14;

+

+    // Parameter discard-default-content, true [required] (default)

+    // Not sure how this will be used in level 2 Documents

+    private final static int DISCARDDEFAULT = 0x1 << 15;

+

+    // Parameter format-pretty-print, true [optional] 

+    private final static int PRETTY_PRINT = 0x1 << 16;

+

+    // Parameter ignore-unknown-character-denormalizations, true [required] (default)

+    // We currently do not support XML 1.1 character normalization

+    private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17;

+

+    // Parameter discard-default-content, true [required] (default)

+    private final static int XMLDECL = 0x1 << 18;

+

+    /**

+     * Constructor.

+     * @param   contentHandler serialHandler The implemention of the SerializationHandler interface

+     */

+    DOM3TreeWalker(

+        SerializationHandler serialHandler,

+        DOMErrorHandler errHandler,

+        LSSerializerFilter filter,

+        char[] newLine) {

+        fSerializer = serialHandler;

+        //fErrorHandler = errHandler == null ? new DOMErrorHandlerImpl() : errHandler; // Should we be using the default?

+        fErrorHandler = errHandler;

+        fFilter = filter;

+        fLexicalHandler = null;

+        fNewLine = newLine;

+

+        fNSBinder = new NamespaceSupport();

+        fLocalNSBinder = new NamespaceSupport();

+        

+        fDOMConfigProperties = fSerializer.getOutputFormat();

+        fSerializer.setDocumentLocator(fLocator);

+        initProperties(fDOMConfigProperties);

+        

+        try {

+            // Bug see Bugzilla  26741

+            fLocator.setSystemId(

+                System.getProperty("user.dir") + File.separator + "dummy.xsl");

+        } catch (SecurityException se) { // user.dir not accessible from applet

+

+        }

+    }

+

+    /**

+     * Perform a pre-order traversal non-recursive style.  

+     *

+     * Note that TreeWalker assumes that the subtree is intended to represent 

+     * a complete (though not necessarily well-formed) document and, during a 

+     * traversal, startDocument and endDocument will always be issued to the 

+     * SAX listener.

+     *  

+     * @param pos Node in the tree where to start traversal

+     *

+     * @throws TransformerException

+     */

+    public void traverse(Node pos) throws org.xml.sax.SAXException {

+        this.fSerializer.startDocument();

+

+        // Determine if the Node is a DOM Level 3 Core Node.

+        if (pos.getNodeType() != Node.DOCUMENT_NODE) {

+            Document ownerDoc = pos.getOwnerDocument();

+            if (ownerDoc != null

+                && ownerDoc.getImplementation().hasFeature("Core", "3.0")) {

+                fIsLevel3DOM = true;

+            }

+        } else {

+            if (((Document) pos)

+                .getImplementation()

+                .hasFeature("Core", "3.0")) {

+                fIsLevel3DOM = true;

+            }

+        }

+

+        if (fSerializer instanceof LexicalHandler) {

+            fLexicalHandler = ((LexicalHandler) this.fSerializer);

+        }

+

+        if (fFilter != null)

+            fWhatToShowFilter = fFilter.getWhatToShow();

+

+        Node top = pos;

+

+        while (null != pos) {

+            startNode(pos);

+

+            Node nextNode = null;

+

+            nextNode = pos.getFirstChild();

+

+            while (null == nextNode) {

+                endNode(pos);

+

+                if (top.equals(pos))

+                    break;

+

+                nextNode = pos.getNextSibling();

+

+                if (null == nextNode) {

+                    pos = pos.getParentNode();

+

+                    if ((null == pos) || (top.equals(pos))) {

+                        if (null != pos)

+                            endNode(pos);

+

+                        nextNode = null;

+

+                        break;

+                    }

+                }

+            }

+

+            pos = nextNode;

+        }

+        this.fSerializer.endDocument();

+    }

+

+    /**

+     * Perform a pre-order traversal non-recursive style.

+     

+     * Note that TreeWalker assumes that the subtree is intended to represent 

+     * a complete (though not necessarily well-formed) document and, during a 

+     * traversal, startDocument and endDocument will always be issued to the 

+     * SAX listener.

+     *

+     * @param pos Node in the tree where to start traversal

+     * @param top Node in the tree where to end traversal

+     *

+     * @throws TransformerException

+     */

+    public void traverse(Node pos, Node top) throws org.xml.sax.SAXException {

+

+        this.fSerializer.startDocument();

+

+        // Determine if the Node is a DOM Level 3 Core Node.

+        if (pos.getNodeType() != Node.DOCUMENT_NODE) {

+            Document ownerDoc = pos.getOwnerDocument();

+            if (ownerDoc != null

+                && ownerDoc.getImplementation().hasFeature("Core", "3.0")) {

+                fIsLevel3DOM = true;

+            }

+        } else {

+            if (((Document) pos)

+                .getImplementation()

+                .hasFeature("Core", "3.0")) {

+                fIsLevel3DOM = true;

+            }

+        }

+

+        if (fSerializer instanceof LexicalHandler) {

+            fLexicalHandler = ((LexicalHandler) this.fSerializer);

+        }

+

+        if (fFilter != null)

+            fWhatToShowFilter = fFilter.getWhatToShow();

+

+        while (null != pos) {

+            startNode(pos);

+

+            Node nextNode = null;

+

+            nextNode = pos.getFirstChild();

+

+            while (null == nextNode) {

+                endNode(pos);

+

+                if ((null != top) && top.equals(pos))

+                    break;

+

+                nextNode = pos.getNextSibling();

+

+                if (null == nextNode) {

+                    pos = pos.getParentNode();

+

+                    if ((null == pos) || ((null != top) && top.equals(pos))) {

+                        nextNode = null;

+

+                        break;

+                    }

+                }

+            }

+

+            pos = nextNode;

+        }

+        this.fSerializer.endDocument();

+    }

+

+    /**

+     * Optimized dispatch of characters.

+     */

+    private final void dispatachChars(Node node)

+        throws org.xml.sax.SAXException {

+        if (fSerializer != null) {

+            this.fSerializer.characters(node);

+        } else {

+            String data = ((Text) node).getData();

+            this.fSerializer.characters(data.toCharArray(), 0, data.length());

+        }

+    }

+

+    /**

+     * Start processing given node

+     *

+     * @param node Node to process

+     *

+     * @throws org.xml.sax.SAXException

+     */

+    protected void startNode(Node node) throws org.xml.sax.SAXException {

+        if (node instanceof Locator) {

+            Locator loc = (Locator) node;

+            fLocator.setColumnNumber(loc.getColumnNumber());

+            fLocator.setLineNumber(loc.getLineNumber());

+            fLocator.setPublicId(loc.getPublicId());

+            fLocator.setSystemId(loc.getSystemId());

+        } else {

+            fLocator.setColumnNumber(0);

+            fLocator.setLineNumber(0);

+        }

+

+        switch (node.getNodeType()) {

+            case Node.DOCUMENT_TYPE_NODE :

+                serializeDocType((DocumentType) node, true);

+                break;

+            case Node.COMMENT_NODE :

+                serializeComment((Comment) node);

+                break;

+            case Node.DOCUMENT_FRAGMENT_NODE :

+                // Children are traversed

+                break;

+            case Node.DOCUMENT_NODE :

+                break;

+            case Node.ELEMENT_NODE :

+                serializeElement((Element) node, true);

+                break;

+            case Node.PROCESSING_INSTRUCTION_NODE :

+                serializePI((ProcessingInstruction) node);

+                break;

+            case Node.CDATA_SECTION_NODE :

+                serializeCDATASection((CDATASection) node);

+                break;

+            case Node.TEXT_NODE :

+                serializeText((Text) node);

+                break;

+            case Node.ENTITY_REFERENCE_NODE :

+                serializeEntityReference((EntityReference) node, true);

+                break;

+            default :

+                }

+    }

+

+    /**

+     * End processing of given node 

+     *

+     *

+     * @param node Node we just finished processing

+     *

+     * @throws org.xml.sax.SAXException

+     */

+    protected void endNode(Node node) throws org.xml.sax.SAXException {

+

+        switch (node.getNodeType()) {

+            case Node.DOCUMENT_NODE :

+                break;

+            case Node.DOCUMENT_TYPE_NODE :

+                serializeDocType((DocumentType) node, false);

+                break;

+            case Node.ELEMENT_NODE :

+                serializeElement((Element) node, false);

+                break;

+            case Node.CDATA_SECTION_NODE :

+                break;

+            case Node.ENTITY_REFERENCE_NODE :

+                serializeEntityReference((EntityReference) node, false);

+                break;

+            default :

+                }

+    }

+

+    // ***********************************************************************

+    // Node serialization methods

+    // ***********************************************************************

+    /**

+     * Applies a filter on the node to serialize

+     * 

+     * @param node The Node to serialize

+     * @return True if the node is to be serialized else false if the node 

+     *         is to be rejected or skipped. 

+     */

+    protected boolean applyFilter(Node node, int nodeType) {

+        if (fFilter != null && (fWhatToShowFilter & nodeType) != 0) {

+

+            short code = fFilter.acceptNode(node);

+            switch (code) {

+                case NodeFilter.FILTER_REJECT :

+                case NodeFilter.FILTER_SKIP :

+                    return false; // skip the node

+                default : // fall through..

+            }

+        }

+        return true;

+    }

+

+    /**

+     * Serializes a Document Type Node.

+     * 

+     * @param node The Docuemnt Type Node to serialize

+     * @param bStart Invoked at the start or end of node.  Default true. 

+     */

+    protected void serializeDocType(DocumentType node, boolean bStart)

+        throws SAXException {

+        // The DocType and internalSubset can not be modified in DOM and is

+        // considered to be well-formed as the outcome of successful parsing.

+        String docTypeName = node.getNodeName();

+        String publicId = node.getPublicId();

+        String systemId = node.getSystemId();

+        String internalSubset = node.getInternalSubset();

+

+        //DocumentType nodes are never passed to the filter

+        

+        if (internalSubset != null && !"".equals(internalSubset)) {

+

+            if (bStart) {

+                try {

+                    // The Serializer does not provide a way to write out the

+                    // DOCTYPE internal subset via an event call, so we write it

+                    // out here.

+                    Writer writer = fSerializer.getWriter();

+                    StringBuffer dtd = new StringBuffer();

+

+                    dtd.append("<!DOCTYPE ");

+                    dtd.append(docTypeName);

+                    if (null != publicId) {

+                        dtd.append(" PUBLIC \"");

+                        dtd.append(publicId);

+                        dtd.append('\"');

+                    }

+

+                    if (null != systemId) {

+                        if (null == publicId) {

+                            dtd.append(" SYSTEM \"");

+                        } else {

+                            dtd.append(" \"");

+                        }    

+                        dtd.append(systemId);

+                        dtd.append('\"');

+                    }

+                    

+                    dtd.append(" [ ");

+                    

+                    dtd.append(fNewLine);

+                    dtd.append(internalSubset);

+                    dtd.append("]>");

+                    dtd.append(new String(fNewLine));

+                    

+                    writer.write(dtd.toString());

+                    writer.flush();

+                    

+                } catch (IOException e) {

+                    throw new SAXException(Utils.messages.createMessage(

+                            MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e);

+                }

+            } // else if !bStart do nothing

+            

+        } else {

+            

+            if (bStart) {

+                if (fLexicalHandler != null) {

+                    fLexicalHandler.startDTD(docTypeName, publicId, systemId);

+                }

+            } else {

+                if (fLexicalHandler != null) {

+                    fLexicalHandler.endDTD();

+                }

+            }

+        }

+    }

+

+    /**

+     * Serializes a Comment Node.

+     * 

+     * @param node The Comment Node to serialize

+     */

+    protected void serializeComment(Comment node) throws SAXException {

+        // comments=true

+        if ((fFeatures & COMMENTS) != 0) {

+            String data = node.getData();

+

+            // well-formed=true

+            if ((fFeatures & WELLFORMED) != 0) {

+                isCommentWellFormed(data);

+            }

+

+            if (fLexicalHandler != null) {

+                // apply the LSSerializer filter after the operations requested by the 

+                // DOMConfiguration parameters have been applied 

+                if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) {

+                    return;

+                }

+

+                fLexicalHandler.comment(data.toCharArray(), 0, data.length());

+            }

+        }

+    }

+

+    /**

+     * Serializes an Element Node.

+     * 

+     * @param node The Element Node to serialize

+     * @param bStart Invoked at the start or end of node.   

+     */

+    protected void serializeElement(Element node, boolean bStart)

+        throws SAXException {

+        if (bStart) {

+            fElementDepth++;

+

+            // We use the Xalan specific startElement and starPrefixMapping calls 

+            // (and addAttribute and namespaceAfterStartElement) as opposed to

+            // SAX specific, for performance reasons as they reduce the overhead

+            // of creating an AttList object upfront.

+

+            // well-formed=true

+            if ((fFeatures & WELLFORMED) != 0) {

+                isElementWellFormed(node);

+            }

+

+            // REVISIT: We apply the LSSerializer filter for elements before

+            // namesapce fixup

+            if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) {

+                return;

+            }

+

+            // namespaces=true, record and fixup namspaced element

+            if ((fFeatures & NAMESPACES) != 0) {

+            	fNSBinder.pushContext();

+            	fLocalNSBinder.reset();

+            	

+                recordLocalNSDecl(node);

+                fixupElementNS(node);

+            }

+

+            // Namespace normalization

+            fSerializer.startElement(

+            		node.getNamespaceURI(),

+                    node.getLocalName(),

+                    node.getNodeName());

+

+            serializeAttList(node);

+            

+        } else {

+        	fElementDepth--;

+

+            // apply the LSSerializer filter

+            if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) {

+                return;

+            }

+

+            this.fSerializer.endElement(

+            	node.getNamespaceURI(),

+                node.getLocalName(),

+                node.getNodeName());

+            // since endPrefixMapping was not used by SerializationHandler it was removed

+            // for performance reasons.

+

+            if ((fFeatures & NAMESPACES) != 0 ) {

+                    fNSBinder.popContext();

+            }

+            

+        }

+    }

+

+    /**

+     * Serializes the Attr Nodes of an Element.

+     * 

+     * @param node The OwnerElement whose Attr Nodes are to be serialized.

+     */

+    protected void serializeAttList(Element node) throws SAXException {

+        NamedNodeMap atts = node.getAttributes();

+        int nAttrs = atts.getLength();

+

+        for (int i = 0; i < nAttrs; i++) {

+            Node attr = atts.item(i);

+

+            String localName = attr.getLocalName();

+            String attrName = attr.getNodeName();

+            String attrPrefix = attr.getPrefix() == null ? "" : attr.getPrefix();

+            String attrValue = attr.getNodeValue();

+

+            // Determine the Attr's type.

+            String type = null;

+            if (fIsLevel3DOM) {

+                type = ((Attr) attr).getSchemaTypeInfo().getTypeName();

+            }

+            type = type == null ? "CDATA" : type;

+

+            String attrNS = attr.getNamespaceURI();

+            if (attrNS !=null && attrNS.length() == 0) {

+            	attrNS=null;

+                // we must remove prefix for this attribute

+            	attrName=attr.getLocalName();

+            }

+

+            boolean isSpecified = ((Attr) attr).getSpecified();

+            boolean addAttr = true;

+            boolean applyFilter = false;

+            boolean xmlnsAttr =

+                attrName.equals("xmlns") || attrName.startsWith("xmlns:");

+

+            // well-formed=true

+            if ((fFeatures & WELLFORMED) != 0) {

+                isAttributeWellFormed(attr);

+            }

+            

+            //-----------------------------------------------------------------

+            // start Attribute namespace fixup

+            //-----------------------------------------------------------------

+            // namespaces=true, normalize all non-namespace attributes

+            // Step 3. Attribute

+            if ((fFeatures & NAMESPACES) != 0 && !xmlnsAttr) {

+           	

+        		// If the Attr has a namespace URI

+        		if (attrNS != null) {

+        			attrPrefix = attrPrefix == null ? "" : attrPrefix;

+

+        			String declAttrPrefix = fNSBinder.getPrefix(attrNS);

+        			String declAttrNS = fNSBinder.getURI(attrPrefix);

+        			

+        			// attribute has no prefix (default namespace decl does not apply to

+        			// attributes)

+        			// OR

+        			// attribute prefix is not declared

+        			// OR

+        			// conflict: attribute has a prefix that conflicts with a binding

+        			if ("".equals(attrPrefix) || "".equals(declAttrPrefix)

+        					|| !attrPrefix.equals(declAttrPrefix)) {

+

+        				// namespaceURI matches an in scope declaration of one or

+        				// more prefixes

+        				if (declAttrPrefix != null && !"".equals(declAttrPrefix)) {

+        					// pick the prefix that was found and change attribute's

+        					// prefix and nodeName.

+        					attrPrefix = declAttrPrefix;

+        					

+        					if (declAttrPrefix.length() > 0 ) { 

+        						attrName = declAttrPrefix + ":" + localName;

+        					} else {

+        						attrName = localName;

+        					}	

+        				} else {

+        					// The current prefix is not null and it has no in scope

+        					// declaration

+        					if (attrPrefix != null && !"".equals(attrPrefix)

+        							&& declAttrNS == null) {

+        						// declare this prefix

+        						if ((fFeatures & NAMESPACEDECLS) != 0) {

+        							fSerializer.addAttribute(XMLNS_URI, attrPrefix,

+        									XMLNS_PREFIX + ":" + attrPrefix, "CDATA",

+        									attrNS);

+        							fNSBinder.declarePrefix(attrPrefix, attrNS);

+        							fLocalNSBinder.declarePrefix(attrPrefix, attrNS);

+        						}

+        					} else {

+        						// find a prefix following the pattern "NS" +index

+        						// (starting at 1)

+        						// make sure this prefix is not declared in the current

+        						// scope.

+        						int counter = 1;

+        						attrPrefix = "NS" + counter++;

+

+        						while (fLocalNSBinder.getURI(attrPrefix) != null) {

+        							attrPrefix = "NS" + counter++;

+        						}

+        						// change attribute's prefix and Name

+        						attrName = attrPrefix + ":" + localName;

+        						

+        						// create a local namespace declaration attribute

+        						// Add the xmlns declaration attribute

+        						if ((fFeatures & NAMESPACEDECLS) != 0) {

+                                       							

+        							fSerializer.addAttribute(XMLNS_URI, attrPrefix,

+        									XMLNS_PREFIX + ":" + attrPrefix, "CDATA",

+        									attrNS);

+            						fNSBinder.declarePrefix(attrPrefix, attrNS);

+            						fLocalNSBinder.declarePrefix(attrPrefix, attrNS);

+        						}

+        					}

+        				}

+        			}

+

+        		} else { // if the Attr has no namespace URI

+        			// Attr has no localName

+        			if (localName == null) {

+        				// DOM Level 1 node!

+        				String msg = Utils.messages.createMessage(

+        						MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,

+        						new Object[] { attrName });

+

+        				if (fErrorHandler != null) {

+        					fErrorHandler

+        							.handleError(new DOMErrorImpl(

+        									DOMError.SEVERITY_ERROR, msg,

+        									MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null,

+        									null, null));

+        				}

+

+        			} else { // uri=null and no colon

+        				// attr has no namespace URI and no prefix

+        				// no action is required, since attrs don't use default

+        			}

+        		}

+

+            }

+

+            

+            // discard-default-content=true

+            // Default attr's are not passed to the filter and this contraint

+            // is applied only when discard-default-content=true 

+            // What about default xmlns attributes???? check for xmlnsAttr

+            if ((((fFeatures & DISCARDDEFAULT) != 0) && isSpecified)

+                || ((fFeatures & DISCARDDEFAULT) == 0)) {

+                applyFilter = true;

+            } else {

+            	addAttr = false;

+            }

+

+            if (applyFilter) {

+                // apply the filter for Attributes that are not default attributes

+                // or namespace decl attributes

+                if (fFilter != null

+                    && (fFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE)

+                        != 0) {

+

+                    if (!xmlnsAttr) {

+                        short code = fFilter.acceptNode(attr);

+                        switch (code) {

+                            case NodeFilter.FILTER_REJECT :

+                            case NodeFilter.FILTER_SKIP :

+                                addAttr = false;

+                                break;

+                            default : //fall through..

+                        }

+                    }

+                }

+            }

+

+            // if the node is a namespace node

+            if (addAttr && xmlnsAttr) {

+                // If namespace-declarations=true, add the node , else don't add it

+                if ((fFeatures & NAMESPACEDECLS) != 0) {

+               		// The namespace may have been fixed up, in that case don't add it.

+                	if (localName != null && !"".equals(localName)) {

+                		fSerializer.addAttribute(attrNS, localName, attrName, type, attrValue);

+                	} 

+                }

+            } else if (

+                addAttr && !xmlnsAttr) { // if the node is not a namespace node

+                // If namespace-declarations=true, add the node with the Attr nodes namespaceURI

+                // else add the node setting it's namespace to null or else the serializer will later

+                // attempt to add a xmlns attr for the prefixed attribute

+                if (((fFeatures & NAMESPACEDECLS) != 0) && (attrNS != null)) {

+                    fSerializer.addAttribute(

+                        attrNS,

+                        localName,

+                        attrName,

+                        type,

+                        attrValue);

+                } else {

+                    fSerializer.addAttribute(

+                        "",

+                        localName,

+                        attrName,

+                        type,

+                        attrValue);

+                }

+            }

+

+            // 

+            if (xmlnsAttr && ((fFeatures & NAMESPACEDECLS) != 0)) {

+                int index;

+                // Use "" instead of null, as Xerces likes "" for the 

+                // name of the default namespace.  Fix attributed 

+                // to "Steven Murray" <smurray@ebt.com>.

+                String prefix =

+                    (index = attrName.indexOf(":")) < 0

+                        ? ""

+                        : attrName.substring(index + 1);

+

+                if (!"".equals(prefix)) {

+                    fSerializer.namespaceAfterStartElement(prefix, attrValue);

+                }

+            }

+        }

+        

+    }

+   

+    /**

+     * Serializes an ProcessingInstruction Node.

+     * 

+     * @param node The ProcessingInstruction Node to serialize

+     */

+    protected void serializePI(ProcessingInstruction node)

+        throws SAXException {

+        ProcessingInstruction pi = node;

+        String name = pi.getNodeName();

+

+        // well-formed=true

+        if ((fFeatures & WELLFORMED) != 0) {

+            isPIWellFormed(node);

+        }

+

+        // apply the LSSerializer filter

+        if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) {

+            return;

+        }

+

+        // String data = pi.getData();

+        if (name.equals("xslt-next-is-raw")) {

+            fNextIsRaw = true;

+        } else {

+            this.fSerializer.processingInstruction(name, pi.getData());

+        }

+    }

+

+    /**

+     * Serializes an CDATASection Node.

+     * 

+     * @param node The CDATASection Node to serialize

+     */

+    protected void serializeCDATASection(CDATASection node)

+        throws SAXException {

+        // well-formed=true

+        if ((fFeatures & WELLFORMED) != 0) {

+            isCDATASectionWellFormed(node);

+        }

+

+        // cdata-sections = true

+        if ((fFeatures & CDATA) != 0) {

+

+            // split-cdata-sections = true

+            // Assumption: This parameter has an effect only when

+			// cdata-sections=true

+            // ToStream, by default splits cdata-sections. Hence the check

+			// below.

+            String nodeValue = node.getNodeValue();

+            int endIndex = nodeValue.indexOf("]]>");

+            if ((fFeatures & SPLITCDATA) != 0) {

+                if (endIndex >= 0) {

+                    // The first node split will contain the ]] markers

+                    String relatedData = nodeValue.substring(0, endIndex + 2);

+

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_CDATA_SECTIONS_SPLIT,

+                            null);

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_WARNING,

+                                msg,

+                                MsgKey.ER_CDATA_SECTIONS_SPLIT,

+                                null,

+                                relatedData,

+                                null));

+                    }

+                }

+            } else {

+                if (endIndex >= 0) {

+                    // The first node split will contain the ]] markers 

+                    String relatedData = nodeValue.substring(0, endIndex + 2);

+

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_CDATA_SECTIONS_SPLIT,

+                            null);

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_ERROR,

+                                msg,

+                                MsgKey.ER_CDATA_SECTIONS_SPLIT));

+                    }

+                    // Report an error and return.  What error???

+                    return;

+                }

+            }

+

+            // apply the LSSerializer filter

+            if (!applyFilter(node, NodeFilter.SHOW_CDATA_SECTION)) {

+                return;

+            }

+

+            // splits the cdata-section

+            if (fLexicalHandler != null) {

+                fLexicalHandler.startCDATA();

+            }

+            dispatachChars(node);

+            if (fLexicalHandler != null) {

+                fLexicalHandler.endCDATA();

+            }

+        } else {

+            dispatachChars(node);

+        }

+    }

+

+    /**

+     * Serializes an Text Node.

+     * 

+     * @param node The Text Node to serialize

+     */

+    protected void serializeText(Text node) throws SAXException {

+        if (fNextIsRaw) {

+            fNextIsRaw = false;

+            fSerializer.processingInstruction(

+                javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING,

+                "");

+            dispatachChars(node);

+            fSerializer.processingInstruction(

+                javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING,

+                "");

+        } else {

+            // keep track of dispatch or not to avoid duplicaiton of filter code

+            boolean bDispatch = false;

+

+            // well-formed=true

+            if ((fFeatures & WELLFORMED) != 0) {

+                isTextWellFormed(node);

+            }

+

+            // if the node is whitespace

+            // Determine the Attr's type.

+            boolean isElementContentWhitespace = false;

+            if (fIsLevel3DOM) {

+                isElementContentWhitespace =

+                       node.isElementContentWhitespace();

+            }

+

+            if (isElementContentWhitespace) {

+                // element-content-whitespace=true

+                if ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) {

+                    bDispatch = true;

+                }

+            } else {

+                bDispatch = true;

+            }

+

+            // apply the LSSerializer filter

+            if (!applyFilter(node, NodeFilter.SHOW_TEXT)) {

+                return;

+            }

+

+            if (bDispatch) {

+                dispatachChars(node);

+            }

+        }

+    }

+

+    /**

+     * Serializes an EntityReference Node.

+     * 

+     * @param node The EntityReference Node to serialize

+     * @param bStart Inicates if called from start or endNode 

+     */

+    protected void serializeEntityReference(

+        EntityReference node,

+        boolean bStart)

+        throws SAXException {

+        if (bStart) {

+            EntityReference eref = node;

+            // entities=true

+            if ((fFeatures & ENTITIES) != 0) {

+                

+                // perform well-formedness and other checking only if 

+                // entities = true

+

+                // well-formed=true

+                if ((fFeatures & WELLFORMED) != 0) {

+                    isEntityReferneceWellFormed(node);

+                }

+

+                // check "unbound-prefix-in-entity-reference" [fatal] 

+                // Raised if the configuration parameter "namespaces" is set to true

+                if ((fFeatures & NAMESPACES) != 0) {

+                    checkUnboundPrefixInEntRef(node);

+                }

+

+                // The filter should not apply in this case, since the

+                // EntityReference is not being expanded.

+                // should we pass entity reference nodes to the filter???

+            } 

+            

+            if (fLexicalHandler != null) {

+

+                // startEntity outputs only Text but not Element, Attr, Comment 

+                // and PI child nodes.  It does so by setting the m_inEntityRef 

+                // in ToStream and using this to decide if a node is to be 

+                // serialized or not.

+                fLexicalHandler.startEntity(eref.getNodeName());

+            } 

+

+        } else {

+            EntityReference eref = node;

+            // entities=true or false, 

+            if (fLexicalHandler != null) {

+                fLexicalHandler.endEntity(eref.getNodeName());

+            }

+        }

+    }

+

+    

+    // ***********************************************************************

+    // Methods to check well-formedness

+    // ***********************************************************************

+    /**

+     * Taken from org.apache.xerces.dom.CoreDocumentImpl

+     * 

+     * Check the string against XML's definition of acceptable names for

+     * elements and attributes and so on using the XMLCharacterProperties

+     * utility class

+     */

+    protected boolean isXMLName(String s, boolean xml11Version) {

+

+        if (s == null) {

+            return false;

+        }

+        if (!xml11Version)

+            return XMLChar.isValidName(s);

+        else

+            return XML11Char.isXML11ValidName(s);

+    }

+

+    /**

+     * Taken from org.apache.xerces.dom.CoreDocumentImpl

+     *  

+     * Checks if the given qualified name is legal with respect

+     * to the version of XML to which this document must conform.

+     *

+     * @param prefix prefix of qualified name

+     * @param local local part of qualified name

+     */

+    protected boolean isValidQName(

+        String prefix,

+        String local,

+        boolean xml11Version) {

+

+        // check that both prefix and local part match NCName

+        if (local == null)

+            return false;

+        boolean validNCName = false;

+

+        if (!xml11Version) {

+            validNCName =

+                (prefix == null || XMLChar.isValidNCName(prefix))

+                    && XMLChar.isValidNCName(local);

+        } else {

+            validNCName =

+                (prefix == null || XML11Char.isXML11ValidNCName(prefix))

+                    && XML11Char.isXML11ValidNCName(local);

+        }

+

+        return validNCName;

+    }

+

+    /**

+     * Checks if a XML character is well-formed

+     * 

+     * @param characters A String of characters to be checked for Well-Formedness

+     * @param refInvalidChar A reference to the character to be returned that was determined invalid. 

+     */

+    protected boolean isWFXMLChar(String chardata, Character refInvalidChar) {

+        if (chardata == null || (chardata.length() == 0)) {

+            return true;

+        }

+

+        char[] dataarray = chardata.toCharArray();

+        int datalength = dataarray.length;

+

+        // version of the document is XML 1.1

+        if (fIsXMLVersion11) {

+            //we need to check all characters as per production rules of XML11

+            int i = 0;

+            while (i < datalength) {

+                if (XML11Char.isXML11Invalid(dataarray[i++])) {

+                    // check if this is a supplemental character

+                    char ch = dataarray[i - 1];

+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {

+                        char ch2 = dataarray[i++];

+                        if (XMLChar.isLowSurrogate(ch2)

+                            && XMLChar.isSupplemental(

+                                XMLChar.supplemental(ch, ch2))) {

+                            continue;

+                        }

+                    }

+                    // Reference to invalid character which is returned

+                    refInvalidChar = new Character(ch);

+                    return false;

+                }

+            }

+        } // version of the document is XML 1.0

+        else {

+            // we need to check all characters as per production rules of XML 1.0

+            int i = 0;

+            while (i < datalength) {

+                if (XMLChar.isInvalid(dataarray[i++])) {

+                    // check if this is a supplemental character

+                    char ch = dataarray[i - 1];

+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {

+                        char ch2 = dataarray[i++];

+                        if (XMLChar.isLowSurrogate(ch2)

+                            && XMLChar.isSupplemental(

+                                XMLChar.supplemental(ch, ch2))) {

+                            continue;

+                        }

+                    }

+                    // Reference to invalid character which is returned                    

+                    refInvalidChar = new Character(ch);

+                    return false;

+                }

+            }

+        } // end-else fDocument.isXMLVersion()

+

+        return true;

+    } // isXMLCharWF

+

+    /**

+     * Checks if a XML character is well-formed.  If there is a problem with

+     * the character a non-null Character is returned else null is returned.

+     * 

+     * @param characters A String of characters to be checked for Well-Formedness

+     * @return Character A reference to the character to be returned that was determined invalid. 

+     */

+    protected Character isWFXMLChar(String chardata) {

+    	Character refInvalidChar;

+        if (chardata == null || (chardata.length() == 0)) {

+            return null;

+        }

+

+        char[] dataarray = chardata.toCharArray();

+        int datalength = dataarray.length;

+

+        // version of the document is XML 1.1

+        if (fIsXMLVersion11) {

+            //we need to check all characters as per production rules of XML11

+            int i = 0;

+            while (i < datalength) {

+                if (XML11Char.isXML11Invalid(dataarray[i++])) {

+                    // check if this is a supplemental character

+                    char ch = dataarray[i - 1];

+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {

+                        char ch2 = dataarray[i++];

+                        if (XMLChar.isLowSurrogate(ch2)

+                            && XMLChar.isSupplemental(

+                                XMLChar.supplemental(ch, ch2))) {

+                            continue;

+                        }

+                    }

+                    // Reference to invalid character which is returned

+                    refInvalidChar = new Character(ch);

+                    return refInvalidChar;

+                }

+            }

+        } // version of the document is XML 1.0

+        else {

+            // we need to check all characters as per production rules of XML 1.0

+            int i = 0;

+            while (i < datalength) {

+                if (XMLChar.isInvalid(dataarray[i++])) {

+                    // check if this is a supplemental character

+                    char ch = dataarray[i - 1];

+                    if (XMLChar.isHighSurrogate(ch) && i < datalength) {

+                        char ch2 = dataarray[i++];

+                        if (XMLChar.isLowSurrogate(ch2)

+                            && XMLChar.isSupplemental(

+                                XMLChar.supplemental(ch, ch2))) {

+                            continue;

+                        }

+                    }

+                    // Reference to invalid character which is returned                    

+                    refInvalidChar = new Character(ch);

+                    return refInvalidChar;

+                }

+            }

+        } // end-else fDocument.isXMLVersion()

+

+        return null;

+    } // isXMLCharWF

+

+    /**

+     * Checks if a comment node is well-formed

+     * 

+     * @param data The contents of the comment node

+     * @return a boolean indiacating if the comment is well-formed or not.

+     */

+    protected void isCommentWellFormed(String data) {

+        if (data == null || (data.length() == 0)) {

+            return;

+        }

+

+        char[] dataarray = data.toCharArray();

+        int datalength = dataarray.length;

+

+        // version of the document is XML 1.1

+        if (fIsXMLVersion11) {

+            // we need to check all chracters as per production rules of XML11

+            int i = 0;

+            while (i < datalength) {

+                char c = dataarray[i++];

+                if (XML11Char.isXML11Invalid(c)) {

+                    // check if this is a supplemental character

+                    if (XMLChar.isHighSurrogate(c) && i < datalength) {

+                        char c2 = dataarray[i++];

+                        if (XMLChar.isLowSurrogate(c2)

+                            && XMLChar.isSupplemental(

+                                XMLChar.supplemental(c, c2))) {

+                            continue;

+                        }

+                    }

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,

+                            new Object[] { new Character(c)});

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_FATAL_ERROR,

+                                msg,

+                                MsgKey.ER_WF_INVALID_CHARACTER,

+                                null,

+                                null,

+                                null));

+                    }

+                } else if (c == '-' && i < datalength && dataarray[i] == '-') {

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_WF_DASH_IN_COMMENT,

+                            null);

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_FATAL_ERROR,

+                                msg,

+                                MsgKey.ER_WF_INVALID_CHARACTER,

+                                null,

+                                null,

+                                null));

+                    }

+                }

+            }

+        } // version of the document is XML 1.0

+        else {

+            // we need to check all chracters as per production rules of XML 1.0

+            int i = 0;

+            while (i < datalength) {

+                char c = dataarray[i++];

+                if (XMLChar.isInvalid(c)) {

+                    // check if this is a supplemental character

+                    if (XMLChar.isHighSurrogate(c) && i < datalength) {

+                        char c2 = dataarray[i++];

+                        if (XMLChar.isLowSurrogate(c2)

+                            && XMLChar.isSupplemental(

+                                XMLChar.supplemental(c, c2))) {

+                            continue;

+                        }

+                    }

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,

+                            new Object[] { new Character(c)});

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_FATAL_ERROR,

+                                msg,

+                                MsgKey.ER_WF_INVALID_CHARACTER,

+                                null,

+                                null,

+                                null));

+                    }

+                } else if (c == '-' && i < datalength && dataarray[i] == '-') {

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_WF_DASH_IN_COMMENT,

+                            null);

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_FATAL_ERROR,

+                                msg,

+                                MsgKey.ER_WF_INVALID_CHARACTER,

+                                null,

+                                null,

+                                null));

+                    }

+                }

+            }

+        }

+        return;

+    }

+

+    /**

+     * Checks if an element node is well-formed, by checking its Name for well-formedness.

+     * 

+     * @param data The contents of the comment node

+     * @return a boolean indiacating if the comment is well-formed or not.

+     */

+    protected void isElementWellFormed(Node node) {

+        boolean isNameWF = false;

+        if ((fFeatures & NAMESPACES) != 0) {

+            isNameWF =

+                isValidQName(

+                    node.getPrefix(),

+                    node.getLocalName(),

+                    fIsXMLVersion11);

+        } else {

+            isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11);

+        }

+

+        if (!isNameWF) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                    new Object[] { "Element", node.getNodeName()});

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                        null,

+                        null,

+                        null));

+            }

+        }

+    }

+

+    /**

+     * Checks if an attr node is well-formed, by checking it's Name and value

+     * for well-formedness.

+     * 

+     * @param data The contents of the comment node

+     * @return a boolean indiacating if the comment is well-formed or not.

+     */

+    protected void isAttributeWellFormed(Node node) {

+        boolean isNameWF = false;

+        if ((fFeatures & NAMESPACES) != 0) {

+            isNameWF =

+                isValidQName(

+                    node.getPrefix(),

+                    node.getLocalName(),

+                    fIsXMLVersion11);

+        } else {

+            isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11);

+        }

+

+        if (!isNameWF) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                    new Object[] { "Attr", node.getNodeName()});

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                        null,

+                        null,

+                        null));

+            }

+        }

+

+        // Check the Attr's node value

+        // WFC: No < in Attribute Values

+        String value = node.getNodeValue();

+        if (value.indexOf('<') >= 0) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_LT_IN_ATTVAL,

+                    new Object[] {

+                        ((Attr) node).getOwnerElement().getNodeName(),

+                        node.getNodeName()});

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_LT_IN_ATTVAL,

+                        null,

+                        null,

+                        null));

+            }

+        }

+

+        // we need to loop through the children of attr nodes and check their values for

+        // well-formedness  

+        NodeList children = node.getChildNodes();

+        for (int i = 0; i < children.getLength(); i++) {

+            Node child = children.item(i);

+            // An attribute node with no text or entity ref child for example

+            // doc.createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns");

+            // followes by

+            // element.setAttributeNodeNS(attribute);

+            // can potentially lead to this situation.  If the attribute

+            // was a prefix Namespace attribute declaration then then DOM Core 

+            // should have some exception defined for this.

+            if (child == null) {

+                // we should probably report an error

+                continue;

+            }

+            switch (child.getNodeType()) {

+                case Node.TEXT_NODE :

+                    isTextWellFormed((Text) child);

+                    break;

+                case Node.ENTITY_REFERENCE_NODE :

+                    isEntityReferneceWellFormed((EntityReference) child);

+                    break;

+                default :

+            }

+        }

+

+        // TODO:

+        // WFC: Check if the attribute prefix is bound to 

+        // http://www.w3.org/2000/xmlns/  

+

+        // WFC: Unique Att Spec

+        // Perhaps pass a seen boolean value to this method.  serializeAttList will determine

+        // if the attr was seen before.

+    }

+

+    /**

+     * Checks if a PI node is well-formed, by checking it's Name and data

+     * for well-formedness.

+     * 

+     * @param data The contents of the comment node

+     */

+    protected void isPIWellFormed(ProcessingInstruction node) {

+        // Is the PI Target a valid XML name

+        if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                    new Object[] { "ProcessingInstruction", node.getTarget()});

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                        null,

+                        null,

+                        null));

+            }

+        }

+

+        // Does the PI Data carry valid XML characters

+

+        // REVISIT: Should we check if the PI DATA contains a ?> ???

+        Character invalidChar = isWFXMLChar(node.getData());

+        if (invalidChar != null) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,

+                    new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) });

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_INVALID_CHARACTER,

+                        null,

+                        null,

+                        null));

+            }

+        }

+    }

+

+    /**

+     * Checks if an CDATASection node is well-formed, by checking it's data

+     * for well-formedness.  Note that the presence of a CDATA termination mark

+     * in the contents of a CDATASection is handled by the parameter 

+     * spli-cdata-sections

+     * 

+     * @param data The contents of the comment node

+     */

+    protected void isCDATASectionWellFormed(CDATASection node) {

+        // Does the data valid XML character data        

+        Character invalidChar = isWFXMLChar(node.getData());

+        //if (!isWFXMLChar(node.getData(), invalidChar)) {

+        if (invalidChar != null) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,

+                    new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) });

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_INVALID_CHARACTER,

+                        null,

+                        null,

+                        null));

+            }

+        }

+    }

+

+    /**

+     * Checks if an Text node is well-formed, by checking if it contains invalid

+     * XML characters.

+     * 

+     * @param data The contents of the comment node

+     */

+    protected void isTextWellFormed(Text node) {

+        // Does the data valid XML character data        

+    	Character invalidChar = isWFXMLChar(node.getData());

+    	if (invalidChar != null) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,

+                    new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) });

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_INVALID_CHARACTER,

+                        null,

+                        null,

+                        null));

+            }

+        }

+    }

+

+    /**

+     * Checks if an EntityRefernece node is well-formed, by checking it's node name.  Then depending

+     * on whether it is referenced in Element content or in an Attr Node, checks if the EntityReference

+     * references an unparsed entity or a external entity and if so throws raises the 

+     * appropriate well-formedness error.  

+     * 

+     * @param data The contents of the comment node

+     * @parent The parent of the EntityReference Node

+     */

+    protected void isEntityReferneceWellFormed(EntityReference node) {

+        // Is the EntityReference name a valid XML name

+        if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) {

+            String msg =

+                Utils.messages.createMessage(

+                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                    new Object[] { "EntityReference", node.getNodeName()});

+

+            if (fErrorHandler != null) {

+                fErrorHandler.handleError(

+                    new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR,

+                        msg,

+                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                        null,

+                        null,

+                        null));

+            }

+        }

+

+        // determine the parent node

+        Node parent = node.getParentNode();

+

+        // Traverse the declared entities and check if the nodeName and namespaceURI

+        // of the EntityReference matches an Entity.  If so, check the if the notationName

+        // is not null, if so, report an error.

+        DocumentType docType = node.getOwnerDocument().getDoctype();

+        if (docType != null) {

+            NamedNodeMap entities = docType.getEntities();

+            for (int i = 0; i < entities.getLength(); i++) {

+                Entity ent = (Entity) entities.item(i);

+

+                String nodeName =

+                    node.getNodeName() == null ? "" : node.getNodeName();

+                String nodeNamespaceURI =

+                    node.getNamespaceURI() == null

+                        ? ""

+                        : node.getNamespaceURI();

+                String entName =

+                    ent.getNodeName() == null ? "" : ent.getNodeName();

+                String entNamespaceURI =

+                    ent.getNamespaceURI() == null ? "" : ent.getNamespaceURI();

+                // If referenced in Element content

+                // WFC: Parsed Entity

+                if (parent.getNodeType() == Node.ELEMENT_NODE) {

+                    if (entNamespaceURI.equals(nodeNamespaceURI)

+                        && entName.equals(nodeName)) {

+

+                        if (ent.getNotationName() != null) {

+                            String msg =

+                                Utils.messages.createMessage(

+                                    MsgKey.ER_WF_REF_TO_UNPARSED_ENT,

+                                    new Object[] { node.getNodeName()});

+

+                            if (fErrorHandler != null) {

+                                fErrorHandler.handleError(

+                                    new DOMErrorImpl(

+                                        DOMError.SEVERITY_FATAL_ERROR,

+                                        msg,

+                                        MsgKey.ER_WF_REF_TO_UNPARSED_ENT,

+                                        null,

+                                        null,

+                                        null));

+                            }

+                        }

+                    }

+                } // end if WFC: Parsed Entity

+

+                // If referenced in an Attr value

+                // WFC: No External Entity References

+                if (parent.getNodeType() == Node.ATTRIBUTE_NODE) {

+                    if (entNamespaceURI.equals(nodeNamespaceURI)

+                        && entName.equals(nodeName)) {

+

+                        if (ent.getPublicId() != null

+                            || ent.getSystemId() != null

+                            || ent.getNotationName() != null) {

+                            String msg =

+                                Utils.messages.createMessage(

+                                    MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,

+                                    new Object[] { node.getNodeName()});

+

+                            if (fErrorHandler != null) {

+                                fErrorHandler.handleError(

+                                    new DOMErrorImpl(

+                                        DOMError.SEVERITY_FATAL_ERROR,

+                                        msg,

+                                        MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,

+                                        null,

+                                        null,

+                                        null));

+                            }

+                        }

+                    }

+                } //end if WFC: No External Entity References

+            }

+        }

+    } // isEntityReferneceWellFormed    

+

+    /**

+     * If the configuration parameter "namespaces" is set to true, this methods

+     * checks if an entity whose replacement text contains unbound namespace 

+     * prefixes is referenced in a location where there are no bindings for 

+     * the namespace prefixes and if so raises a LSException with the error-type

+     * "unbound-prefix-in-entity-reference"   

+     * 

+     * @param Node, The EntityReference nodes whose children are to be checked

+     */

+    protected void checkUnboundPrefixInEntRef(Node node) {

+        Node child, next;

+        for (child = node.getFirstChild(); child != null; child = next) {

+            next = child.getNextSibling();

+

+            if (child.getNodeType() == Node.ELEMENT_NODE) {

+

+                //If a NamespaceURI is not declared for the current

+                //node's prefix, raise a fatal error.

+                String prefix = child.getPrefix();

+                if (prefix != null

+                		&& fNSBinder.getURI(prefix) == null) {

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,

+                            new Object[] {

+                                node.getNodeName(),

+                                child.getNodeName(),

+                                prefix });

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_FATAL_ERROR,

+                                msg,

+                                MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,

+                                null,

+                                null,

+                                null));

+                    }

+                }

+

+                NamedNodeMap attrs = child.getAttributes();

+

+                for (int i = 0; i < attrs.getLength(); i++) {

+                    String attrPrefix = attrs.item(i).getPrefix();

+                    if (attrPrefix != null

+                    		&& fNSBinder.getURI(attrPrefix) == null) {

+                        String msg =

+                            Utils.messages.createMessage(

+                                MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,

+                                new Object[] {

+                                    node.getNodeName(),

+                                    child.getNodeName(),

+                                    attrs.item(i)});

+

+                        if (fErrorHandler != null) {

+                            fErrorHandler.handleError(

+                                new DOMErrorImpl(

+                                    DOMError.SEVERITY_FATAL_ERROR,

+                                    msg,

+                                    MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,

+                                    null,

+                                    null,

+                                    null));

+                        }

+                    }

+                }

+            }

+

+            if (child.hasChildNodes()) {

+                checkUnboundPrefixInEntRef(child);

+            }

+        }

+    }

+

+    // ***********************************************************************

+    // Namespace normalization

+    // ***********************************************************************

+    /**

+     * Records local namespace declarations, to be used for normalization later

+     * 

+     * @param Node, The element node, whose namespace declarations are to be recorded

+     */

+    protected void recordLocalNSDecl(Node node) {

+        NamedNodeMap atts = ((Element) node).getAttributes();

+        int length = atts.getLength();

+

+        for (int i = 0; i < length; i++) {

+            Node attr = atts.item(i);

+

+            String localName = attr.getLocalName();

+            String attrPrefix = attr.getPrefix();

+            String attrValue = attr.getNodeValue();

+            String attrNS = attr.getNamespaceURI();

+

+            localName =

+                localName == null

+                    || XMLNS_PREFIX.equals(localName) ? "" : localName;

+            attrPrefix = attrPrefix == null ? "" : attrPrefix;

+            attrValue = attrValue == null ? "" : attrValue;

+            attrNS = attrNS == null ? "" : attrNS;

+

+            // check if attribute is a namespace decl

+            if (XMLNS_URI.equals(attrNS)) {

+

+                // No prefix may be bound to http://www.w3.org/2000/xmlns/.

+                if (XMLNS_URI.equals(attrValue)) {

+                    String msg =

+                        Utils.messages.createMessage(

+                            MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,

+                            new Object[] { attrPrefix, XMLNS_URI });

+

+                    if (fErrorHandler != null) {

+                        fErrorHandler.handleError(

+                            new DOMErrorImpl(

+                                DOMError.SEVERITY_ERROR,

+                                msg,

+                                MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,

+                                null,

+                                null,

+                                null));

+                    }

+                } else {

+                    // store the namespace-declaration

+                	if (XMLNS_PREFIX.equals(attrPrefix) ) {

+                        // record valid decl

+                        if (attrValue.length() != 0) {

+                            fNSBinder.declarePrefix(localName, attrValue);

+                        } else {

+                            // Error; xmlns:prefix=""

+                        }

+                    } else { // xmlns

+                        // empty prefix is always bound ("" or some string)

+                        fNSBinder.declarePrefix("", attrValue);

+                    }

+                }

+                

+            }

+        }

+    }

+

+    /**

+     * Fixes an element's namespace

+     * 

+     * @param Node, The element node, whose namespace is to be fixed

+     */

+    protected void fixupElementNS(Node node) throws SAXException {

+        String namespaceURI = ((Element) node).getNamespaceURI();

+        String prefix = ((Element) node).getPrefix();

+        String localName = ((Element) node).getLocalName();

+

+        if (namespaceURI != null) {

+            //if ( Element's prefix/namespace pair (or default namespace,

+            // if no prefix) are within the scope of a binding )

+            prefix = prefix == null ? "" : prefix;

+            String inScopeNamespaceURI = fNSBinder.getURI(prefix);

+

+            if ((inScopeNamespaceURI != null

+                && inScopeNamespaceURI.equals(namespaceURI))) {

+                // do nothing, declaration in scope is inherited

+                

+            } else {

+                // Create a local namespace declaration attr for this namespace,

+                // with Element's current prefix (or a default namespace, if

+                // no prefix). If there's a conflicting local declaration

+                // already present, change its value to use this namespace.

+                

+                // Add the xmlns declaration attribute

+            	//fNSBinder.pushNamespace(prefix, namespaceURI, fElementDepth);

+                if ((fFeatures & NAMESPACEDECLS) != 0) {

+                    if ("".equals(prefix) || "".equals(namespaceURI)) {

+                    	((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, namespaceURI);

+                    } else {

+                    	((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX + ":" + prefix, namespaceURI);

+                    }

+                }

+                fLocalNSBinder.declarePrefix(prefix, namespaceURI);

+                fNSBinder.declarePrefix(prefix, namespaceURI);

+

+            } 

+        } else {

+            // Element has no namespace

+            // DOM Level 1

+            if (localName == null || "".equals(localName)) {

+                //  DOM Level 1 node!

+                String msg =

+                    Utils.messages.createMessage(

+                        MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,

+                        new Object[] { node.getNodeName()});

+

+                if (fErrorHandler != null) {

+                    fErrorHandler.handleError(

+                        new DOMErrorImpl(

+                            DOMError.SEVERITY_ERROR,

+                            msg,

+                            MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,

+                            null,

+                            null,

+                            null));

+                }

+            } else {

+            	namespaceURI = fNSBinder.getURI("");

+            	if (namespaceURI !=null && namespaceURI.length() > 0) {

+            	    ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, "");

+            		fLocalNSBinder.declarePrefix("", "");

+                    fNSBinder.declarePrefix("", "");

+            	}

+            }

+        }

+    }

+    /** 

+     * This table is a quick lookup of a property key (String) to the integer that

+     * is the bit to flip in the fFeatures field, so the integers should have

+     * values 1,2,4,8,16...

+     * 

+     */

+    private static final Hashtable s_propKeys = new Hashtable();

+    static {

+

+        // Initialize the mappings of property keys to bit values (Integer objects)

+        // or mappings to a String object "", which indicates we are interested

+        // in the property, but it does not have a simple bit value to flip

+

+        // cdata-sections

+        int i = CDATA;

+        Integer val = new Integer(i);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS,

+            val);

+

+        // comments

+        int i1 = COMMENTS;

+        val = new Integer(i1);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS,

+            val);

+

+        // element-content-whitespace

+        int i2 = ELEM_CONTENT_WHITESPACE;

+        val = new Integer(i2);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,

+            val);

+        int i3 = ENTITIES;

+

+        // entities

+        val = new Integer(i3);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES,

+            val);

+

+        // namespaces

+        int i4 = NAMESPACES;

+        val = new Integer(i4);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES,

+            val);

+

+        // namespace-declarations

+        int i5 = NAMESPACEDECLS;

+        val = new Integer(i5);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_NAMESPACE_DECLARATIONS,

+            val);

+

+        // split-cdata-sections

+        int i6 = SPLITCDATA;

+        val = new Integer(i6);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA,

+            val);

+

+        // discard-default-content	

+        int i7 = WELLFORMED;

+        val = new Integer(i7);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED,

+            val);

+

+        // discard-default-content	

+        int i8 = DISCARDDEFAULT;

+        val = new Integer(i8);

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT,

+            val);

+

+        // We are interested in these properties, but they don't have a simple

+        // bit value to deal with.

+        s_propKeys.put(

+            DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_FORMAT_PRETTY_PRINT,

+            "");

+        s_propKeys.put(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "");

+        s_propKeys.put(

+            DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION,

+            "");

+        s_propKeys.put(DOMConstants.S_XSL_OUTPUT_ENCODING, "");

+        s_propKeys.put(OutputPropertiesFactory.S_KEY_ENTITIES, "");

+    }

+

+    /**

+     * Initializes fFeatures based on the DOMConfiguration Parameters set.

+     *

+     * @param properties DOMConfiguraiton properties that were set and which are

+     * to be used while serializing the DOM. 

+     */

+    protected void initProperties(Properties properties) {

+

+        for (Enumeration keys = properties.keys(); keys.hasMoreElements();) {

+

+            final String key = (String) keys.nextElement();

+    

+            // caonical-form

+            // Other features will be enabled or disabled when this is set to true or false.

+

+            // error-handler; set via the constructor

+

+            // infoset

+            // Other features will be enabled or disabled when this is set to true

+

+            // A quick lookup for the given set of properties (cdata-sections ...)

+            final Object iobj = s_propKeys.get(key);

+            if (iobj != null) {

+                if (iobj instanceof Integer) {

+                    // Dealing with a property that has a simple bit value that

+                    // we need to set

+

+                    // cdata-sections			

+                    // comments

+                    // element-content-whitespace

+                    // entities

+                    // namespaces

+                    // namespace-declarations

+                    // split-cdata-sections

+                    // well-formed

+                    // discard-default-content

+                    final int BITFLAG = ((Integer) iobj).intValue();

+                    if ((properties.getProperty(key).endsWith("yes"))) {

+                        fFeatures = fFeatures | BITFLAG;

+                    } else {

+                        fFeatures = fFeatures & ~BITFLAG;

+                    }

+                } else {

+                    // We are interested in the property, but it is not

+                    // a simple bit that we need to set.

+

+                    if ((DOMConstants.S_DOM3_PROPERTIES_NS

+                        + DOMConstants.DOM_FORMAT_PRETTY_PRINT)

+                        .equals(key)) {

+                        // format-pretty-print; set internally on the serializers via xsl:output properties in LSSerializer

+                        if ((properties.getProperty(key).endsWith("yes"))) {

+                            fSerializer.setIndent(true);

+                            fSerializer.setIndentAmount(3);

+                        } else {

+                            fSerializer.setIndent(false);

+                        }

+                    } else if (

+                        (DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL).equals(

+                            key)) {

+                        // omit-xml-declaration; set internally on the serializers via xsl:output properties in LSSerializer

+                        if ((properties.getProperty(key).endsWith("yes"))) {

+                            fSerializer.setOmitXMLDeclaration(true);

+                        } else {

+                            fSerializer.setOmitXMLDeclaration(false);

+                        }

+                    } else if (

+                        (

+                            DOMConstants.S_XERCES_PROPERTIES_NS

+                                + DOMConstants.S_XML_VERSION).equals(

+                            key)) {

+                        // Retreive the value of the XML Version attribute via the xml-version

+                        String version = properties.getProperty(key);

+                        if ("1.1".equals(version)) {

+                            fIsXMLVersion11 = true;

+                            fSerializer.setVersion(version);

+                        } else {

+                            fSerializer.setVersion("1.0");

+                        }

+                    } else if (

+                        (DOMConstants.S_XSL_OUTPUT_ENCODING).equals(key)) {

+                        // Retreive the value of the XML Encoding attribute

+                        String encoding = properties.getProperty(key);

+                        if (encoding != null) {

+                            fSerializer.setEncoding(encoding);

+                        }

+                    } else if ((OutputPropertiesFactory.S_KEY_ENTITIES).equals(key)) {

+                        // Retreive the value of the XML Encoding attribute

+                        String entities = properties.getProperty(key);

+                        if (DOMConstants.S_XSL_VALUE_ENTITIES.equals(entities)) {

+                            fSerializer.setDTDEntityExpansion(false);

+                        }

+                    } else {

+                        // We shouldn't get here, ever, now what?

+                    }

+                }

+            }

+        }

+        // Set the newLine character to use

+        if (fNewLine != null) {

+            fSerializer.setOutputProperty(OutputPropertiesFactory.S_KEY_LINE_SEPARATOR,

+                    fNewLine.toString());

+        }

+    }

+

+} //TreeWalker

diff --git a/src/org/apache/xml/serializer/dom3/DOMConstants.java b/src/org/apache/xml/serializer/dom3/DOMConstants.java
new file mode 100644
index 0000000..dae4f59
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOMConstants.java
@@ -0,0 +1,134 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+/**

+ * DOM Constants used by the DOM Level 3 LSSerializer implementation.

+ *

+ * @xsl.usage internal

+ */

+final class DOMConstants {

+    //

+    // Constants: DOM Level 3 feature ids

+    //

+    public static final String DOM3_REC_URL = "http://www.w3.org/TR/DOM-Level-3-LS";

+

+    public static final String XERCES_URL = "http://xml.apache.org/xerces-2j";

+

+    // The namespace used to qualified DOM Level 3 DOMConfiguration parameters

+    public static final String S_DOM3_PROPERTIES_NS = "{"

+            + DOMConstants.DOM3_REC_URL + "}";

+

+    public static final String S_XERCES_PROPERTIES_NS = "{"

+            + DOMConstants.XERCES_URL + "}";

+

+    // xmlns namespaces 

+    private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";

+

+    // namespace prefix

+    private static final String XMLNS_PREFIX = "xmlns";

+

+    // ************************************************************************

+    // DOM Level 3 DOM Configuration parameter names

+    // ************************************************************************

+    // DOM Level 3 parameters defined in Core

+    public static final String DOM_CANONICAL_FORM = "canonical-form"; // Unsupported, we only appear to support this

+

+    public static final String DOM_CDATA_SECTIONS = "cdata-sections";

+

+    public static final String DOM_CHECK_CHAR_NORMALIZATION = "check-character-normalization"; // Unsupported

+

+    public static final String DOM_COMMENTS = "comments";

+

+    public static final String DOM_DATATYPE_NORMALIZATION = "datatype-normalization"; // Unsupported

+

+    public static final String DOM_ELEMENT_CONTENT_WHITESPACE = "element-content-whitespace";

+

+    public static final String DOM_ENTITIES = "entities";

+

+    public static final String DOM_INFOSET = "infoset";

+

+    public static final String DOM_NAMESPACES = "namespaces";

+

+    public static final String DOM_NAMESPACE_DECLARATIONS = "namespace-declarations";

+

+    public static final String DOM_NORMALIZE_CHARACTERS = "normalize-characters"; // Unsupported

+

+    public static final String DOM_SPLIT_CDATA = "split-cdata-sections";

+

+    public static final String DOM_VALIDATE_IF_SCHEMA = "validate-if-schema"; // Unsopported

+

+    public static final String DOM_VALIDATE = "validate"; // Unsopported

+

+    public static final String DOM_WELLFORMED = "well-formed";

+

+    // DOM Level 3 Save

+    public static final String DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content";

+

+    public static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print";

+

+    public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations"; // Unsupported

+

+    public static final String DOM_XMLDECL = "xml-declaration";

+

+    // DOM Properties

+    public static final String DOM_ERROR_HANDLER = "error-handler";

+

+    public static final String DOM_SCHEMA_TYPE = "schema-type"; // Unsupported

+

+    public static final String DOM_SCHEMA_LOCATION = "schema-location"; // Unsupported

+

+    // ************************************************************************

+

+    // XSL Output properties

+    // The xsl:output 'indent' property used in LSSerializer 

+    public static final String S_XSL_OUTPUT_INDENT = "indent";

+

+    // The xsl:output 'indent' property used in LSSerializer 

+    public static final String S_XSL_OUTPUT_ENCODING = "encoding";

+

+    // The xsl:output 'omit-xml-declaration' property used in LSSerializer 

+    public static final String S_XSL_OUTPUT_OMIT_XML_DECL = "omit-xml-declaration";

+

+    // The xerces serializer specific 'omit-xml-declaration' property used in LSSerializer 

+    public static final String S_XML_VERSION = "xml-version";

+

+    //     

+    public static final String S_XSL_VALUE_ENTITIES = "org/apache/xml/serializer/XMLEntities";

+    

+    // Parameter values

+    public static final String DOM3_EXPLICIT_TRUE = "explicit:yes";

+

+    public static final String DOM3_DEFAULT_TRUE = "default:yes";

+

+    public static final String DOM3_EXPLICIT_FALSE = "explicit:no";

+

+    public static final String DOM3_DEFAULT_FALSE = "default:no";

+

+    // DOM Exceptions

+    public static final String DOM_EXCEPTION_FEATURE_NOT_FOUND = "FEATURE_NOT_FOUND";

+

+    public static final String DOM_EXCEPTION_FEATURE_NOT_SUPPORTED = "FEATURE_NOT_SUPPORTED";

+

+    public static final String DOM_LSEXCEPTION_SERIALIZER_ERR = "SERIALIZER_ERROR";

+

+}

diff --git a/src/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java b/src/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java
new file mode 100644
index 0000000..fd88266
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java
@@ -0,0 +1,67 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import org.w3c.dom.DOMError;

+import org.w3c.dom.DOMErrorHandler;

+

+/**

+ * This is the default implementation of the ErrorHandler interface and is 

+ * used if one is not provided.  The default implementation simply reports

+ * DOMErrors to System.err.

+ * 

+ * @xsl.usage internal

+ */

+final class DOMErrorHandlerImpl implements DOMErrorHandler {

+    

+    /**

+     * Default Constructor 

+     */

+    DOMErrorHandlerImpl() {

+    }

+    

+    /**

+     * Implementation of DOMErrorHandler.handleError that

+     * adds copy of error to list for later retrieval.

+     *

+     */

+    public boolean handleError(DOMError error) {

+        boolean fail = true;

+        String severity = null;

+        if (error.getSeverity() == DOMError.SEVERITY_WARNING) {

+            fail = false;

+            severity = "[Warning]";

+        } else if (error.getSeverity() == DOMError.SEVERITY_ERROR) {

+            severity = "[Error]";

+        } else if (error.getSeverity() == DOMError.SEVERITY_FATAL_ERROR) {

+            severity = "[Fatal Error]";

+        }

+        

+        System.err.println(severity + ": " + error.getMessage() + "\t");

+        System.err.println("Type : " + error.getType() + "\t" + "Related Data: "

+                + error.getRelatedData() + "\t" + "Related Exception: "

+                + error.getRelatedException() );

+        

+        return fail;

+    }

+}

+

diff --git a/src/org/apache/xml/serializer/dom3/DOMErrorImpl.java b/src/org/apache/xml/serializer/dom3/DOMErrorImpl.java
new file mode 100644
index 0000000..81eda73
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOMErrorImpl.java
@@ -0,0 +1,176 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import org.w3c.dom.DOMError;

+import org.w3c.dom.DOMLocator;

+

+/**

+ * Implementation of the DOM Level 3 DOMError interface.

+ *

+ * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ERROR-Interfaces-DOMError'>DOMError Interface definition from Document Object Model (DOM) Level 3 Core Specification</a>.

+ * 

+ * @xsl.usage internal 

+ */

+

+final class DOMErrorImpl implements DOMError {

+    

+    /** private data members */

+    

+    // The DOMError Severity

+    private short fSeverity = DOMError.SEVERITY_WARNING;

+    

+    // The Error message

+    private String fMessage = null;

+    

+    //  A String indicating which related data is expected in relatedData. 

+    private String fType;

+    

+    // The platform related exception

+    private Exception fException = null;

+    

+    //  

+    private Object fRelatedData;

+    

+    // The location of the exception

+    private DOMLocatorImpl fLocation = new DOMLocatorImpl();

+    

+    

+    //

+    // Constructors

+    //

+    

+    /** 

+     * Default constructor. 

+     */    

+    DOMErrorImpl () {

+    }

+    

+    /**

+     * @param severity

+     * @param message

+     * @param type

+     */

+    DOMErrorImpl(short severity, String message, String type) {

+        fSeverity = severity;

+        fMessage = message;

+        fType = type;

+    }

+    

+    /**

+     * @param severity

+     * @param message

+     * @param type

+     * @param exception

+     */

+    DOMErrorImpl(short severity, String message, String type,

+            Exception exception) {

+        fSeverity = severity;

+        fMessage = message;

+        fType = type;

+        fException = exception;

+    }

+    

+    /**

+     * @param severity

+     * @param message

+     * @param type

+     * @param exception

+     * @param relatedData

+     * @param location

+     */

+    DOMErrorImpl(short severity, String message, String type,

+            Exception exception, Object relatedData, DOMLocatorImpl location) {

+        fSeverity = severity;

+        fMessage = message;

+        fType = type;

+        fException = exception;

+        fRelatedData = relatedData;

+        fLocation = location;

+    }

+    

+    

+    /**

+     * The severity of the error, either <code>SEVERITY_WARNING</code>, 

+     * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.

+     * 

+     * @return A short containing the DOMError severity

+     */

+    public short getSeverity() {

+        return fSeverity;

+    }

+    

+    /**

+     * The DOMError message string.

+     * 

+     * @return String

+     */

+    public String getMessage() {

+        return fMessage;

+    }

+    

+    /**

+     * The location of the DOMError.

+     * 

+     * @return A DOMLocator object containing the DOMError location.

+     */

+    public DOMLocator getLocation() {

+        return fLocation;

+    }

+    

+    /**

+     * The related platform dependent exception if any.

+     * 

+     * @return A java.lang.Exception 

+     */

+    public Object getRelatedException(){

+        return fException;

+    }

+    

+    /**

+     * Returns a String indicating which related data is expected in relatedData.

+     * 

+     * @return A String

+     */

+    public String getType(){

+        return fType;

+    }

+    

+    /**

+     * The related DOMError.type dependent data if any.

+     * 

+     * @return java.lang.Object 

+     */

+    public Object getRelatedData(){

+        return fRelatedData;

+    }

+    

+    public void reset(){

+        fSeverity = DOMError.SEVERITY_WARNING; 

+        fException = null;

+        fMessage = null;

+        fType = null;

+        fRelatedData = null;

+        fLocation = null;        

+    }

+    

+}// class DOMErrorImpl

diff --git a/src/org/apache/xml/serializer/dom3/DOMLocatorImpl.java b/src/org/apache/xml/serializer/dom3/DOMLocatorImpl.java
new file mode 100644
index 0000000..8add00c
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOMLocatorImpl.java
@@ -0,0 +1,180 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import org.w3c.dom.DOMLocator;

+import org.w3c.dom.Node;

+

+

+/**

+ * <code>DOMLocatorImpl</code> is an implementaion that describes a location (e.g. 

+ * where an error occured).

+ * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.

+ * This class is a copy of the Xerces-2J class org.apache.xerces.dom.DOMLocatorImpl.java v 1.10 

+ *

+ * @author Gopal Sharma, SUN Microsystems Inc.

+ * @version $Id: 

+ * 

+ * @xsl.usage internal

+ */

+final class DOMLocatorImpl implements DOMLocator {

+    

+    //

+    // Data

+    //

+    

+    /**

+     * The column number where the error occured, 

+     * or -1 if there is no column number available.

+     */

+    private final int fColumnNumber;

+    

+    /**

+     * The line number where the error occured, 

+     * or -1 if there is no line number available.

+     */

+    private final int fLineNumber;

+    

+    /** related data node*/

+    private final Node fRelatedNode;

+    

+    /**

+     * The URI where the error occured, 

+     * or null if there is no URI available.

+     */

+    private final String fUri;

+    

+    /**

+     * The byte offset into the input source this locator is pointing to or -1 

+     * if there is no byte offset available

+     */

+    private final int fByteOffset;

+    

+    /**

+     * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], 

+     * offset into the input source this locator is pointing to or -1 if there 

+     * is no UTF-16 offset available.

+     */

+    private final int fUtf16Offset;

+    

+    //

+    // Constructors

+    //

+    

+    DOMLocatorImpl(){

+        fColumnNumber = -1;

+        fLineNumber = -1;

+        fRelatedNode = null;

+        fUri = null;

+        fByteOffset = -1;

+        fUtf16Offset = -1;

+    }

+    

+    DOMLocatorImpl (int lineNumber, int columnNumber, String uri ){

+        fLineNumber = lineNumber ;

+        fColumnNumber = columnNumber ;

+        fUri = uri;

+        

+        fRelatedNode = null;

+        fByteOffset = -1;

+        fUtf16Offset = -1;

+    } // DOMLocatorImpl (int lineNumber, int columnNumber, String uri )

+    

+    DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri ){

+        fLineNumber = lineNumber ;

+        fColumnNumber = columnNumber ;

+        fUri = uri;

+        fUtf16Offset = utf16Offset;

+        

+

+        fRelatedNode = null;

+        fByteOffset = -1;

+    } // DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri )

+    

+    DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri ){

+        fLineNumber = lineNumber ;

+        fColumnNumber = columnNumber ;

+        fByteOffset = byteoffset ;

+        fRelatedNode = relatedData ;

+        fUri = uri;

+        

+        fUtf16Offset = -1;

+    } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri )

+    

+    DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri, int utf16Offset ){

+        fLineNumber = lineNumber ;

+        fColumnNumber = columnNumber ;

+        fByteOffset = byteoffset ;

+        fRelatedNode = relatedData ;

+        fUri = uri;

+        fUtf16Offset = utf16Offset;

+    } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri )

+    

+    

+    /**

+     * The line number where the error occured, or -1 if there is no line 

+     * number available.

+     */

+    public int getLineNumber(){

+        return fLineNumber;

+    }

+    

+    /**

+     * The column number where the error occured, or -1 if there is no column 

+     * number available.

+     */

+    public int getColumnNumber(){

+        return fColumnNumber;

+    }

+    

+    

+    /**

+     * The URI where the error occured, or null if there is no URI available.

+     */

+    public String getUri(){

+        return fUri;

+    }

+    

+    

+    public Node getRelatedNode(){

+        return fRelatedNode;

+    }

+    

+    

+    /**

+     * The byte offset into the input source this locator is pointing to or -1 

+     * if there is no byte offset available

+     */

+    public int getByteOffset(){

+        return fByteOffset;

+    }

+    

+    /**

+     * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], 

+     * offset into the input source this locator is pointing to or -1 if there 

+     * is no UTF-16 offset available.

+     */

+    public int getUtf16Offset(){

+        return fUtf16Offset;

+    }

+    

+}// class DOMLocatorImpl

diff --git a/src/org/apache/xml/serializer/dom3/DOMOutputImpl.java b/src/org/apache/xml/serializer/dom3/DOMOutputImpl.java
new file mode 100644
index 0000000..54327c0
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOMOutputImpl.java
@@ -0,0 +1,177 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import org.w3c.dom.ls.LSOutput;

+

+import java.io.Writer;

+import java.io.OutputStream;

+

+/**

+ * This is a copy of the Xerces-2J class org.apache.xerces.dom.DOMOutputImpl.java

+ * 

+ * This class represents an output destination for data.

+ * This interface allows an application to encapsulate information about an

+ * output destination in a single object, which may include a URI, a byte stream

+ * (possibly with a specifiedencoding), a base URI, and/or a character stream.

+ * The exact definitions of a byte stream and a character stream are binding

+ * dependent.

+ * The application is expected to provide objects that implement this interface

+ * whenever such objects are needed. The application can either provide its

+ * own objects that implement this interface, or it can use the generic factory

+ * method DOMImplementationLS.createLSOutput() to create objects that

+ * implement this interface.

+ * The DOMSerializer will use the LSOutput object to determine where to

+ * serialize the output to. The DOMSerializer will look at the different

+ * outputs specified in the LSOutput in the following order to know which one

+ * to output to, the first one that data can be output to will be used:

+ * 1.LSOutput.characterStream

+ * 2.LSOutput.byteStream

+ * 3.LSOutput.systemId

+ * LSOutput objects belong to the application. The DOM implementation will

+ * never modify them (though it may make copies and modify the copies,

+ * if necessary).

+ *

+ *

+ * @author Arun Yadav, Sun Microsytems

+ * @author Gopal Sharma, Sun Microsystems

+ * @version $Id : 

+ * @xsl.usage internal 

+ */

+

+final class DOMOutputImpl implements LSOutput {

+    

+    private Writer fCharStream = null;

+    private OutputStream fByteStream = null;

+    private String fSystemId = null;

+    private String fEncoding = null;

+    

+    /**

+     * Default Constructor

+     */

+    DOMOutputImpl() {}

+    

+    /**

+     * An attribute of a language and binding dependent type that represents a

+     * writable stream of bytes. If the application knows the character encoding

+     * of the byte stream, it should set the encoding attribute. Setting the

+     * encoding in this way will override any encoding specified in an XML

+     * declaration in the data.

+     */

+    

+    public Writer getCharacterStream(){

+        return fCharStream;

+    };

+    

+    /**

+     * An attribute of a language and binding dependent type that represents a

+     * writable stream of bytes. If the application knows the character encoding

+     * of the byte stream, it should set the encoding attribute. Setting the

+     * encoding in this way will override any encoding specified in an XML

+     * declaration in the data.

+     */

+    

+    public void setCharacterStream(Writer characterStream){

+        fCharStream = characterStream;

+    };

+    

+    /**

+     * Depending on the language binding in use, this attribute may not be

+     * available. An attribute of a language and binding dependent type that

+     * represents a writable stream to which 16-bit units can be output. The

+     * application must encode the stream using UTF-16 (defined in [Unicode] and

+     *  Amendment 1 of [ISO/IEC 10646]).

+     */

+    

+    public OutputStream getByteStream(){

+        return fByteStream;

+    };

+    

+    /**

+     * Depending on the language binding in use, this attribute may not be

+     * available. An attribute of a language and binding dependent type that

+     * represents a writable stream to which 16-bit units can be output. The

+     * application must encode the stream using UTF-16 (defined in [Unicode] and

+     *  Amendment 1 of [ISO/IEC 10646]).

+     */

+    

+    public void setByteStream(OutputStream byteStream){

+        fByteStream = byteStream;

+    };

+    

+    /**

+     * The system identifier, a URI reference [IETF RFC 2396], for this output

+     *  destination. If the application knows the character encoding of the

+     *  object pointed to by the system identifier, it can set the encoding

+     *  using the encoding attribute. If the system ID is a relative URI

+     *  reference (see section 5 in [IETF RFC 2396]), the behavior is

+     *  implementation dependent.

+     */

+    

+    public String getSystemId(){

+        return fSystemId;

+    };

+    

+    /**

+     * The system identifier, a URI reference [IETF RFC 2396], for this output

+     *  destination. If the application knows the character encoding of the

+     *  object pointed to by the system identifier, it can set the encoding

+     *  using the encoding attribute. If the system ID is a relative URI

+     *  reference (see section 5 in [IETF RFC 2396]), the behavior is

+     *  implementation dependent.

+     */

+    

+    public void setSystemId(String systemId){

+        fSystemId = systemId;

+    };

+    

+    /**

+     * The character encoding, if known. The encoding must be a string

+     * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3

+     * "Character Encoding in Entities"). This attribute has no effect when the

+     * application provides a character stream or string data. For other sources

+     * of input, an encoding specified by means of this attribute will override

+     * any encoding specified in the XML declaration or the Text declaration, or

+     * an encoding obtained from a higher level protocol, such as HTTP

+     * [IETF RFC 2616].

+     */

+    

+    public String getEncoding(){

+        return fEncoding;

+    };

+    

+    /**

+     * The character encoding, if known. The encoding must be a string

+     * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3

+     * "Character Encoding in Entities"). This attribute has no effect when the

+     * application provides a character stream or string data. For other sources

+     * of input, an encoding specified by means of this attribute will override

+     * any encoding specified in the XML declaration or the Text declaration, or

+     * an encoding obtained from a higher level protocol, such as HTTP

+     * [IETF RFC 2616].

+     */

+    

+    public void setEncoding(String encoding){

+        fEncoding = encoding;

+    };

+    

+}//DOMOutputImpl

diff --git a/src/org/apache/xml/serializer/dom3/DOMStringListImpl.java b/src/org/apache/xml/serializer/dom3/DOMStringListImpl.java
new file mode 100644
index 0000000..5ace83a
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/DOMStringListImpl.java
@@ -0,0 +1,99 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+package org.apache.xml.serializer.dom3;

+

+import java.util.Vector;

+

+//import org.apache.xerces.dom3.DOMStringList;

+import org.w3c.dom.DOMStringList;

+

+/**

+ * This class implemets the DOM Level 3 Core interface DOMStringList.

+ * 

+ * @xsl.usage internal

+ */

+final class DOMStringListImpl implements DOMStringList {

+    

+    //A collection of DOMString values

+    private Vector fStrings;

+    

+    /** 

+     * Construct an empty list of DOMStringListImpl

+     */ 

+    DOMStringListImpl() {

+        fStrings = new Vector();    

+    }

+    

+    /** 

+     * Construct an empty list of DOMStringListImpl

+     */ 

+    DOMStringListImpl(Vector params) {

+        fStrings = params;    

+    }

+    

+    /** 

+     * Construct an empty list of DOMStringListImpl

+     */ 

+    DOMStringListImpl(String[] params ) {

+        fStrings = new Vector();

+        if (params != null) {

+            for (int i=0; i < params.length; i++) {

+                fStrings.add(params[i]);    

+            }

+        }

+    }

+    

+    /**

+     * @see org.apache.xerces.dom3.DOMStringList#item(int)

+     */

+    public String item(int index) {

+        try {

+            return (String) fStrings.elementAt(index);

+        } catch (ArrayIndexOutOfBoundsException e) {

+            return null;

+        }

+    }

+    

+    /**

+     * @see org.apache.xerces.dom3.DOMStringList#getLength()

+     */

+    public int getLength() {

+        return fStrings.size();

+    }

+    

+    /**

+     * @see org.apache.xerces.dom3.DOMStringList#contains(String)

+     */

+    public boolean contains(String param) {

+        return fStrings.contains(param) ;

+    }

+    

+    /**

+     * DOM Internal:

+     * Add a <code>DOMString</code> to the list.

+     * 

+     * @param domString A string to add to the list

+     */

+    public void add(String param) {

+        fStrings.add(param);

+    }

+    

+}

diff --git a/src/org/apache/xml/serializer/dom3/LSSerializerImpl.java b/src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
new file mode 100644
index 0000000..ac76c50
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
@@ -0,0 +1,1390 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import java.io.File;

+import java.io.FileOutputStream;

+import java.io.OutputStream;

+import java.io.OutputStreamWriter;

+import java.io.StringWriter;

+import java.io.UnsupportedEncodingException;

+import java.io.Writer;

+import java.net.HttpURLConnection;

+import java.net.URL;

+import java.net.URLConnection;

+import java.util.Properties;

+

+import org.apache.xml.serializer.DOM3Serializer;

+import org.apache.xml.serializer.Encodings;

+import org.apache.xml.serializer.Serializer;

+import org.apache.xml.serializer.OutputPropertiesFactory;

+import org.apache.xml.serializer.SerializerFactory;

+import org.apache.xml.serializer.utils.MsgKey;

+import org.apache.xml.serializer.utils.Utils;

+import org.apache.xml.serializer.utils.SystemIDResolver;

+import org.w3c.dom.DOMConfiguration;

+import org.w3c.dom.DOMError;

+import org.w3c.dom.DOMErrorHandler;

+import org.w3c.dom.DOMException;

+import org.w3c.dom.DOMStringList;

+import org.w3c.dom.Document;

+import org.w3c.dom.Node;

+import org.w3c.dom.ls.LSException;

+import org.w3c.dom.ls.LSOutput;

+import org.w3c.dom.ls.LSSerializer;

+import org.w3c.dom.ls.LSSerializerFilter;

+

+

+/**

+ * Implemenatation of DOM Level 3 org.w3c.ls.LSSerializer and 

+ * org.w3c.dom.ls.DOMConfiguration.  Serialization is achieved by delegating 

+ * serialization calls to <CODE>org.apache.xml.serializer.ToStream</CODE> or 

+ * one of its derived classes depending on the serialization method, while walking

+ * the DOM in DOM3TreeWalker.  

+ * @see <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer">org.w3c.dom.ls.LSSerializer</a>

+ * @see <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMConfiguration">org.w3c.dom.DOMConfiguration</a>

+ *  

+ * @version $Id:  

+ * 

+ * @xsl.usage internal 

+ */

+final public class LSSerializerImpl implements DOMConfiguration, LSSerializer {

+    

+    /** private data members */

+    private Serializer fXMLSerializer = null;

+    

+    // Tracks DOMConfiguration features. 

+    protected int fFeatures = 0;

+    

+    // Common DOM serializer

+    private  DOM3Serializer fDOMSerializer = null;

+    

+    // A filter set on the LSSerializer

+    private LSSerializerFilter fSerializerFilter = null;  

+    

+    // Stores the nodeArg parameter to speed up multiple writes of the same node.

+    private Node fVisitedNode = null;

+    

+    // The end-of-line character sequence used in serialization.  "\n" is whats used on the web.

+    private String fEndOfLine = System.getProperty("line.separator") != null ? System.getProperty("line.separator"): "\n";

+    

+    // The DOMErrorhandler.

+    private DOMErrorHandler fDOMErrorHandler = null;

+    

+    // The Configuration parameter to pass to the Underlying serilaizer.

+    private Properties fDOMConfigProperties = null;

+    

+    // The encoding to use during serialization.

+    private String fEncoding; 

+	

+    // ************************************************************************

+    // DOM Level 3 DOM Configuration parameter names

+    // ************************************************************************    

+    // Parameter canonical-form, true [optional] - NOT SUPPORTED 

+    private final static int CANONICAL = 0x1 << 0;

+    

+    // Parameter cdata-sections, true [required] (default)

+    private final static int CDATA = 0x1 << 1;

+    

+    // Parameter check-character-normalization, true [optional] - NOT SUPPORTED 

+    private final static int CHARNORMALIZE = 0x1 << 2;

+    

+    // Parameter comments, true [required] (default)

+    private final static int COMMENTS = 0x1 << 3;

+    

+    // Parameter datatype-normalization, true [optional] - NOT SUPPORTED

+    private final static int DTNORMALIZE = 0x1 << 4;    

+    

+    // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED

+    private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5;

+    

+    // Parameter entities, true [required] (default)

+    private final static int ENTITIES = 0x1 << 6;

+    

+    // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer

+    private final static int INFOSET = 0x1 << 7;

+    

+    // Parameter namespaces, true [required] (default)

+    private final static int NAMESPACES = 0x1 << 8;

+    

+    // Parameter namespace-declarations, true [required] (default)

+    private final static int NAMESPACEDECLS = 0x1 << 9;

+    

+    // Parameter normalize-characters, true [optional] - NOT SUPPORTED

+    private final static int NORMALIZECHARS = 0x1 << 10;

+    

+    // Parameter split-cdata-sections, true [required] (default)

+    private final static int SPLITCDATA = 0x1 << 11;   

+    

+    // Parameter validate, true [optional] - NOT SUPPORTED

+    private final static int VALIDATE = 0x1 << 12;   

+    

+    // Parameter validate-if-schema, true [optional] - NOT SUPPORTED

+    private final static int SCHEMAVALIDATE = 0x1 << 13;

+    

+    // Parameter split-cdata-sections, true [required] (default)

+    private final static int WELLFORMED = 0x1 << 14;   

+    

+    // Parameter discard-default-content, true [required] (default)

+    // Not sure how this will be used in level 2 Documents

+    private final static int DISCARDDEFAULT = 0x1 << 15;       

+    

+    // Parameter format-pretty-print, true [optional] 

+    private final static int PRETTY_PRINT = 0x1 << 16;

+    

+    // Parameter ignore-unknown-character-denormalizations, true [required] (default)

+    // We currently do not support XML 1.1 character normalization

+    private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17;

+    

+    // Parameter discard-default-content, true [required] (default)

+    private final static int XMLDECL = 0x1 << 18;    

+    // ************************************************************************

+    

+    // Recognized parameters for which atleast one value can be set

+    private String fRecognizedParameters [] = {

+            DOMConstants.DOM_CANONICAL_FORM,

+            DOMConstants.DOM_CDATA_SECTIONS,

+            DOMConstants.DOM_CHECK_CHAR_NORMALIZATION,

+            DOMConstants.DOM_COMMENTS,

+            DOMConstants.DOM_DATATYPE_NORMALIZATION,

+            DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,

+            DOMConstants.DOM_ENTITIES,

+            DOMConstants.DOM_INFOSET,

+            DOMConstants.DOM_NAMESPACES,

+            DOMConstants.DOM_NAMESPACE_DECLARATIONS,

+            //DOMConstants.DOM_NORMALIZE_CHARACTERS,

+            DOMConstants.DOM_SPLIT_CDATA,

+            DOMConstants.DOM_VALIDATE,

+            DOMConstants.DOM_VALIDATE_IF_SCHEMA,

+            DOMConstants.DOM_WELLFORMED,

+            DOMConstants.DOM_DISCARD_DEFAULT_CONTENT,

+            DOMConstants.DOM_FORMAT_PRETTY_PRINT,

+            DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS,

+            DOMConstants.DOM_XMLDECL,

+            DOMConstants.DOM_ERROR_HANDLER

+    };

+    

+    

+    /**

+     * Constructor:  Creates a LSSerializerImpl object.  The underlying

+     * XML 1.0 or XML 1.1 org.apache.xml.serializer.Serializer object is

+     * created and initialized the first time any of the write methods are  

+     * invoked to serialize the Node.  Subsequent write methods on the same

+     * LSSerializerImpl object will use the previously created Serializer object.

+     */

+    public LSSerializerImpl () {

+        // set default parameters

+        fFeatures |= CDATA;

+        fFeatures |= COMMENTS;

+        fFeatures |= ELEM_CONTENT_WHITESPACE;

+        fFeatures |= ENTITIES;

+        fFeatures |= NAMESPACES;

+        fFeatures |= NAMESPACEDECLS;

+        fFeatures |= SPLITCDATA;

+        fFeatures |= WELLFORMED;

+        fFeatures |= DISCARDDEFAULT;

+        fFeatures |= XMLDECL;

+        

+        // New OutputFormat properties

+        fDOMConfigProperties = new Properties();

+        

+        // Initialize properties to be passed on the underlying serializer

+        initializeSerializerProps();

+        

+        // Create the underlying serializer.

+        Properties  configProps = OutputPropertiesFactory.getDefaultMethodProperties("xml");

+        

+        // change xml version from 1.0 to 1.1

+        //configProps.setProperty("version", "1.1");

+        

+        // Get a serializer that seriailizes according the the properties,

+        // which in this case is to xml

+        fXMLSerializer = SerializerFactory.getSerializer(configProps);

+        

+        // Initialize Serializer

+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);

+    }

+    

+    /**

+     * Initializes the underlying serializer's configuration depending on the

+     * default DOMConfiguration parameters. This method must be called before a

+     * node is to be serialized.

+     * 

+     * @xsl.usage internal

+     */

+    public void initializeSerializerProps () {

+        // canonical-form

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_DEFAULT_FALSE);

+        

+        // cdata-sections

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // "check-character-normalization"

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION,

+                DOMConstants.DOM3_DEFAULT_FALSE);

+        

+        // comments

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // datatype-normalization

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_DATATYPE_NORMALIZATION,

+                DOMConstants.DOM3_DEFAULT_FALSE);

+        

+        // element-content-whitespace

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,

+                DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // entities

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_TRUE);

+        // preserve entities

+        fDOMConfigProperties.setProperty(

+                OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES);

+

+        // error-handler

+        // Should we set our default ErrorHandler

+        /*

+         * if (fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER) != null) {

+         * fDOMErrorHandler =

+         * (DOMErrorHandler)fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER); }

+         */

+        

+        // infoset

+        if ((fFeatures & INFOSET) != 0) {

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE);

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_NAMESPACE_DECLARATIONS,

+                    DOMConstants.DOM3_DEFAULT_TRUE);

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE);

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE,

+                    DOMConstants.DOM3_DEFAULT_TRUE);

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE);

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_FALSE);

+            // preserve entities

+            fDOMConfigProperties.setProperty(

+                    OutputPropertiesFactory.S_KEY_ENTITIES, "");

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_CDATA_SECTIONS,

+                    DOMConstants.DOM3_DEFAULT_FALSE);

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_VALIDATE_IF_SCHEMA,

+                    DOMConstants.DOM3_DEFAULT_FALSE);

+            fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                    + DOMConstants.DOM_DATATYPE_NORMALIZATION,

+                    DOMConstants.DOM3_DEFAULT_FALSE);

+        }

+        

+        // namespaces

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // namespace-declarations

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_NAMESPACE_DECLARATIONS,

+                DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // normalize-characters

+        /*

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_NORMALIZE_CHARACTERS,

+                DOMConstants.DOM3_DEFAULT_FALSE);

+        */

+        

+        // split-cdata-sections

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // validate

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_DEFAULT_FALSE);

+        

+        // validate-if-schema

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_VALIDATE_IF_SCHEMA,

+                DOMConstants.DOM3_DEFAULT_FALSE);

+        

+        // well-formed

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // pretty-print

+        fDOMConfigProperties.setProperty(

+                DOMConstants.S_XSL_OUTPUT_INDENT,

+                DOMConstants.DOM3_DEFAULT_TRUE);

+        fDOMConfigProperties.setProperty(

+                OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(3));

+        

+        // 

+        

+        // discard-default-content

+        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS

+                + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT,

+                DOMConstants.DOM3_DEFAULT_TRUE);

+        

+        // xml-declaration

+        fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no");

+        

+    }    

+    

+    // ************************************************************************

+    // DOMConfiguraiton implementation

+    // ************************************************************************

+    

+    /** 

+     * Checks if setting a parameter to a specific value is supported.    

+     *  

+     * @see org.w3c.dom.DOMConfiguration#canSetParameter(java.lang.String, java.lang.Object)

+     * @since DOM Level 3

+     * @param name A String containing the DOMConfiguration parameter name.

+     * @param value An Object specifying the value of the corresponding parameter. 

+     */

+    public boolean canSetParameter(String name, Object value) {

+        if (value instanceof Boolean){

+            if ( name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)    

+                    || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)    

+                    || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)                

+                    || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)){

+                // both values supported

+                return true;

+            }

+            else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)

+                    // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)

+                    ) {

+                // true is not supported

+                return !((Boolean)value).booleanValue();

+            }

+            else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {

+                // false is not supported

+                return ((Boolean)value).booleanValue();

+            }

+        }

+        else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) &&

+                value == null || value instanceof DOMErrorHandler){

+            return true;

+        }

+        return false;

+    }

+    /**

+     * This method returns the value of a parameter if known.

+     * 

+     * @see org.w3c.dom.DOMConfiguration#getParameter(java.lang.String)

+     * 

+     * @param name A String containing the DOMConfiguration parameter name 

+     *             whose value is to be returned.

+     * @return Object The value of the parameter if known. 

+     */

+    public Object getParameter(String name) throws DOMException {

+        if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) {

+            return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) {

+            return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) {

+            return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) {

+            return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) {

+            return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) {

+            return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) {

+            return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        }  else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) {

+            return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) {

+            return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) {

+            return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) {

+            return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) {

+            return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {

+            return Boolean.TRUE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)

+                || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION)

+                || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) 

+                // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)                

+                || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)

+                || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) {

+            return Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){

+            if ((fFeatures & ENTITIES) == 0 &&

+                    (fFeatures & CDATA) == 0 &&

+                    (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 &&

+                    (fFeatures & NAMESPACES) != 0 &&

+                    (fFeatures & NAMESPACEDECLS) != 0 &&

+                    (fFeatures & WELLFORMED) != 0 &&

+                    (fFeatures & COMMENTS) != 0) {

+                return Boolean.TRUE;

+            }                 

+            return Boolean.FALSE;

+        } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) {

+            return fDOMErrorHandler;

+        } else if (

+                name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION)

+                || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) {

+            return null;

+        } else {

+            // Here we have to add the Xalan specific DOM Message Formatter

+            String msg = Utils.messages.createMessage(

+                    MsgKey.ER_FEATURE_NOT_FOUND,

+                    new Object[] { name });

+            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);

+        }

+    }

+    

+    /**

+     * This method returns a of the parameters supported by this DOMConfiguration object 

+     * and for which at least one value can be set by the application

+     * 

+     * @see org.w3c.dom.DOMConfiguration#getParameterNames()

+     * 

+     * @return DOMStringList A list of DOMConfiguration parameters recognized

+     *                       by the serializer

+     */

+    public DOMStringList getParameterNames() {

+        return new DOMStringListImpl(fRecognizedParameters);

+    }

+    

+    /**

+     * This method sets the value of the named parameter.

+     *   

+     * @see org.w3c.dom.DOMConfiguration#setParameter(java.lang.String, java.lang.Object)

+     * 

+     * @param name A String containing the DOMConfiguration parameter name.

+     * @param value An Object contaiing the parameters value to set.

+     */

+    public void setParameter(String name, Object value) throws DOMException {

+        // If the value is a boolean

+        if (value instanceof Boolean) {

+            boolean state = ((Boolean) value).booleanValue();

+            

+            if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) {

+                fFeatures = state ? fFeatures | COMMENTS : fFeatures

+                        & ~COMMENTS;

+                // comments

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE);

+                }                

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) {

+                fFeatures =  state ? fFeatures | CDATA : fFeatures

+                        & ~CDATA;

+                // cdata-sections

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE);

+                }

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) {

+                fFeatures = state ? fFeatures | ENTITIES : fFeatures

+                        & ~ENTITIES;

+                // entities

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE);

+                    fDOMConfigProperties.setProperty(

+                            OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE);

+                }

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) {

+                fFeatures = state ? fFeatures | NAMESPACES : fFeatures

+                        & ~NAMESPACES;

+                // namespaces

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE); 

+                }       

+            } else if (name

+                    .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) {

+                fFeatures = state ? fFeatures | NAMESPACEDECLS

+                        : fFeatures & ~NAMESPACEDECLS;

+                // namespace-declarations

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE); 

+                } 

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) {

+                fFeatures = state ? fFeatures | SPLITCDATA : fFeatures

+                        & ~SPLITCDATA;

+                // split-cdata-sections

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE); 

+                }  

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) {

+                fFeatures = state ? fFeatures | WELLFORMED : fFeatures

+                        & ~WELLFORMED;

+                // well-formed

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE); 

+                }                  

+            } else if (name

+                    .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) {

+                fFeatures = state ? fFeatures | DISCARDDEFAULT

+                        : fFeatures & ~DISCARDDEFAULT;

+                // discard-default-content

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE); 

+                }                    

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) {

+                fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures

+                        & ~PRETTY_PRINT;

+                fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_INDENT,DOMConstants.DOM3_EXPLICIT_TRUE);

+                fDOMConfigProperties.setProperty(OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(3));                

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) {

+                fFeatures = state ? fFeatures | XMLDECL : fFeatures

+                        & ~XMLDECL;

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no");

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes"); 

+                }       

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) {

+                fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures

+                        & ~ELEM_CONTENT_WHITESPACE;

+                // element-content-whitespace

+                if (state) {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE);

+                }            

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {

+                // false is not supported

+                if (!state) {

+                    // Here we have to add the Xalan specific DOM Message Formatter

+                    String msg = Utils.messages.createMessage(

+                            MsgKey.ER_FEATURE_NOT_SUPPORTED,

+                            new Object[] { name });

+                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);

+                } else {

+                    fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                            + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE);

+                }

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION)

+                    || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)

+                    // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)

+                    ) {

+                // true is not supported

+                if (state) {

+                    String msg = Utils.messages.createMessage(

+                            MsgKey.ER_FEATURE_NOT_SUPPORTED,

+                            new Object[] { name });

+                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);

+                } else {

+                    if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) {

+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                                + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE);

+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) {

+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                                + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE);

+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) {

+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                                + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE);

+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) {

+                        fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION 

+                                + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE);

+                    } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) {

+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                                + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE);

+                    } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) {

+                        fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                                + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE);

+                    } */

+                }

+            } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) {

+                if (state) {

+                    fFeatures &= ~ENTITIES;

+                    fFeatures &= ~CDATA;

+                    fFeatures &= ~SCHEMAVALIDATE;

+                    fFeatures &= ~DTNORMALIZE;

+                    fFeatures |= NAMESPACES;

+                    fFeatures |= NAMESPACEDECLS;

+                    fFeatures |= WELLFORMED;

+                    fFeatures |= ELEM_CONTENT_WHITESPACE;

+                    fFeatures |= COMMENTS;

+                }

+                

+                // infoset

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); 

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE);

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE);

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE);

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE);

+                

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE);

+                fDOMConfigProperties.setProperty(

+                        OutputPropertiesFactory.S_KEY_ENTITIES, "");

+                

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE);

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE);            

+                fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS 

+                        + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE);

+            } else {

+                // Setting this to false has no effect

+            }

+        } // If the parameter value is not a boolean 

+        else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) {

+            if (value == null || value instanceof DOMErrorHandler) {

+                fDOMErrorHandler = (DOMErrorHandler)value;

+            } else {

+                String msg = Utils.messages.createMessage(

+                        MsgKey.ER_TYPE_MISMATCH_ERR,

+                        new Object[] { name });

+                throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);

+            }

+        } else if (

+                name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION)

+                || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)

+                && value != null) {

+            String msg = Utils.messages.createMessage(

+                    MsgKey.ER_FEATURE_NOT_SUPPORTED,

+                    new Object[] { name });

+            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);

+        } else {

+            String msg = Utils.messages.createMessage(

+                    MsgKey.ER_FEATURE_NOT_FOUND,

+                    new Object[] { name });

+            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);

+        }

+    }

+    // ************************************************************************

+    

+    

+    // ************************************************************************

+    // DOMConfiguraiton implementation

+    // ************************************************************************

+    

+    /** 

+     * Returns the DOMConfiguration of the LSSerializer.

+     *  

+     * @see org.w3c.dom.ls.LSSerializer#getDomConfig()

+     * @since DOM Level 3

+     * @return A DOMConfiguration object.

+     */

+    public DOMConfiguration getDomConfig() {

+        return (DOMConfiguration)this;

+    }

+    

+    /** 

+     * Returns the DOMConfiguration of the LSSerializer.

+     *  

+     * @see org.w3c.dom.ls.LSSerializer#getFilter()

+     * @since DOM Level 3

+     * @return A LSSerializerFilter object.

+     */

+    public LSSerializerFilter getFilter() {

+        return fSerializerFilter;

+    }

+    

+    /** 

+     * Returns the End-Of-Line sequence of characters to be used in the XML 

+     * being serialized.  If none is set a default "\n" is returned.

+     * 

+     * @see org.w3c.dom.ls.LSSerializer#getNewLine()

+     * @since DOM Level 3

+     * @return A String containing the end-of-line character sequence  used in 

+     * serialization.

+     */

+    public String getNewLine() {

+        return fEndOfLine;

+    }

+    

+    /** 

+     * Set a LSSerilizerFilter on the LSSerializer.  When set, the filter is

+     * called before each node is serialized which depending on its implemention

+     * determines if the node is to be serialized or not.    

+     *  

+     * @see org.w3c.dom.ls.LSSerializer#setFilter

+     * @since DOM Level 3

+     * @param filter A LSSerializerFilter to be applied to the stream to serialize.

+     */

+    public void setFilter(LSSerializerFilter filter) {

+        fSerializerFilter = filter;

+    }

+    

+    /** 

+     * Sets the End-Of-Line sequence of characters to be used in the XML 

+     * being serialized.  Setting this attribute to null will reset its 

+     * value to the default value i.e. "\n".

+     * 

+     * @see org.w3c.dom.ls.LSSerializer#setNewLine

+     * @since DOM Level 3

+     * @param newLine a String that is the end-of-line character sequence to be used in 

+     * serialization.

+     */

+    public void setNewLine(String newLine) {

+        fEndOfLine = newLine !=null? newLine: fEndOfLine;

+    }

+    

+    /** 

+     * Serializes the specified node to the specified LSOutput and returns true if the Node 

+     * was successfully serialized. 

+     * 

+     * @see org.w3c.dom.ls.LSSerializer#write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput)

+     * @since DOM Level 3

+     * @param nodeArg The Node to serialize.

+     * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the 

+     * LSSerializer was unable to serialize the node.

+     *      

+     */

+    public boolean write(Node nodeArg, LSOutput destination) throws LSException {

+        // If the destination is null

+        if (destination == null) {

+            String msg = Utils.messages

+            .createMessage(

+                    MsgKey.ER_NO_OUTPUT_SPECIFIED,

+                    null);

+            if (fDOMErrorHandler != null) {

+                fDOMErrorHandler.handleError(new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR, msg,

+                        MsgKey.ER_NO_OUTPUT_SPECIFIED));

+            }

+            throw new LSException(LSException.SERIALIZE_ERR, msg);

+        } 

+        

+        // If nodeArg is null, return false.  Should we throw and LSException instead?

+        if (nodeArg == null ) {

+            return false;

+        }

+

+        // Obtain a reference to the serializer to use

+        // Serializer serializer = getXMLSerializer(xmlVersion);

+        Serializer serializer = fXMLSerializer;

+        serializer.reset();

+        

+        // If the node has not been seen

+        if ( nodeArg != fVisitedNode) {

+            // Determine the XML Document version of the Node 

+            String xmlVersion = getXMLVersion(nodeArg);

+            

+            // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding. 

+            fEncoding = destination.getEncoding();

+            if (fEncoding == null ) {

+            	fEncoding = getInputEncoding(nodeArg);

+            	fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg);

+            }

+

+            // If the encoding is not recognized throw an exception.

+            // Note: The serializer defaults to UTF-8 when created

+            if (!Encodings.isRecognizedEncoding(fEncoding)) {

+                String msg = Utils.messages

+                .createMessage(

+                        MsgKey.ER_UNSUPPORTED_ENCODING,

+                        null);

+                if (fDOMErrorHandler != null) {

+                    fDOMErrorHandler.handleError(new DOMErrorImpl(

+                            DOMError.SEVERITY_FATAL_ERROR, msg,

+                            MsgKey.ER_UNSUPPORTED_ENCODING));

+                }

+                throw new LSException(LSException.SERIALIZE_ERR, msg);            	

+            }

+            

+            serializer.getOutputFormat().setProperty("version", xmlVersion);

+

+            // Set the output encoding and xml version properties

+            fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion);

+            fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding);

+            

+            // If the node to be serialized is not a Document, Element, or Entity

+            // node

+            // then the XML declaration, or text declaration, should be never be

+            // serialized.

+            if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE

+                    || nodeArg.getNodeType() != Node.ELEMENT_NODE

+                    || nodeArg.getNodeType() != Node.ENTITY_NODE)

+                    && ((fFeatures & XMLDECL) != 0)) {

+                fDOMConfigProperties.setProperty(

+                        DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL,

+                        DOMConstants.DOM3_DEFAULT_FALSE);

+            }

+

+            fVisitedNode = nodeArg;

+        } 

+        

+        // Update the serializer properties

+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);

+        

+        // 

+        try {

+            

+            // The LSSerializer will use the LSOutput object to determine 

+            // where to serialize the output to in the following order the  

+            // first one that is not null and not an empty string will be    

+            // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream,   

+            // 3. LSOutput.systemId 

+            // 1.LSOutput.characterStream

+            Writer writer = destination.getCharacterStream();

+            if (writer == null ) {

+                

+                // 2.LSOutput.byteStream

+                OutputStream outputStream = destination.getByteStream();

+                if ( outputStream == null) {

+                    

+                    // 3. LSOutput.systemId

+                    String uri = destination.getSystemId();

+                    if (uri == null) {

+                        String msg = Utils.messages

+                        .createMessage(

+                                MsgKey.ER_NO_OUTPUT_SPECIFIED,

+                                null);

+                        if (fDOMErrorHandler != null) {

+                            fDOMErrorHandler.handleError(new DOMErrorImpl(

+                                    DOMError.SEVERITY_FATAL_ERROR, msg,

+                                    MsgKey.ER_NO_OUTPUT_SPECIFIED));

+                        }

+                        throw new LSException(LSException.SERIALIZE_ERR, msg);

+                        

+                    } else {

+                        // Expand the System Id and obtain an absolute URI for it.

+                        String absoluteURI = SystemIDResolver.getAbsoluteURI(uri);

+                        

+                        URL url = new URL(absoluteURI);

+                        OutputStream urlOutStream = null;

+                        String protocol = url.getProtocol();

+                        String host = url.getHost();

+                        

+                        // For file protocols, there is no need to use a URL to get its

+                        // corresponding OutputStream

+                        

+                        // Scheme names consist of a sequence of characters. The lower case

+                        // letters "a"--"z", digits, and the characters plus ("+"), period

+                        // ("."), and hyphen ("-") are allowed. For resiliency, programs

+                        // interpreting URLs should treat upper case letters as equivalent to

+                        // lower case in scheme names (e.g., allow "HTTP" as well as "http").

+                        if (protocol.equalsIgnoreCase("file") 

+                                && (host == null || host.length() == 0 || host.equals("localhost"))) {

+                            // do we also need to check for host.equals(hostname)

+                            urlOutStream = new FileOutputStream(new File(url.getPath()));

+                           

+                        } else {

+                            // This should support URL's whose schemes are mentioned in 

+                            // RFC1738 other than file

+                            

+                            URLConnection urlCon = url.openConnection();

+                            urlCon.setDoInput(false);

+                            urlCon.setDoOutput(true);

+                            urlCon.setUseCaches(false); 

+                            urlCon.setAllowUserInteraction(false);

+                            

+                            // When writing to a HTTP URI, a HTTP PUT is performed.

+                            if (urlCon instanceof HttpURLConnection) {

+                                HttpURLConnection httpCon = (HttpURLConnection) urlCon;

+                                httpCon.setRequestMethod("PUT");

+                            }

+                            urlOutStream = urlCon.getOutputStream();

+                        }

+                        // set the OutputStream to that obtained from the systemId

+                        serializer.setWriter(new OutputStreamWriter(urlOutStream));

+                    }

+                } else {

+                    // 2.LSOutput.byteStream

+                    serializer.setWriter(new OutputStreamWriter(outputStream, fEncoding));                     

+                }

+            } else {

+                // 1.LSOutput.characterStream

+                serializer.setWriter(writer);

+            }

+            

+            // The associated media type by default is set to text/xml on 

+            // org.apache.xml.serializer.SerializerBase.  

+            

+            // Get a reference to the serializer then lets you serilize a DOM

+            // Use this hack till Xalan support JAXP1.3

+            if (fDOMSerializer == null) {

+               fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer();

+            } 

+            

+            // Set the error handler on the DOM3Serializer interface implementation

+            if (fDOMErrorHandler != null) {

+                fDOMSerializer.setErrorHandler(fDOMErrorHandler);

+            }

+            

+            // Set the filter on the DOM3Serializer interface implementation

+            if (fSerializerFilter != null) {

+                fDOMSerializer.setNodeFilter(fSerializerFilter);

+            }

+            

+            // Set the NewLine character to be used

+            fDOMSerializer.setNewLine(fEndOfLine.toCharArray());

+            

+            // Serializer your DOM, where node is an org.w3c.dom.Node

+            // Assuming that Xalan's serializer can serialize any type of DOM node

+            fDOMSerializer.serializeDOM3(nodeArg);

+            

+        } catch( UnsupportedEncodingException ue) {

+            

+            String msg = Utils.messages

+            .createMessage(

+                    MsgKey.ER_UNSUPPORTED_ENCODING,

+                    null);

+            if (fDOMErrorHandler != null) {

+                fDOMErrorHandler.handleError(new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR, msg,

+                        MsgKey.ER_UNSUPPORTED_ENCODING, ue));

+            }

+            throw new LSException(LSException.SERIALIZE_ERR, ue.getMessage());

+        } catch (LSException lse) {

+            // Rethrow LSException.

+            throw lse;

+        } catch (RuntimeException e) {

+            e.printStackTrace();

+            throw new LSException(LSException.SERIALIZE_ERR, e!=null?e.getMessage():"NULL Exception") ;

+        }  catch (Exception e) {

+            if (fDOMErrorHandler != null) {

+                fDOMErrorHandler.handleError(new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR, e.getMessage(),

+                        null, e));

+            } 

+            e.printStackTrace();

+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());

+        }        

+        return true;

+    }

+    

+    /** 

+     * Serializes the specified node and returns a String with the serialized

+     * data to the caller.  

+     * 

+     * @see org.w3c.dom.ls.LSSerializer#writeToString(org.w3c.dom.Node)

+     * @since DOM Level 3

+     * @param nodeArg The Node to serialize.

+     * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the 

+     * LSSerializer was unable to serialize the node.

+     *      

+     */

+    public String writeToString(Node nodeArg) throws DOMException, LSException {

+        // return null is nodeArg is null.  Should an Exception be thrown instead?

+        if (nodeArg == null) {

+            return null;

+        }

+

+        // Should we reset the serializer configuration before each write operation?

+        // Obtain a reference to the serializer to use

+        Serializer serializer = fXMLSerializer;

+        serializer.reset();

+        

+        if (nodeArg != fVisitedNode){

+            // Determine the XML Document version of the Node 

+            String xmlVersion = getXMLVersion(nodeArg);

+            

+            serializer.getOutputFormat().setProperty("version", xmlVersion);

+            

+            // Set the output encoding and xml version properties

+            fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion);

+            fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16");

+            

+            // If the node to be serialized is not a Document, Element, or Entity

+            // node

+            // then the XML declaration, or text declaration, should be never be

+            // serialized.

+            if  ((nodeArg.getNodeType() != Node.DOCUMENT_NODE

+                    || nodeArg.getNodeType() != Node.ELEMENT_NODE

+                    || nodeArg.getNodeType() != Node.ENTITY_NODE)

+                    && ((fFeatures & XMLDECL) != 0)) {

+                fDOMConfigProperties.setProperty(

+                        DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL,

+                        DOMConstants.DOM3_DEFAULT_FALSE);

+            }            

+

+            fVisitedNode = nodeArg;       

+        } 

+        // Update the serializer properties

+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);

+        

+        // StringWriter to Output to

+        StringWriter output = new StringWriter();

+        

+        // 

+        try {

+            

+            // Set the Serializer's Writer to a StringWriter

+            serializer.setWriter(output);

+            

+            // Get a reference to the serializer then lets you serilize a DOM

+            // Use this hack till Xalan support JAXP1.3

+            if (fDOMSerializer == null) {

+                fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer();

+            } 

+                        

+            // Set the error handler on the DOM3Serializer interface implementation

+            if (fDOMErrorHandler != null) {

+                fDOMSerializer.setErrorHandler(fDOMErrorHandler);

+            }

+            

+            // Set the filter on the DOM3Serializer interface implementation

+            if (fSerializerFilter != null) {

+                fDOMSerializer.setNodeFilter(fSerializerFilter);

+            }

+            

+            // Set the NewLine character to be used

+            fDOMSerializer.setNewLine(fEndOfLine.toCharArray());

+            

+            // Serializer your DOM, where node is an org.w3c.dom.Node

+            fDOMSerializer.serializeDOM3(nodeArg);

+        } catch (LSException lse) {

+            // Rethrow LSException.

+            throw lse;

+        } catch (RuntimeException e) {

+            e.printStackTrace();

+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());

+        }  catch (Exception e) {

+            if (fDOMErrorHandler != null) {

+                fDOMErrorHandler.handleError(new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR, e.getMessage(),

+                        null, e));

+            } 

+            e.printStackTrace();

+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());

+        }        

+        

+        // return the serialized string

+        return output.toString();

+    }

+    

+    /** 

+     * Serializes the specified node to the specified URI and returns true if the Node 

+     * was successfully serialized. 

+     * 

+     * @see org.w3c.dom.ls.LSSerializer#writeToURI(org.w3c.dom.Node, String)

+     * @since DOM Level 3

+     * @param nodeArg The Node to serialize.

+     * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the 

+     * LSSerializer was unable to serialize the node.

+     *      

+     */

+    public boolean writeToURI(Node nodeArg, String uri) throws LSException {

+        // If nodeArg is null, return false.  Should we throw and LSException instead?

+        if (nodeArg == null ) {

+            return false;

+        }

+

+        // Obtain a reference to the serializer to use

+        Serializer serializer = fXMLSerializer;

+        serializer.reset();

+        

+        if (nodeArg != fVisitedNode) {

+            // Determine the XML Document version of the Node 

+            String xmlVersion = getXMLVersion(nodeArg);

+            

+            // Determine the encoding: 1.LSOutput.encoding,

+            // 2.Document.inputEncoding, 3.Document.xmlEncoding.

+            fEncoding = getInputEncoding(nodeArg);

+            if (fEncoding == null ) {

+            	fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg);

+            }

+            

+            serializer.getOutputFormat().setProperty("version", xmlVersion);

+            

+            // Set the output encoding and xml version properties

+            fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion);

+            fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding);

+            

+            // If the node to be serialized is not a Document, Element, or Entity

+            // node

+            // then the XML declaration, or text declaration, should be never be

+            // serialized.

+            if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE

+                    || nodeArg.getNodeType() != Node.ELEMENT_NODE

+                    || nodeArg.getNodeType() != Node.ENTITY_NODE)

+                    && ((fFeatures & XMLDECL) != 0))  {

+                fDOMConfigProperties.setProperty(

+                        DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL,

+                        DOMConstants.DOM3_DEFAULT_FALSE);

+            }

+       

+            fVisitedNode = nodeArg;

+        } 

+        

+        // Update the serializer properties

+        fXMLSerializer.setOutputFormat(fDOMConfigProperties);

+        

+        // 

+        try {

+            // If the specified encoding is not supported an

+            // "unsupported-encoding" fatal error is raised. ??

+            if (uri == null) {

+                String msg = Utils.messages.createMessage(

+                        MsgKey.ER_NO_OUTPUT_SPECIFIED, null);

+                if (fDOMErrorHandler != null) {

+                    fDOMErrorHandler.handleError(new DOMErrorImpl(

+                            DOMError.SEVERITY_FATAL_ERROR, msg,

+                            MsgKey.ER_NO_OUTPUT_SPECIFIED));

+                }

+                throw new LSException(LSException.SERIALIZE_ERR, msg);

+                

+            } else {

+                // REVISIT: Can this be used to get an absolute expanded URI

+                String absoluteURI = SystemIDResolver.getAbsoluteURI(uri);

+                

+                URL url = new URL(absoluteURI);

+                OutputStream urlOutStream = null;

+                String protocol = url.getProtocol();

+                String host = url.getHost();

+                

+                // For file protocols, there is no need to use a URL to get its

+                // corresponding OutputStream

+                

+                // Scheme names consist of a sequence of characters. The lower 

+                // case letters "a"--"z", digits, and the characters plus ("+"), 

+                // period ("."), and hyphen ("-") are allowed. For resiliency, 

+                // programs interpreting URLs should treat upper case letters as

+                // equivalent to lower case in scheme names 

+                // (e.g., allow "HTTP" as well as "http").

+                if (protocol.equalsIgnoreCase("file")

+                        && (host == null || host.length() == 0 || host

+                                .equals("localhost"))) {

+                    // do we also need to check for host.equals(hostname)

+                    urlOutStream = new FileOutputStream(new File(url.getPath()));

+                    

+                } else {

+                    // This should support URL's whose schemes are mentioned in

+                    // RFC1738 other than file

+                    

+                    URLConnection urlCon = url.openConnection();

+                    urlCon.setDoInput(false);

+                    urlCon.setDoOutput(true);

+                    urlCon.setUseCaches(false);

+                    urlCon.setAllowUserInteraction(false);

+                    

+                    // When writing to a HTTP URI, a HTTP PUT is performed.

+                    if (urlCon instanceof HttpURLConnection) {

+                        HttpURLConnection httpCon = (HttpURLConnection) urlCon;

+                        httpCon.setRequestMethod("PUT");

+                    }

+                    urlOutStream = urlCon.getOutputStream();

+                }

+                // set the OutputStream to that obtained from the systemId

+                serializer.setWriter(new OutputStreamWriter(urlOutStream, fEncoding));

+            }

+            

+            // Get a reference to the serializer then lets you serilize a DOM

+            // Use this hack till Xalan support JAXP1.3

+            if (fDOMSerializer == null) {

+                fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer();

+            } 

+            

+            // Set the error handler on the DOM3Serializer interface implementation

+            if (fDOMErrorHandler != null) {

+                fDOMSerializer.setErrorHandler(fDOMErrorHandler);

+            }

+            

+            // Set the filter on the DOM3Serializer interface implementation

+            if (fSerializerFilter != null) {

+                fDOMSerializer.setNodeFilter(fSerializerFilter);

+            }

+            

+            // Set the NewLine character to be used

+            fDOMSerializer.setNewLine(fEndOfLine.toCharArray());

+            

+            // Serializer your DOM, where node is an org.w3c.dom.Node

+            // Assuming that Xalan's serializer can serialize any type of DOM

+            // node

+            fDOMSerializer.serializeDOM3(nodeArg);

+            

+        } catch (LSException lse) {

+            // Rethrow LSException.

+            throw lse;

+        } catch (RuntimeException e) {

+            e.printStackTrace();

+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());

+        }  catch (Exception e) {

+            if (fDOMErrorHandler != null) {

+                fDOMErrorHandler.handleError(new DOMErrorImpl(

+                        DOMError.SEVERITY_FATAL_ERROR, e.getMessage(),

+                        null, e));

+            } 

+            e.printStackTrace();

+            throw new LSException(LSException.SERIALIZE_ERR, e.toString());

+        }        

+        

+        return true;

+    }

+    // ************************************************************************

+    

+    

+    // ************************************************************************

+    // Implementaion methods

+    // ************************************************************************

+    

+    /** 

+     * Determines the XML Version of the Document Node to serialize.  If the Document Node

+     * is not a DOM Level 3 Node, then the default version returned is 1.0.

+     * 

+     * @param  nodeArg The Node to serialize

+     * @return A String containing the version pseudo-attribute of the XMLDecl.  

+     * @throws Throwable if the DOM implementation does not implement Document.getXmlVersion()      

+     */

+    //protected String getXMLVersion(Node nodeArg) throws Throwable {

+    protected String getXMLVersion(Node nodeArg) {

+        Document doc = null;

+        

+        // Determine the XML Version of the document

+        if (nodeArg != null) {

+            if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) {

+                // The Document node is the Node argument

+                doc = (Document)nodeArg;

+            } else { 

+                // The Document node is the Node argument's ownerDocument

+                doc = nodeArg.getOwnerDocument();

+            }

+            

+            // Determine the DOM Version.

+            if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) {

+                return doc.getXmlVersion();

+            }

+        } 

+        // The version will be treated as "1.0" which may result in

+        // an ill-formed document being serialized.

+        // If nodeArg does not have an ownerDocument, treat this as XML 1.0

+        return "1.0";

+    }

+    

+    /** 

+     * Determines the XML Encoding of the Document Node to serialize.  If the Document Node

+     * is not a DOM Level 3 Node, then the default encoding "UTF-8" is returned.

+     * 

+     * @param  nodeArg The Node to serialize

+     * @return A String containing the encoding pseudo-attribute of the XMLDecl.  

+     * @throws Throwable if the DOM implementation does not implement Document.getXmlEncoding()     

+     */

+    protected String getXMLEncoding(Node nodeArg) {

+        Document doc = null;

+        

+        // Determine the XML Encoding of the document

+        if (nodeArg != null) {

+            if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) {

+                // The Document node is the Node argument

+                doc = (Document)nodeArg;

+            } else { 

+                // The Document node is the Node argument's ownerDocument

+                doc = nodeArg.getOwnerDocument();

+            }

+            

+            // Determine the XML Version. 

+            if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) {

+                return doc.getXmlEncoding();

+            }

+        } 

+        // The default encoding is UTF-8 except for the writeToString method

+        return "UTF-8";

+    }

+    

+    /** 

+     * Determines the Input Encoding of the Document Node to serialize.  If the Document Node

+     * is not a DOM Level 3 Node, then null is returned.

+     * 

+     * @param  nodeArg The Node to serialize

+     * @return A String containing the input encoding.  

+     */

+    protected String getInputEncoding(Node nodeArg)  {

+        Document doc = null;

+        

+        // Determine the Input Encoding of the document

+        if (nodeArg != null) {

+            if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) {

+                // The Document node is the Node argument

+                doc = (Document)nodeArg;

+            } else { 

+                // The Document node is the Node argument's ownerDocument

+                doc = nodeArg.getOwnerDocument();

+            }

+            

+            // Determine the DOM Version.

+            if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) {

+                return doc.getInputEncoding();

+            }

+        } 

+        // The default encoding returned is null

+        return null;

+    }

+    

+    /**

+     * This method returns the LSSerializer's error handler.

+     * 

+     * @return Returns the fDOMErrorHandler.

+     */

+    public DOMErrorHandler getErrorHandler() {

+        return fDOMErrorHandler;

+    }

+    

+}

diff --git a/src/org/apache/xml/serializer/dom3/NamespaceSupport.java b/src/org/apache/xml/serializer/dom3/NamespaceSupport.java
new file mode 100644
index 0000000..fc2b0ea
--- /dev/null
+++ b/src/org/apache/xml/serializer/dom3/NamespaceSupport.java
@@ -0,0 +1,315 @@
+/*

+ * 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.

+ */

+/*

+ * $Id:  $

+ */

+

+package org.apache.xml.serializer.dom3;

+

+import java.util.Enumeration;

+import java.util.NoSuchElementException;

+

+/**

+ * Namespace support for XML document handlers. This class doesn't 

+ * perform any error checking and assumes that all strings passed

+ * as arguments to methods are unique symbols. The SymbolTable class

+ * can be used for this purpose.

+ * 

+ * Derived from org.apache.xerces.util.NamespaceSupport

+ *

+ * @author Andy Clark, IBM

+ *

+ * @version $Id: Exp $

+ */

+public class NamespaceSupport {

+

+	static final String PREFIX_XML = "xml".intern();

+	

+	static final String PREFIX_XMLNS = "xmlns".intern(); 

+    

+    /**

+     * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is

+     * the Namespace URI that is automatically mapped to the "xml" prefix.

+     */

+    public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern();

+

+    /**

+     * XML Information Set REC

+     * all namespace attributes (including those named xmlns, 

+     * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/

+     */

+    public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();

+

+	//

+    // Data

+    //

+

+    /** 

+     * Namespace binding information. This array is composed of a

+     * series of tuples containing the namespace binding information:

+     * &lt;prefix, uri&gt;. The default size can be set to anything

+     * as long as it is a power of 2 greater than 1.

+     *

+     * @see #fNamespaceSize

+     * @see #fContext

+     */

+    protected String[] fNamespace = new String[16 * 2];

+

+    /** The top of the namespace information array. */

+    protected int fNamespaceSize;

+

+    // NOTE: The constructor depends on the initial context size 

+    //       being at least 1. -Ac

+

+    /** 

+     * Context indexes. This array contains indexes into the namespace

+     * information array. The index at the current context is the start

+     * index of declared namespace bindings and runs to the size of the

+     * namespace information array.

+     *

+     * @see #fNamespaceSize

+     */

+    protected int[] fContext = new int[8];

+

+    /** The current context. */

+    protected int fCurrentContext;

+    

+    protected String[] fPrefixes = new String[16];

+    

+    //

+    // Constructors

+    //

+

+    /** Default constructor. */

+    public NamespaceSupport() {

+    } // <init>()

+

+    //

+    // Public methods

+    //

+    

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#reset()

+	 */

+    public void reset() {

+

+        // reset namespace and context info

+        fNamespaceSize = 0;

+        fCurrentContext = 0;

+        fContext[fCurrentContext] = fNamespaceSize;

+

+        // bind "xml" prefix to the XML uri

+        fNamespace[fNamespaceSize++] = PREFIX_XML;

+        fNamespace[fNamespaceSize++] = XML_URI;

+        // bind "xmlns" prefix to the XMLNS uri

+        fNamespace[fNamespaceSize++] = PREFIX_XMLNS;

+        fNamespace[fNamespaceSize++] = XMLNS_URI;

+        ++fCurrentContext;

+

+    } // reset(SymbolTable)

+

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#pushContext()

+	 */

+    public void pushContext() {

+

+        // extend the array, if necessary

+        if (fCurrentContext + 1 == fContext.length) {

+            int[] contextarray = new int[fContext.length * 2];

+            System.arraycopy(fContext, 0, contextarray, 0, fContext.length);

+            fContext = contextarray;

+        }

+

+        // push context

+        fContext[++fCurrentContext] = fNamespaceSize;

+

+    } // pushContext()

+

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#popContext()

+	 */

+    public void popContext() {

+        fNamespaceSize = fContext[fCurrentContext--];

+    } // popContext()

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#declarePrefix(String, String)

+	 */

+    public boolean declarePrefix(String prefix, String uri) {

+        // ignore "xml" and "xmlns" prefixes

+        if (prefix == PREFIX_XML || prefix == PREFIX_XMLNS) {

+            return false;

+        }

+

+        // see if prefix already exists in current context

+        for (int i = fNamespaceSize; i > fContext[fCurrentContext]; i -= 2) {

+            //if (fNamespace[i - 2] == prefix) {

+        	if (fNamespace[i - 2].equals(prefix) )  {

+                // REVISIT: [Q] Should the new binding override the

+                //          previously declared binding or should it

+                //          it be ignored? -Ac

+                // NOTE:    The SAX2 "NamespaceSupport" helper allows

+                //          re-bindings with the new binding overwriting

+                //          the previous binding. -Ac

+                fNamespace[i - 1] = uri;

+                return true;

+            }

+        }

+

+        // resize array, if needed

+        if (fNamespaceSize == fNamespace.length) {

+            String[] namespacearray = new String[fNamespaceSize * 2];

+            System.arraycopy(fNamespace, 0, namespacearray, 0, fNamespaceSize);

+            fNamespace = namespacearray;

+        }

+

+        // bind prefix to uri in current context

+        fNamespace[fNamespaceSize++] = prefix;

+        fNamespace[fNamespaceSize++] = uri;

+

+        return true;

+

+    } // declarePrefix(String,String):boolean

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#getURI(String)

+	 */

+    public String getURI(String prefix) {

+        

+        // find prefix in current context

+        for (int i = fNamespaceSize; i > 0; i -= 2) {

+            //if (fNamespace[i - 2] == prefix) {

+        	if (fNamespace[i - 2].equals(prefix) ) {

+                return fNamespace[i - 1];

+            }

+        }

+

+        // prefix not found

+        return null;

+

+    } // getURI(String):String

+

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#getPrefix(String)

+	 */

+    public String getPrefix(String uri) {

+

+        // find uri in current context

+        for (int i = fNamespaceSize; i > 0; i -= 2) {

+            //if (fNamespace[i - 1] == uri) {

+        	if (fNamespace[i - 1].equals(uri) ) {

+                //if (getURI(fNamespace[i - 2]) == uri)

+        		if (getURI(fNamespace[i - 2]).equals(uri) )

+                    return fNamespace[i - 2];

+            }

+        }

+

+        // uri not found

+        return null;

+

+    } // getPrefix(String):String

+

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixCount()

+	 */

+    public int getDeclaredPrefixCount() {

+        return (fNamespaceSize - fContext[fCurrentContext]) / 2;

+    } // getDeclaredPrefixCount():int

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixAt(int)

+	 */

+    public String getDeclaredPrefixAt(int index) {

+        return fNamespace[fContext[fCurrentContext] + index * 2];

+    } // getDeclaredPrefixAt(int):String

+

+	/**

+	 * @see org.apache.xerces.xni.NamespaceContext#getAllPrefixes()

+	 */

+	public Enumeration getAllPrefixes() {

+        int count = 0;

+        if (fPrefixes.length < (fNamespace.length/2)) {

+            // resize prefix array          

+            String[] prefixes = new String[fNamespaceSize];

+            fPrefixes = prefixes;

+        }

+        String prefix = null;

+        boolean unique = true;

+        for (int i = 2; i < (fNamespaceSize-2); i += 2) {

+            prefix = fNamespace[i + 2];            

+            for (int k=0;k<count;k++){

+                if (fPrefixes[k]==prefix){

+                    unique = false;

+                    break;

+                }               

+            }

+            if (unique){

+                fPrefixes[count++] = prefix;

+            }

+            unique = true;

+        }

+		return new Prefixes(fPrefixes, count);

+	}

+    

+    protected final class Prefixes implements Enumeration {

+        private String[] prefixes;

+        private int counter = 0;

+        private int size = 0;

+               

+		/**

+		 * Constructor for Prefixes.

+		 */

+		public Prefixes(String [] prefixes, int size) {

+			this.prefixes = prefixes;

+            this.size = size;

+		}

+

+       /**

+		 * @see java.util.Enumeration#hasMoreElements()

+		 */

+		public boolean hasMoreElements() {           

+			return (counter< size);

+		}

+

+		/**

+		 * @see java.util.Enumeration#nextElement()

+		 */

+		public Object nextElement() {

+            if (counter< size){

+                return fPrefixes[counter++];

+            }

+			throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration.");

+		}

+        

+        public String toString(){

+            StringBuffer buf = new StringBuffer();

+            for (int i=0;i<size;i++){

+                buf.append(prefixes[i]);

+                buf.append(" ");

+            }

+                

+            return buf.toString(); 

+        }

+

+}

+

+} // class NamespaceSupport

diff --git a/src/org/apache/xml/serializer/utils/MsgKey.java b/src/org/apache/xml/serializer/utils/MsgKey.java
index b818760..ccb82d3 100644
--- a/src/org/apache/xml/serializer/utils/MsgKey.java
+++ b/src/org/apache/xml/serializer/utils/MsgKey.java
@@ -96,5 +96,36 @@
     public static final String ER_XML_VERSION_NOT_SUPPORTED = "ER_XML_VERSION_NOT_SUPPORTED";
     public static final String ER_FACTORY_PROPERTY_MISSING = "ER_FACTORY_PROPERTY_MISSING";
     public static final String ER_ENCODING_NOT_SUPPORTED = "ER_ENCODING_NOT_SUPPORTED";
+    // DOM Exceptions
+    public static final String ER_FEATURE_NOT_FOUND = "FEATURE_NOT_FOUND";
+    public static final String ER_FEATURE_NOT_SUPPORTED = "FEATURE_NOT_SUPPORTED";
+    public static final String ER_STRING_TOO_LONG = "DOMSTRING_SIZE_ERR";
+    public static final String ER_TYPE_MISMATCH_ERR = "TYPE_MISMATCH_ERR";  
     
+    // DOM Level 3 load and save messages
+    public static final String ER_NO_OUTPUT_SPECIFIED = "no-output-specified";   
+    public static final String ER_UNSUPPORTED_ENCODING = "unsupported-encoding";
+    public static final String ER_ELEM_UNBOUND_PREFIX_IN_ENTREF = "unbound-prefix-in-entity-reference";
+    public static final String ER_ATTR_UNBOUND_PREFIX_IN_ENTREF = "unbound-prefix-in-entity-reference";
+    public static final String ER_CDATA_SECTIONS_SPLIT = "cdata-sections-splitted";
+    public static final String ER_WF_INVALID_CHARACTER = "wf-invalid-character";
+    public static final String ER_WF_INVALID_CHARACTER_IN_NODE_NAME = "wf-invalid-character-in-node-name";
+    
+    // DOM Level 3 Implementation specific Exceptions
+    public static final String ER_UNABLE_TO_SERIALIZE_NODE = "ER_UNABLE_TO_SERIALIZE_NODE";
+    public static final String ER_WARNING_WF_NOT_CHECKED = "ER_WARNING_WF_NOT_CHECKED";
+    
+    public static final String ER_WF_INVALID_CHARACTER_IN_COMMENT = "ER_WF_INVALID_CHARACTER_IN_COMMENT";
+    public static final String ER_WF_INVALID_CHARACTER_IN_PI = "ER_WF_INVALID_CHARACTER_IN_PI";
+    public static final String ER_WF_INVALID_CHARACTER_IN_CDATA = "ER_WF_INVALID_CHARACTER_IN_CDATA";
+    public static final String ER_WF_INVALID_CHARACTER_IN_TEXT = "ER_WF_INVALID_CHARACTER_IN_TEXT";
+    public static final String ER_WF_DASH_IN_COMMENT = "ER_WF_DASH_IN_COMMENT";
+    public static final String ER_WF_LT_IN_ATTVAL = "ER_WF_LT_IN_ATTVAL";
+    public static final String ER_WF_REF_TO_UNPARSED_ENT = "ER_WF_REF_TO_UNPARSED_ENT";
+    public static final String ER_WF_REF_TO_EXTERNAL_ENT =  "ER_WF_REF_TO_EXTERNAL_ENT";
+    public static final String ER_NS_PREFIX_CANNOT_BE_BOUND =  "ER_NS_PREFIX_CANNOT_BE_BOUND";
+    public static final String ER_NULL_LOCAL_ELEMENT_NAME = "ER_NULL_LOCAL_ELEMENT_NAME";
+    public static final String ER_NULL_LOCAL_ATTR_NAME = "ER_NULL_LOCAL_ATTR_NAME";
+    public static final String ER_WRITING_INTERNAL_SUBSET = "ER_WRITING_INTERNAL_SUBSET";
+
 }
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages.java b/src/org/apache/xml/serializer/utils/SerializerMessages.java
index b683a8c..f9049d6 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages.java
@@ -197,8 +197,98 @@
 
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Warning:  The encoding ''{0}'' is not supported by the Java runtime." },
-                
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "The parameter ''{0}'' is not recognized."},
+            
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "The parameter ''{0}'' is recognized but the requested value cannot be set."},
+            
+             {MsgKey.ER_STRING_TOO_LONG,
+             "The resulting string is too long to fit in a DOMString: ''{0}''."},  
+            
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "The value type for this parameter name is incompatible with the expected value type."},
+            
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "The output destination for data to be written to was null."},
+            
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "An unsupported encoding is encountered."},
+            
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "The node could not be serialized."},
+            
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT, 
+             "The CDATA Section contains one or more termination markers ']]>'."},
+            
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED, 
+                 "An instance of the Well-Formedness checker could not be created.  The well-formed parameter was set to true but well-formedness checking can not be performed."    
+             },
+            
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "The node ''{0}'' contains invalid XML characters."
+             },
+            
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the comment."
+             },
+            
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the processing instructiondata."
+             },             
+            
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the contents of the CDATASection."
+             },
+            
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "An invalid XML character (Unicode: 0x{0}) was found in the node''s character data content."
+             },                        
+            
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "An invalid XML character(s) was found in the {0} node named ''{1}''."
+             },
+            
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "The string \"--\" is not permitted within comments."
+             },
+            
+             {MsgKey.ER_WF_LT_IN_ATTVAL,  
+                 "The value of attribute \"{1}\" associated with an element type \"{0}\" must not contain the ''<'' character." 
+             },
+            
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,  
+                 "The unparsed entity reference \"&{0};\" is not permitted." 
+             },
+            
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,  
+                 "The external entity reference \"&{0};\" is not permitted in an attribute value." 
+             },             
+            
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "The prefix \"{0}\" can not be bound to namespace \"{1}\"."
+             },
+            
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "The local name of element \"{0}\" is null."
+             },
+            
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "The local name of attr \"{0}\" is null."
+             },             
+            
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "The replacement text of the entity node \"{0}\" contains an element node \"{1}\" with an unbound prefix \"{2}\"."
+             },
+            
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "The replacement text of the entity node \"{0}\" contains an attribute node \"{1}\" with an unbound prefix \"{2}\"."
+             },
+             
+             { MsgKey.ER_WRITING_INTERNAL_SUBSET,
+                 "An error occured while writing the internal subset."
+             },
         };
 
         return contents;
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ca.java b/src/org/apache/xml/serializer/utils/SerializerMessages_ca.java
index ded6b08..0954a85 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_ca.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_ca.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Av\u00eds: el temps d''execuci\u00f3 de Java no d\u00f3na suport a la codificaci\u00f3 ''{0}''." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "El par\u00e0metre ''{0}'' no es reconeix."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "El par\u00e0metre ''{0}'' es reconeix per\u00f2 el valor sol\u00b7licitat no es pot establir."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "La cadena resultant \u00e9s massa llarga per cabre en una DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "El tipus de valor per a aquest nom de par\u00e0metre \u00e9s incompatible amb el tipus de valor esperat."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "La destinaci\u00f3 de sortida per a les dades que s'ha d'escriure era nul\u00b7la."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "S'ha trobat una codificaci\u00f3 no suportada."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "El node no s'ha pogut serialitzat."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "La secci\u00f3 CDATA cont\u00e9 un o m\u00e9s marcadors d'acabament ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "No s'ha pogut crear cap inst\u00e0ncia per comprovar si t\u00e9 un format correcte o no. El par\u00e0metre del tipus ben format es va establir en cert, per\u00f2 la comprovaci\u00f3 de format no s'ha pogut realitzar."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "El node ''{0}'' cont\u00e9 car\u00e0cters XML no v\u00e0lids."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en el comentari."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en les dades d''instrucci\u00f3 de proc\u00e9s."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en els continguts de la CDATASection."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en el contingut de dades de car\u00e0cter del node."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "S''han trobat car\u00e0cters XML no v\u00e0lids al node {0} anomenat ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "La cadena \"--\" no est\u00e0 permesa dins dels comentaris."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "El valor d''atribut \"{1}\" associat amb un tipus d''element \"{0}\" no pot contenir el car\u00e0cter ''<''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "La refer\u00e8ncia de l''entitat no analitzada \"&{0};\" no est\u00e0 permesa."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "La refer\u00e8ncia externa de l''entitat \"&{0};\" no est\u00e0 permesa en un valor d''atribut."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "El prefix \"{0}\" no es pot vincular a l''espai de noms \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "El nom local de l''element \"{0}\" \u00e9s nul."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "El nom local d''atr \"{0}\" \u00e9s nul."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''element \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''atribut \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_cs.java b/src/org/apache/xml/serializer/utils/SerializerMessages_cs.java
index 1313d25..5e110cf 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_cs.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_cs.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Varov\u00e1n\u00ed: K\u00f3dov\u00e1n\u00ed ''{0}'' nen\u00ed v b\u011bhov\u00e9m prost\u0159ed\u00ed Java podporov\u00e1no." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Parametr ''{0}'' nebyl rozpozn\u00e1n."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Parametr ''{0}'' byl rozpozn\u00e1n, ale nelze nastavit po\u017eadovanou hodnotu."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "V\u00fdsledn\u00fd \u0159et\u011bzec je p\u0159\u00edli\u0161 dlouh\u00fd pro \u0159et\u011bzec DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Typ hodnoty pro tento n\u00e1zev parametru nen\u00ed kompatibiln\u00ed s o\u010dek\u00e1van\u00fdm typem hodnoty."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "C\u00edlov\u00e9 um\u00edst\u011bn\u00ed v\u00fdstupu pro data ur\u010den\u00e1 k z\u00e1pisu je rovno hodnot\u011b Null. "},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Bylo nalezeno nepodporovan\u00e9 k\u00f3dov\u00e1n\u00ed."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Nelze prov\u00e9st serializaci uzlu. "},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "Sekce CDATA obsahuje jednu nebo v\u00edce ukon\u010dovac\u00edch zna\u010dek ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Nelze vytvo\u0159it instanci modulu pro kontrolu spr\u00e1vn\u00e9ho utvo\u0159en\u00ed. Parametr spr\u00e1vn\u00e9ho utvo\u0159en\u00ed byl nastaven na hodnotu true, nepoda\u0159ilo se v\u0161ak zkontrolovat spr\u00e1vnost utvo\u0159en\u00ed. "
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "Uzel ''{0}'' obsahuje neplatn\u00e9 znaky XML. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "V pozn\u00e1mce byl zji\u0161t\u011bn neplatn\u00fd znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "V datech instrukce zpracov\u00e1n\u00ed byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "V odd\u00edlu CDATASection byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "V obsahu znakov\u00fdch dat uzlu byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "V objektu {0} s n\u00e1zvem ''{1}'' byl nalezen neplatn\u00fd znak XML. "
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "V pozn\u00e1mk\u00e1ch nen\u00ed povolen \u0159et\u011bzec \"--\"."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "Hodnota atributu \"{1}\" souvisej\u00edc\u00edho s typem prvku \"{0}\" nesm\u00ed obsahovat znak ''<''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "Odkaz na neanalyzovanou entitu \"&{0};\" nen\u00ed povolen."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "Extern\u00ed odkaz na entitu \"&{0};\" nen\u00ed v hodnot\u011b atributu povolen."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "P\u0159edpona \"{0}\" nesm\u00ed b\u00fdt v\u00e1zan\u00e1 k oboru n\u00e1zv\u016f \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Lok\u00e1ln\u00ed n\u00e1zev prvku \"{0}\" m\u00e1 hodnotu Null. "
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Lok\u00e1ln\u00ed n\u00e1zev atributu \"{0}\" m\u00e1 hodnotu Null. "
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel prvku \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel atributu \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\". "
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_de.java b/src/org/apache/xml/serializer/utils/SerializerMessages_de.java
index 29d996a..c1c867c 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_de.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_de.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Warnung:  Die Codierung ''{0}'' wird von Java Runtime nicht unterst\u00fctzt." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Der Parameter ''{0}'' wird nicht erkannt."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Der Parameter ''{0}'' wird erkannt, der angeforderte Wert kann jedoch nicht festgelegt werden."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "Die Ergebniszeichenfolge ist zu lang f\u00fcr eine DOM-Zeichenfolge: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Der Werttyp f\u00fcr diesen Parameternamen ist nicht kompatibel mit dem erwarteten Werttyp."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "Das Ausgabeziel f\u00fcr die zu schreibenden Daten war leer."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Eine nicht unterst\u00fctzte Codierung wurde festgestellt."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Der Knoten konnte nicht serialisiert werden."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "Der Abschnitt CDATA enth\u00e4lt mindestens eine Beendigungsmarkierung ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Eine Instanz des Pr\u00fcfprogramms f\u00fcr korrekte Formatierung konnte nicht erstellt werden.  F\u00fcr den korrekt formatierten Parameter wurde der Wert 'True' festgelegt, die Pr\u00fcfung auf korrekte Formatierung kann jedoch nicht durchgef\u00fchrt werden."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "Der Knoten ''{0}'' enth\u00e4lt ung\u00fcltige XML-Zeichen."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Im Kommentar wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "In der Verarbeitungsanweisung wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Im Inhalt von CDATASection wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Ein ung\u00fcltiges XML-Zeichen  (Unicode: 0x{0}) wurde im Inhalt der Zeichendaten des Knotens gefunden."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Ung\u00fcltige XML-Zeichen wurden gefunden in {0} im Knoten ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "Die Zeichenfolge \"--\" ist innerhalb von Kommentaren nicht zul\u00e4ssig."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "Der Wert des Attributs \"{1}\" mit einem Elementtyp \"{0}\" darf nicht das Zeichen ''<'' enthalten."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "Der syntaktisch nicht analysierte Entit\u00e4tenverweis \"&{0};\" ist nicht zul\u00e4ssig."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "Der externe Entit\u00e4tenverweis \"&{0};\" ist in einem Attributwert nicht zul\u00e4ssig."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "Das Pr\u00e4fix \"{0}\" kann nicht an den Namensbereich \"{1}\" gebunden werden."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Der lokale Name von Element \"{0}\" ist nicht angegeben."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Der lokale Name des Attributs \"{0}\" ist nicht angegeben."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Elementknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Attributknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_es.java b/src/org/apache/xml/serializer/utils/SerializerMessages_es.java
index 839481e..06738ea 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_es.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_es.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Aviso: La codificaci\u00f3n ''{0}'' no est\u00e1 soportada por Java Runtime." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "El par\u00e1metro ''{0}'' no se reconoce."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Se reconoce el par\u00e1metro ''{0}'' pero no puede establecerse el valor solicitado."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "La serie producida es demasiado larga para ajustarse a DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "El tipo de valor para este nombre de par\u00e1metro es incompatible con el tipo de valor esperado."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "El destino de salida de escritura de los datos es nulo."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Se ha encontrado una codificaci\u00f3n no soportada."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "No se ha podido serializar el nodo."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "La secci\u00f3n CDATA contiene uno o m\u00e1s marcadores ']]>' de terminaci\u00f3n."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "No se ha podido crear una instancia del comprobador de gram\u00e1tica correcta.  El par\u00e1metro well-formed se ha establecido en true pero no se puede realizar la comprobaci\u00f3n de gram\u00e1tica correcta."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "El nodo ''{0}'' contiene caracteres XML no v\u00e1lidos."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el comentario."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en los datos de la instrucci\u00f3n de proceso."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de CDATASection."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de datos de caracteres del nodo."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Se ha encontrado un car\u00e1cter o caracteres XML no v\u00e1lidos en el nodo {0} denominado ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "No se permite la serie \"--\" dentro de los comentarios."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "El valor del atributo \"{1}\" asociado a un tipo de elemento \"{0}\" no debe contener el car\u00e1cter ''''<''''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "No se permite la referencia de entidad no analizada \"&{0};\"."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "La referencia de entidad externa \"&{0};\" no est\u00e1 permitida en un valor de atributo."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "No se puede encontrar el prefijo \"{0}\" en el espacio de nombres \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "El nombre local del elemento \"{0}\" es null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "El nombre local del atributo \"{0}\" es null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de elemento \"{1}\" con un prefijo no enlazado \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de atributo \"{1}\" con un prefijo no enlazado \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_fr.java b/src/org/apache/xml/serializer/utils/SerializerMessages_fr.java
index b6ec10a..61dadeb 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_fr.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_fr.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Avertissement : Le codage ''{0}'' n''est pas pris en charge par l''environnement d''ex\u00e9cution Java." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Le param\u00e8tre ''{0}'' n''est pas reconnu."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Le param\u00e8tre ''{0}'' est reconnu mas la valeur demand\u00e9e ne peut pas \u00eatre d\u00e9finie."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "La cha\u00eene obtenue est trop longue pour un DOMString : ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Le type de valeur de ce param\u00e8tre est incompatible avec le type de valeur attendu."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "La sortie de destination des donn\u00e9es \u00e0 \u00e9crire \u00e9tait vide."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Codage non pris en charge."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Le noeud ne peut pas \u00eatre s\u00e9rialis\u00e9."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "La section CDATA contient un ou plusieurs marqueurs de fin ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Aucune instance du programme de v\u00e9rification de la formation n'a pu \u00eatre cr\u00e9\u00e9e.  La valeur true a \u00e9t\u00e9 attribu\u00e9e au param\u00e8tre well-formed mais la v\u00e9rification de la formation n'a pas pu \u00eatre effectu\u00e9e."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "Le noeud ''{0}'' contient des caract\u00e8res XML non valides."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le commentaire."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans les donn\u00e9es de l''instruction de traitement."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Un caract\u00e8re XML non valide (Unicode: 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu de la CDATASection"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu des donn\u00e9es de type caract\u00e8res du noeud."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Un ou plusieurs caract\u00e8res non valides ont \u00e9t\u00e9 trouv\u00e9s dans le noeud {0} nomm\u00e9 ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "La cha\u00eene \"--\" est interdite dans des commentaires."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "La valeur de l''attribut \"{1}\" associ\u00e9 \u00e0 un type d''\u00e9l\u00e9ment \"{0}\" ne doit pas contenir le caract\u00e8re ''<''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "La r\u00e9f\u00e9rence d''entit\u00e9 non analys\u00e9e \"&{0};\" n''est pas admise."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "La r\u00e9f\u00e9rence d''entit\u00e9 externe \"&{0};\" n''est pas admise dans une valeur d''attribut."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "Le pr\u00e9fixe \"{0}\" ne peut pas \u00eatre li\u00e9 \u00e0 l''espace de noms \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Le nom local de l''\u00e9l\u00e9ment \"{0}\" a une valeur null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Le nom local de l''attribut \"{0}\" a une valeur null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contaient un noeud d''\u00e9l\u00e9ment \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contient un noeud d''attribut \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_hu.java b/src/org/apache/xml/serializer/utils/SerializerMessages_hu.java
index 74487c3..1ea5c7b 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_hu.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_hu.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Figyelmeztet\u00e9s: A(z) ''{0}'' k\u00f3dol\u00e1st nem t\u00e1mogatja a Java fut\u00e1si k\u00f6rnyezet." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "A(z) ''{0}'' param\u00e9ter nem ismerhet\u0151 fel."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "A(z) ''{0}'' param\u00e9ter ismert, de a k\u00e9rt \u00e9rt\u00e9k nem \u00e1ll\u00edthat\u00f3 be."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "A l\u00e9trej\u00f6v\u0151 karaktersorozat t\u00fal hossz\u00fa, nem f\u00e9r el egy DOMString-ben: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "A param\u00e9tern\u00e9v \u00e9rt\u00e9k\u00e9nek t\u00edpusa nem kompatibilis a v\u00e1rt t\u00edpussal."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "Az adatki\u00edr\u00e1s c\u00e9ljak\u00e9nt megadott \u00e9rt\u00e9k \u00fcres volt."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Nem t\u00e1mogatott k\u00f3dol\u00e1s."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "A csom\u00f3pont nem p\u00e9ld\u00e1nyos\u00edthat\u00f3."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "A CDATA szakasz legal\u00e1bb egy ']]>' lez\u00e1r\u00f3 jelz\u0151t tartalmaz."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "A szab\u00e1lyos form\u00e1z\u00e1st ellen\u0151rz\u0151 p\u00e9ld\u00e1nyt nem siker\u00fclt l\u00e9trehozni.  A well-formed param\u00e9ter \u00e9rt\u00e9ke true, de a szab\u00e1lyos form\u00e1z\u00e1st nem lehet ellen\u0151rizni."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "A(z) ''{0}'' csom\u00f3pont \u00e9rv\u00e9nytelen XML karaktereket tartalmaz."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\u00c9rv\u00e9nytelen XML karakter (Unicode: 0x{0}) szerepelt a megjegyz\u00e9sben."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\u00c9rv\u00e9nytelen XML karakter (Unicode: 0x{0}) szerepelt a feldolgoz\u00e1si utas\u00edt\u00e1sadatokban."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "\u00c9rv\u00e9nytelen XML karakter (Unicode: 0x{0}) szerepelt a CDATASection tartalm\u00e1ban."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\u00c9rv\u00e9nytelen XML karakter (Unicode: 0x{0}) szerepelt a csom\u00f3pont karakteradat tartalm\u00e1ban."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "\u00c9rv\u00e9nytelen XML karakter tal\u00e1lhat\u00f3 a(z) ''{1}'' nev\u0171 {0} csom\u00f3pontban."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "A \"--\" karaktersorozat nem megengedett a megjegyz\u00e9sekben."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "A(z) \"{0}\" elemt\u00edpussal t\u00e1rs\u00edtott \"{1}\" attrib\u00fatum \u00e9rt\u00e9ke nem tartalmazhat ''<'' karaktert."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "Az \u00e9rtelmez\u00e9s n\u00e9lk\u00fcli \"&{0};\" entit\u00e1shivatkoz\u00e1s nem megengedett."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "A(z) \"&{0};\" k\u00fcls\u0151 entit\u00e1shivatkoz\u00e1s nem megengedett egy attrib\u00fatum\u00e9rt\u00e9kben."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "A(z) \"{0}\" el\u0151tag nem k\u00f6thet\u0151 a(z) \"{1}\" n\u00e9vt\u00e9rhez."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "A(z) \"{0}\" elem helyi neve null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "A(z) \"{0}\" attrib\u00fatum helyi neve null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "A(z) \"{0}\" entit\u00e1scsom\u00f3pont helyettes\u00edt\u0151 sz\u00f6vege a(z) \"{1}\" elemcsom\u00f3pontot tartalmazza, amelynek nem k\u00f6t\u00f6tt el\u0151tagja \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "A(z) \"{0}\" entit\u00e1scsom\u00f3pont helyettes\u00edt\u0151 sz\u00f6vege a(z) \"{1}\" attrib\u00fatum-csom\u00f3pontot tartalmazza, amelynek nem k\u00f6t\u00f6tt el\u0151tagja \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_it.java b/src/org/apache/xml/serializer/utils/SerializerMessages_it.java
index 48698f4..d19325c 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_it.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_it.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Avvertenza:  La codifica ''{0}'' non \u00e8 supportata da Java runtime." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Il parametro ''{0}'' non \u00e8 riconosciuto."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Il parametro ''{0}'' \u00e8 riconosciuto ma non \u00e8 possibile impostare il valore richiesto."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "La stringa risultante \u00e8 troppo lunga per essere inserita in DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Il tipo di valore per questo nome di parametro non \u00e8 compatibile con il tipo di valore previsto."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "La destinazione di output in cui scrivere i dati era nulla."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\u00c8 stata rilevata una codifica non supportata."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Impossibile serializzare il nodo."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "La Sezione CDATA contiene uno o pi\u00f9 markers di termine ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Impossibile creare un'istanza del controllore Well-Formedness.  Il parametro well-formed \u00e8 stato impostato su true ma non \u00e8 possibile eseguire i controlli well-formedness."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "Il nodo ''{0}'' contiene caratteri XML non validi."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Trovato un carattere XML non valido (Unicode: 0x{0}) nel commento."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Carattere XML non valido (Unicode: 0x{0}) rilevato nell''elaborazione di instructiondata."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto di CDATASection."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto dati di caratteri del nodo. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Carattere XML non valido rilevato nel nodo {0} denominato ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "La stringa \"--\" non \u00e8 consentita nei commenti."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "Il valore dell''''attributo \"{1}\" associato con un tipo di elemento \"{0}\" non deve contenere il carattere ''<''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "Il riferimento entit\u00e0 non analizzata \"&{0};\" non \u00e8 permesso."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "Il riferimento all''''entit\u00e0 esterna \"&{0};\" non \u00e8 permesso in un valore attributo."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "Il prefisso \"{0}\" non pu\u00f2 essere associato allo spazio nome \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Il nome locale dell''''elemento \"{0}\" \u00e8 null."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Il nome locale dell''''attributo \"{0}\" \u00e8  null."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di elemento \"{1}\" con un prefisso non associato \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di attributo \"{1}\" con un prefisso non associato \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ja.java b/src/org/apache/xml/serializer/utils/SerializerMessages_ja.java
index ac922dd..5a47924 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_ja.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_ja.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "\u8b66\u544a:  \u30a8\u30f3\u30b3\u30fc\u30c9 ''{0}'' \u306f\u3053\u306e Java \u30e9\u30f3\u30bf\u30a4\u30e0\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002" },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u305b\u3093\u3002"},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u3059\u304c\u3001\u8981\u6c42\u3055\u308c\u305f\u5024\u306f\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002"},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "\u7d50\u679c\u306e\u30b9\u30c8\u30ea\u30f3\u30b0\u304c\u9577\u3059\u304e\u308b\u305f\u3081\u3001DOMString \u5185\u306b\u53ce\u307e\u308a\u307e\u305b\u3093: ''{0}''\u3002"},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "\u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u540d\u306e\u5024\u306e\u578b\u306f\u3001\u671f\u5f85\u3055\u308c\u308b\u5024\u306e\u578b\u3068\u4e0d\u9069\u5408\u3067\u3059\u3002"},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "\u66f8\u304d\u8fbc\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306e\u51fa\u529b\u5b9b\u5148\u304c\u30cc\u30eb\u3067\u3059\u3002"},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u3044\u30a8\u30f3\u30b3\u30fc\u30c9\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002"},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "\u30ce\u30fc\u30c9\u3092\u76f4\u5217\u5316\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002"},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306b 1 \u3064\u4ee5\u4e0a\u306e\u7d42\u4e86\u30de\u30fc\u30ab\u30fc ']]>' \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "\u6574\u5f62\u5f0f\u6027\u30c1\u30a7\u30c3\u30ab\u30fc\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002  well-formed \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8a2d\u5b9a\u306f true \u3067\u3057\u305f\u304c\u3001\u6574\u5f62\u5f0f\u6027\u306e\u691c\u67fb\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "\u30ce\u30fc\u30c9 ''{0}'' \u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u3042\u308a\u307e\u3059\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\u30b3\u30e1\u30f3\u30c8\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\u51e6\u7406\u547d\u4ee4\u30c7\u30fc\u30bf\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\u30ce\u30fc\u30c9\u306e\u6587\u5b57\u30c7\u30fc\u30bf\u306e\u5185\u5bb9\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "''{1}'' \u3068\u3044\u3046\u540d\u524d\u306e {0} \u30ce\u30fc\u30c9\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002"
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "\u30b9\u30c8\u30ea\u30f3\u30b0 \"--\" \u306f\u30b3\u30e1\u30f3\u30c8\u5185\u3067\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\u8981\u7d20\u578b \"{0}\" \u306b\u95a2\u9023\u3057\u305f\u5c5e\u6027 \"{1}\" \u306e\u5024\u306b\u306f ''<'' \u6587\u5b57\u3092\u542b\u3081\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\u89e3\u6790\u5bfe\u8c61\u5916\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\u5c5e\u6027\u5024\u3067\u306e\u5916\u90e8\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\u63a5\u982d\u90e8 \"{0}\" \u306f\u540d\u524d\u7a7a\u9593 \"{1}\" \u306b\u7d50\u5408\u3067\u304d\u307e\u305b\u3093\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\u8981\u7d20 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\u5c5e\u6027 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002"
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u8981\u7d20\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u5c5e\u6027\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ko.java b/src/org/apache/xml/serializer/utils/SerializerMessages_ko.java
index fd2d702..d5beb1f 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_ko.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_ko.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "\uacbd\uace0: ''{0}'' \uc778\ucf54\ub529\uc740 Java Runtime\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub97c \uc778\uc2dd\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub294 \uc778\uc2dd\ud560 \uc218 \uc788\uc73c\ub098 \uc694\uccad\ub41c \uac12\uc744 \uc124\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "\uacb0\uacfc \ubb38\uc790\uc5f4\uc774 \ub108\ubb34 \uae38\uc5b4 DOMString\uc5d0 \ub9de\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4: ''{0}'' "},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "\uc774 \ub9e4\uac1c\ubcc0\uc218 \uc774\ub984\uc5d0 \ub300\ud55c \uac12 \uc720\ud615\uc774 \uc608\uc0c1 \uac12 \uc720\ud615\uacfc \ud638\ud658\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "\ub370\uc774\ud130\ub97c \uae30\ub85d\ud560 \ucd9c\ub825 \ub300\uc0c1\uc774 \ub110(null)\uc785\ub2c8\ub2e4."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\uc9c0\uc6d0\ub418\uc9c0 \uc54a\ub294 \uc778\ucf54\ub529\uc774 \ubc1c\uacac\ub418\uc5c8\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "\ub178\ub4dc\ub97c \uc9c1\ub82c\ud654\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "CDATA \uc139\uc158\uc5d0 \uc885\ub8cc \ud45c\uc2dc \ubb38\uc790\uc778 ']]>'\uac00 \ud558\ub098 \uc774\uc0c1 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Well-Formedness \uac80\uc0ac\uae30\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uc791\uc131\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. Well-Formed \ub9e4\uac1c\ubcc0\uc218\uac00 true\ub85c \uc124\uc815\ub418\uc5c8\uc9c0\ub9cc Well-Formedness \uac80\uc0ac\ub97c \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "''{0}'' \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\uc124\uba85\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\ucc98\ub9ac \uba85\ub839\uc5b4 \ub370\uc774\ud130\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4 "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "CDATASection\uc758 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\ub178\ub4dc\uc758 \ubb38\uc790 \ub370\uc774\ud130 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "\uc774\ub984\uc774 ''{1}''\uc778 {0} \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4. "
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "\uc124\uba85 \ub0b4\uc5d0\uc11c\ub294 \"--\" \ubb38\uc790\uc5f4\uc774 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\"{0}\" \uc694\uc18c \uc720\ud615\uacfc \uc5f0\uad00\ub41c \"{1}\" \uc18d\uc131\uac12\uc5d0 ''<'' \ubb38\uc790\uac00 \ud3ec\ud568\ub418\uba74 \uc548\ub429\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\"&{0};\"\uc758 \uad6c\ubd84 \ubd84\uc11d\ub418\uc9c0 \uc54a\uc740 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\ub294 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\uc18d\uc131\uac12\uc5d0\ub294 \"&{0};\" \uc678\ubd80 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\uac00 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. "
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\"{0}\" \uc811\ub450\ubd80\ub97c \"{1}\" \uc774\ub984 \uacf5\uac04\uc5d0 \ubc14\uc778\ub4dc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\"{0}\" \uc694\uc18c\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\"{0}\" \uc18d\uc131\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc694\uc18c \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc18d\uc131 \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_pl.java b/src/org/apache/xml/serializer/utils/SerializerMessages_pl.java
index 3cdc99c..7d4c150 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_pl.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_pl.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Ostrze\u017cenie:  dekodowany ''{0}'' nie jest obs\u0142ugiwany przez \u015brodowisko wykonawcze Java." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "Parametr ''{0}'' nie zosta\u0142 rozpoznany."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "Parametr ''{0}'' zosta\u0142 rozpoznany, ale nie mo\u017cna ustawi\u0107 \u017c\u0105danej warto\u015bci."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "Wynikowy \u0142a\u0144cuch jest zbyt d\u0142ugi, aby si\u0119 zmie\u015bci\u0107 w obiekcie DOMString: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Typ warto\u015bci parametru o tej nazwie jest niezgodny z oczekiwanym typem warto\u015bci. "},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "Docelowe miejsce zapisu danych wyj\u015bciowych by\u0142o puste (null)."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Napotkano nieobs\u0142ugiwane kodowanie."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "Nie mo\u017cna przekszta\u0142ci\u0107 w\u0119z\u0142a do postaci szeregowej."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "Sekcja CDATA zawiera jeden lub kilka znacznik\u00f3w zako\u0144czenia ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Nie mo\u017cna utworzy\u0107 instancji obiektu sprawdzaj\u0105cego Well-Formedness.  Parametr well-formed ustawiono na warto\u015b\u0107 true, ale nie mo\u017cna by\u0142o dokona\u0107 sprawdzenia poprawno\u015bci konstrukcji."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "W\u0119ze\u0142 ''{0}'' zawiera niepoprawne znaki XML."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "W komentarzu znaleziono niepoprawny znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "W danych instrukcji przetwarzania znaleziono niepoprawny znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "W sekcji CDATA znaleziono niepoprawny znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "W tre\u015bci danych znakowych w\u0119z\u0142a znaleziono niepoprawny znak XML (Unicode: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "W {0} o nazwie ''{1}'' znaleziono niepoprawne znaki XML."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "Ci\u0105g znak\u00f3w \"--\" jest niedozwolony w komentarzu."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "Warto\u015b\u0107 atrybutu \"{1}\" zwi\u0105zanego z typem elementu \"{0}\" nie mo\u017ce zawiera\u0107 znaku ''<''."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "Odwo\u0142anie do encji nieprzetwarzanej \"&{0};\" jest niedozwolone."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "Odwo\u0142anie do zewn\u0119trznej encji \"&{0};\" jest niedozwolone w warto\u015bci atrybutu."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "Nie mo\u017cna zwi\u0105za\u0107 przedrostka \"{0}\" z przestrzeni\u0105 nazw \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "Nazwa lokalna elementu \"{0}\" jest pusta (null)."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "Nazwa lokalna atrybutu \"{0}\" jest pusta (null)."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "Tekst zast\u0119puj\u0105cy w\u0119z\u0142a encji \"{0}\" zawiera w\u0119ze\u0142 elementu \"{1}\" o niezwi\u0105zanym przedrostku \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "Tekst zast\u0119puj\u0105cy w\u0119z\u0142a encji \"{0}\" zawiera w\u0119ze\u0142 atrybutu \"{1}\" o niezwi\u0105zanym przedrostku \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java b/src/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java
index 55b506c..523bd3e 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Aviso:  A codifica\u00e7\u00e3o ''{0}'' n\u00e3o \u00e9 suportada pelo Java Runtime." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "O par\u00e2metro ''{0}'' n\u00e3o \u00e9 reconhecido."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "O par\u00e2metro ''{0}'' \u00e9 reconhecido, mas o valor pedido n\u00e3o pode ser definido. "},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "A cadeia resultante \u00e9 muito longa para caber em uma DOMString: ''{0}''. "},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "O tipo de valor para este nome de par\u00e2metro \u00e9 incompat\u00edvel com o tipo de valor esperado. "},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "O destino de sa\u00edda para os dados a serem gravados era nulo. "},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Uma codifica\u00e7\u00e3o n\u00e3o suportada foi encontrada. "},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "O n\u00f3 n\u00e3o p\u00f4de ser serializado."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "A Se\u00e7\u00e3o CDATA cont\u00e9m um ou mais marcadores de t\u00e9rmino ']]>'."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Uma inst\u00e2ncia do verificador Well-Formedness n\u00e3o p\u00f4de ser criada. O par\u00e2metro well-formed foi definido como true, mas a verifica\u00e7\u00e3o well-formedness n\u00e3o pode ser executada."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "O n\u00f3 ''{0}'' cont\u00e9m caracteres XML inv\u00e1lidos. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no coment\u00e1rio. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no processo instructiondata."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado nos conte\u00fados do CDATASection. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no conte\u00fado dos dados de caractere dos n\u00f3s. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "Um caractere inv\u00e1lido foi encontrado no {0} do n\u00f3 denominado ''{1}''."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "A cadeia \"--\" n\u00e3o \u00e9 permitida dentro dos coment\u00e1rios. "
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "O valor do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00e3o deve conter o caractere ''<''. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "A refer\u00eancia de entidade n\u00e3o analisada \"&{0};\" n\u00e3o \u00e9 permitida. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "A refer\u00eancia de entidade externa \"&{0};\" n\u00e3o \u00e9 permitida em um valor de atributo. "
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "O prefixo \"{0}\" n\u00e3o pode ser vinculado ao espa\u00e7o de nomes \"{1}\"."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "O nome local do elemento \"{0}\" \u00e9 nulo."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "O nome local do atributo \"{0}\" \u00e9 nulo."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de elemento \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de atributo \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ru.java b/src/org/apache/xml/serializer/utils/SerializerMessages_ru.java
index d8205d8..42c7760 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_ru.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_ru.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:  \u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 ''{0}'' \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Java." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ''{0}'' \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d. "},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ''{0}'' \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d, \u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c. "},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "\u0421\u0442\u0440\u043e\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 DOMString: ''{0}''. "},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "\u0422\u0438\u043f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0441 \u044d\u0442\u0438 \u0438\u043c\u0435\u043d\u0435\u043c \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. "},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. "},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430. "},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u0435\u043b. "},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "\u0420\u0430\u0437\u0434\u0435\u043b CDATA \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439 ']]>'. "},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c. "
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "\u0423\u0437\u0435\u043b ''{0}'' \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b XML. "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\u041f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 instructiondata \u0431\u044b\u043b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0}). "
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "\u0412 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c CDATASection \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\u0412 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0437\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0})."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b XML \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u044b \u0432 \u0443\u0437\u043b\u0435 {0} \u0441 \u0438\u043c\u0435\u043d\u0435\u043c ''{1}''. "
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "\u0421\u0442\u0440\u043e\u043a\u0430 \"--\" \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. "
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \"{1}\", \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u0442\u0438\u043f\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \"{0}\", \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b ''<''. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\u041d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \"&{0};\" \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430. "
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\u0412\u043d\u0435\u0448\u043d\u044f\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \"&{0};\" \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430. "
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\u041f\u0440\u0435\u0444\u0438\u043a\u0441 \"{0}\" \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435  \u0438\u043c\u0435\u043d \"{1}\". "
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \"{0}\" \u043f\u0443\u0441\u0442\u043e. "
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \"{0}\" \u043f\u0443\u0441\u0442\u043e.  "
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u0422\u0435\u043a\u0441\u0442 \u0437\u0430\u043c\u0435\u043d\u044b \u0434\u043b\u044f \u0443\u0437\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \"{0}\" \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0437\u0435\u043b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \"{1}\" \u0441 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \"{2}\". "
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u0422\u0435\u043a\u0441\u0442 \u0437\u0430\u043c\u0435\u043d\u044b \u0434\u043b\u044f \u0443\u0437\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \"{0}\" \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0437\u0435\u043b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \"{1}\" \u0441 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \"{2}\". "
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_sk.java b/src/org/apache/xml/serializer/utils/SerializerMessages_sk.java
index 532164b..fdabf07 100755
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_sk.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_sk.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,

                 "Varovanie:  Java runtime nepodporuje k\u00f3dovanie ''{0}''." },

 

+             {MsgKey.ER_FEATURE_NOT_FOUND,

+             "Parameter ''{0}'' nebol rozpoznan\u00fd."},

+

+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,

+             "Parameter ''{0}'' bol rozpoznan\u00fd, ale vy\u017eadovan\u00e1 hodnota sa ned\u00e1 nastavi\u0165."},

+

+             {MsgKey.ER_STRING_TOO_LONG,

+             "V\u00fdsledn\u00fd re\u0165azec je pr\u00edli\u0161 dlh\u00fd a nezmest\u00ed sa do DOMString: ''{0}''."},

+

+             {MsgKey.ER_TYPE_MISMATCH_ERR,

+             "Typ hodnoty pre tento n\u00e1zov parametra je nekompatibiln\u00fd s o\u010dak\u00e1van\u00fdm typom hodnoty."},

+

+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,

+             "Cie\u013e v\u00fdstupu pre zap\u00edsanie \u00fadajov bol null."},

+

+             {MsgKey.ER_UNSUPPORTED_ENCODING,

+             "Bolo zaznamenan\u00e9 nepodporovan\u00e9 k\u00f3dovanie."},

+

+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,

+             "Uzol nebolo mo\u017en\u00e9 serializova\u0165."},

+

+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,

+             "\u010cas\u0165 CDATA obsahuje jeden alebo viacer\u00e9 ozna\u010dova\u010de konca ']]>'."},

+

+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,

+                 "Nebolo mo\u017en\u00e9 vytvori\u0165 in\u0161tanciu kontrol\u00f3ra Well-Formedness.  Parameter well-formed bol nastaven\u00fd na hodnotu true, ale kontrola well-formedness sa ned\u00e1 vykona\u0165."

+             },

+

+             {MsgKey.ER_WF_INVALID_CHARACTER,

+                 "Uzol ''{0}'' obsahuje neplatn\u00e9 znaky XML."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,

+                 "V koment\u00e1ri bol n\u00e1jden\u00fd neplatn\u00fd znak XML (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,

+                 "Pri spracovan\u00ed d\u00e1t in\u0161trukci\u00ed sa na\u0161iel neplatn\u00fd znak XML (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,

+                 "V obsahu CDATASection sa na\u0161iel neplatn\u00fd znak XML (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,

+                 "V obsahu znakov\u00fdch d\u00e1t uzla sa na\u0161iel neplatn\u00fd znak XML (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                 "V uzle {0} s n\u00e1zvom ''{1}'' sa na\u0161iel neplatn\u00fd znak XML."

+             },

+

+             { MsgKey.ER_WF_DASH_IN_COMMENT,

+                 "Re\u0165azec \"--\" nie je povolen\u00fd v r\u00e1mci koment\u00e1rov."

+             },

+

+             {MsgKey.ER_WF_LT_IN_ATTVAL,

+                 "Hodnota atrib\u00fatu \"{1}\", ktor\u00e1 je priraden\u00e1 k prvku typu \"{0}\", nesmie obsahova\u0165 znak ''<''."

+             },

+

+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,

+                 "Neanalyzovan\u00fd odkaz na entitu \"&{0};\" nie je povolen\u00fd."

+             },

+

+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,

+                 "Odkaz na extern\u00fa entitu \"&{0};\" nie je povolen\u00fd v hodnote atrib\u00fatu."

+             },

+

+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,

+                 "Predpona \"{0}\" nem\u00f4\u017ee by\u0165 naviazan\u00e1 na n\u00e1zvov\u00fd priestor \"{1}\"."

+             },

+

+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,

+                 "Lok\u00e1lny n\u00e1zov prvku \"{0}\" je null."

+             },

+

+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,

+                 "Lok\u00e1lny n\u00e1zov atrib\u00fatu \"{0}\" je null."

+             },

+

+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,

+                 "N\u00e1hradn\u00fd text pre uzol entity \"{0}\" obsahuje uzol prvku \"{1}\" s nenaviazanou predponou \"{2}\"."

+             },

+

+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,

+                 "N\u00e1hradn\u00fd text uzla entity \"{0}\" obsahuje uzol atrib\u00fatu \"{1}\" s nenaviazanou predponou \"{2}\"."

+             },

 

         };

 

diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_sl.java b/src/org/apache/xml/serializer/utils/SerializerMessages_sl.java
index 799480e..fa40d4e 100755
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_sl.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_sl.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,

                 "Opozorilo:  Izvajalno okolje Java ne podpira kodiranja ''{0}''." },

 

+             {MsgKey.ER_FEATURE_NOT_FOUND,

+             "Parameter ''{0}'' ni prepoznan."},

+

+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,

+             "Parameter ''{0}'' je prepoznan, vendar pa zahtevane vrednosti ni mogo\u010de nastaviti."},

+

+             {MsgKey.ER_STRING_TOO_LONG,

+             "Nastali niz je predolg za DOMString: ''{0}''."},

+

+             {MsgKey.ER_TYPE_MISMATCH_ERR,

+             "Tip vrednosti za to ime parametra je nezdru\u017eljiv s pri\u010dakovanim tipom vrednosti."},

+

+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,

+             "Izhodno mesto za vpisovanje podatkov je bilo ni\u010d."},

+

+             {MsgKey.ER_UNSUPPORTED_ENCODING,

+             "Odkrito je nepodprto kodiranje."},

+

+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,

+             "Vozli\u0161\u010da ni mogo\u010de serializirati."},

+

+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,

+             "Odsek CDATA vsebuje enega ali ve\u010d ozna\u010devalnikov prekinitve ']]>'."},

+

+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,

+                 "Primerka preverjevalnika Well-Formedness ni bilo mogo\u010de ustvariti.  Parameter well-formed je bil nastavljen na True, ampak ni mogo\u010de preveriti well-formedness."

+             },

+

+             {MsgKey.ER_WF_INVALID_CHARACTER,

+                 "Vozli\u0161\u010de ''{0}'' vsebuje neveljavne znake XML."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,

+                 "V komentarju je bil najden neveljaven XML znak (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,

+                 "V podatkih navodila za obdelavo je bil najden neveljaven znak XML (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,

+                 "V vsebini odseka CDATASection je bil najden neveljaven znak XML (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,

+                 "V podatkovni vsebini znaka vozli\u0161\u010da je bil najden neveljaven znak XML (Unicode: 0x{0})."

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                 "V vozli\u0161\u010du {0} z imenom ''{1}'' je bil najden neveljaven znak XML."

+             },

+

+             { MsgKey.ER_WF_DASH_IN_COMMENT,

+                 "Niz \"--\" ni dovoljen v komentarjih."

+             },

+

+             {MsgKey.ER_WF_LT_IN_ATTVAL,

+                 "Vrednost atributa \"{1}\", ki je povezan s tipom elementa \"{0}\", ne sme vsebovati znaka ''<''."

+             },

+

+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,

+                 "Neraz\u010dlenjeni sklic entitete \"&{0};\" ni dovoljen."

+             },

+

+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,

+                 "Zunanji sklic entitete \"&{0};\" ni dovoljen v vrednosti atributa."

+             },

+

+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,

+                 "Predpona \"{0}\" ne more biti povezana z imenskim prostorom \"{1}\"."

+             },

+

+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,

+                 "Lokalno ime elementa \"{0}\" je ni\u010d."

+             },

+

+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,

+                 "Lokalno ime atributa \"{0}\" je ni\u010d."

+             },

+

+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,

+                 "Besedilo za zamenjavo za vozli\u0161\u010de entitete \"{0}\" vsebuje vozli\u0161\u010de elementa \"{1}\" z nevezano predpono \"{2}\"."

+             },

+

+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,

+                 "Besedilo za zamenjavo za vozli\u0161\u010de entitete \"{0}\" vsebuje vozli\u0161\u010de atributa \"{1}\" z nevezano predpono \"{2}\"."

+             },

 

         };

 

diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_tr.java b/src/org/apache/xml/serializer/utils/SerializerMessages_tr.java
index 68e1d74..acdd90f 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_tr.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_tr.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "Uyar\u0131: ''{0}'' kodlamas\u0131 Java Runtime taraf\u0131ndan desteklenmiyor." },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "''{0}'' de\u011fi\u015ftirgesi tan\u0131nm\u0131yor."},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "''{0}'' de\u011fi\u015ftirgesi tan\u0131n\u0131yor, ancak istenen de\u011fer tan\u0131mlanam\u0131yor."},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "Sonu\u00e7 dizgisi DOMString i\u00e7in \u00e7ok uzun: ''{0}''."},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "Bu de\u011fi\u015ftirge ad\u0131na ili\u015fkin de\u011fer tipi, beklenen de\u011fer tipiyle uyumlu de\u011fil."},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "Yaz\u0131lacak verilerin \u00e7\u0131k\u0131\u015f hedefi bo\u015f de\u011ferli."},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "Desteklenmeyen bir kodlama saptand\u0131."},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "D\u00fc\u011f\u00fcm diziselle\u015ftirilemedi."},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "CDATA k\u0131sm\u0131nda bir ya da daha \u00e7ok ']]>' sonland\u0131rma imleyicisi var."},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "Well-Formedness denet\u015feyicisinin somut \u00f6rne\u011fi yarat\u0131lamad\u0131.  well-formed de\u011fi\u015ftirgesi true de\u011ferine ayarland\u0131, ancak do\u011fru bi\u00e7im denetimi ger\u00e7ekle\u015ftirilemiyor."
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "''{0}'' d\u00fc\u011f\u00fcm\u00fc ge\u00e7ersiz XML karakterleri i\u00e7eriyor."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "A\u00e7\u0131klamada ge\u00e7ersiz bir XML karakteri (Unicode: 0x{0}) saptand\u0131."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\u0130\u015fleme y\u00f6nergesi verilerinde ge\u00e7ersiz bir XML karakteri (Unicode: 0x{0}) saptand\u0131."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "CDATASection i\u00e7eri\u011finde ge\u00e7ersiz bir XML karakteri (Unicode: 0x{0}) saptand\u0131."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "D\u00fc\u011f\u00fcm\u00fcn karakter verileri i\u00e7eri\u011finde ge\u00e7ersiz bir XML karakteri (Unicode: 0x{0}) saptand\u0131."
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "''{1}'' adl\u0131 {0} d\u00fc\u011f\u00fcm\u00fcnde ge\u00e7ersiz XML karakteri saptand\u0131."
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "A\u00e7\u0131klamalar i\u00e7inde \"--\" dizgisine izin verilmez."
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\"{0}\" \u00f6\u011fe tipiyle ili\u015fkilendirilen \"{1}\" \u00f6zniteli\u011finin de\u011feri ''<'' karakteri i\u00e7ermemelidir."
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\"&{0};\" ayr\u0131\u015ft\u0131r\u0131lmam\u0131\u015f varl\u0131k ba\u015fvurusuna izin verilmez."
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\u00d6znitelik de\u011ferinde \"&{0};\" d\u0131\u015f varl\u0131k ba\u015fvurusuna izin verilmez."
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\"{0}\" \u00f6neki \"{1}\" ad alan\u0131na ba\u011flanam\u0131yor."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\"{0}\" \u00f6\u011fesinin yerel ad\u0131 bo\u015f de\u011ferli."
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\"{0}\" \u00f6zniteli\u011finin yerel ad\u0131 bo\u015f de\u011ferli."
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\"{0}\" varl\u0131k d\u00fc\u011f\u00fcm\u00fcn\u00fcn yerine koyma metninde, ba\u011flanmam\u0131\u015f \"{2}\" \u00f6neki bulunan bir \u00f6\u011fe d\u00fc\u011f\u00fcm\u00fc (\"{1}\") var."
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\"{0}\" varl\u0131k d\u00fc\u011f\u00fcm\u00fcn\u00fcn yerine koyma metninde, ba\u011flanmam\u0131\u015f \"{2}\" \u00f6neki bulunan bir \u00f6znitelik d\u00fc\u011f\u00fcm\u00fc (\"{1}\") var."
+             },
 
         };
 
diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_zh.java b/src/org/apache/xml/serializer/utils/SerializerMessages_zh.java
index 6288805..dbb230d 100755
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_zh.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_zh.java
@@ -196,6 +196,93 @@
             {   MsgKey.ER_FACTORY_PROPERTY_MISSING,

                 "\u4f20\u9012\u7ed9 SerializerFactory \u7684 Properties \u5bf9\u8c61\u4e0d\u5177\u6709\u5c5e\u6027\u201c{0}\u201d\u3002" },

 

+             {MsgKey.ER_FEATURE_NOT_FOUND,

+             "\u672a\u8bc6\u522b\u51fa\u53c2\u6570\u201c{0}\u201d\u3002"},

+

+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,

+             "\u5df2\u8bc6\u522b\u51fa\u53c2\u6570\u201c{0}\u201d\uff0c\u4f46\u65e0\u6cd5\u8bbe\u7f6e\u8bf7\u6c42\u7684\u503c\u3002"},

+

+             {MsgKey.ER_STRING_TOO_LONG,

+             "\u4ea7\u751f\u7684\u5b57\u7b26\u4e32\u8fc7\u957f\u4e0d\u80fd\u88c5\u5165 DOMString\uff1a\u201c{0}\u201d\u3002"},

+

+             {MsgKey.ER_TYPE_MISMATCH_ERR,

+             "\u6b64\u53c2\u6570\u540d\u79f0\u7684\u503c\u7c7b\u578b\u4e0e\u671f\u671b\u7684\u503c\u7c7b\u578b\u4e0d\u517c\u5bb9\u3002"},

+

+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,

+             "\u5c06\u8981\u5199\u5165\u6570\u636e\u7684\u8f93\u51fa\u76ee\u6807\u4e3a\u7a7a\u3002"},

+

+             {MsgKey.ER_UNSUPPORTED_ENCODING,

+             "\u9047\u5230\u4e0d\u53d7\u652f\u6301\u7684\u7f16\u7801\u3002"},

+

+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,

+             "\u65e0\u6cd5\u5c06\u8282\u70b9\u5e8f\u5217\u5316\u3002 "},

+

+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,

+             "CDATA \u90e8\u5206\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u7ec8\u6b62\u6807\u8bb0\u201c]]>\u201d\u3002"},

+

+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,

+                 "\u65e0\u6cd5\u521b\u5efa\u683c\u5f0f\u6b63\u786e\u6027\u68c0\u67e5\u5668\u7684\u5b9e\u4f8b\u3002\u201c\u683c\u5f0f\u6b63\u786e\u201d\u53c2\u6570\u5df2\u8bbe\u7f6e\u4e3a true\uff0c\u4f46\u65e0\u6cd5\u6267\u884c\u683c\u5f0f\u6b63\u786e\u6027\u68c0\u67e5\u3002"

+             },

+

+             {MsgKey.ER_WF_INVALID_CHARACTER,

+                 "\u8282\u70b9\u201c{0}\u201d\u5305\u542b\u65e0\u6548\u7684 XML \u5b57\u7b26\u3002"

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,

+                 "\u5728\u6ce8\u91ca\u4e2d\u627e\u5230\u65e0\u6548\u7684 XML \u5b57\u7b26 (Unicode: 0x''{0})''\u3002"

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,

+                 "\u5728\u5904\u7406\u6307\u4ee4\u6570\u636e\u4e2d\u627e\u5230\u65e0\u6548\u7684 XML \u5b57\u7b26 (Unicode: 0x''{0})''\u3002"

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,

+                 "\u5728 CDATA \u90e8\u5206\u7684\u5185\u5bb9\u4e2d\u627e\u5230\u65e0\u6548\u7684 XML \u5b57\u7b26 (Unicode: 0x''{0})''\u3002"

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,

+                 "\u5728\u8282\u70b9\u7684\u5b57\u7b26\u6570\u636e\u5185\u5bb9\u4e2d\u627e\u5230\u65e0\u6548\u7684 XML \u5b57\u7b26 (Unicode: 0x''{0})''\u3002"

+             },

+

+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,

+                 "\u540d\u79f0\u4e3a\u201c{1})\u201d\u7684\u201c{0})\u201d\u4e2d\u627e\u5230\u65e0\u6548\u7684 XML \u5b57\u7b26\u3002"

+             },

+

+             { MsgKey.ER_WF_DASH_IN_COMMENT,

+                 "\u6ce8\u91ca\u4e2d\u4e0d\u5141\u8bb8\u6709\u5b57\u7b26\u4e32\u201c--\u201d\u3002"

+             },

+

+             {MsgKey.ER_WF_LT_IN_ATTVAL,

+                 "\u4e0e\u5143\u7d20\u7c7b\u578b\u201c{0}\u201d\u5173\u8054\u7684\u5c5e\u6027\u201c{1}\u201d\u7684\u503c\u4e0d\u5f97\u5305\u542b\u201c<\u201d\u5b57\u7b26\u3002"

+             },

+

+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,

+                 "\u4e0d\u5141\u8bb8\u6709\u672a\u89e3\u6790\u7684\u5b9e\u4f53\u5f15\u7528\u201c&{0};\u201d\u3002"

+             },

+

+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,

+                 "\u5c5e\u6027\u503c\u4e2d\u4e0d\u5141\u8bb8\u6709\u5916\u90e8\u5b9e\u4f53\u5f15\u7528\u201c&{0};\u201d\u3002"

+             },

+

+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,

+                 "\u524d\u7f00\u201c{0}\u201d\u4e0d\u80fd\u7ed1\u5b9a\u5230\u540d\u79f0\u7a7a\u95f4\u201c{1}\u201d\u3002"

+             },

+

+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,

+                 "\u5143\u7d20\u201c{0}\u201d\u7684\u5c40\u90e8\u540d\u4e3a\u7a7a\u3002"

+             },

+

+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,

+                 "\u5c5e\u6027\u201c{0}\u201d\u7684\u5c40\u90e8\u540d\u4e3a\u7a7a\u3002"

+             },

+

+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,

+                 "\u5b9e\u4f53\u8282\u70b9\u201c{0}\u201d\u7684\u66ff\u4ee3\u6587\u672c\u4e2d\u5305\u542b\u5143\u7d20\u8282\u70b9\u201c{1}\u201d\uff0c\u8be5\u8282\u70b9\u5177\u6709\u672a\u7ed1\u5b9a\u7684\u524d\u7f00\u201c{2}\u201d\u3002"

+             },

+

+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,

+                 "\u5b9e\u4f53\u8282\u70b9\u201c{0}\u201d\u7684\u66ff\u4ee3\u6587\u672c\u4e2d\u5305\u542b\u5c5e\u6027\u8282\u70b9\u201c{1}\u201d\uff0c\u8be5\u8282\u70b9\u5177\u6709\u672a\u7ed1\u5b9a\u7684\u524d\u7f00\u201c{2}\u201d\u3002"

+             },

 

         };

 

diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java b/src/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java
index 74f1b1f..f1f3857 100644
--- a/src/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java
+++ b/src/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java
@@ -198,6 +198,93 @@
             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                 "\u8b66\u544a\uff1aJava \u57f7\u884c\u6642\u671f\u4e0d\u652f\u63f4\u7de8\u78bc ''{0}''\u3002" },
 
+             {MsgKey.ER_FEATURE_NOT_FOUND,
+             "\u7121\u6cd5\u8fa8\u8b58\u53c3\u6578 ''{0}''\u3002"},
+
+             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
+             "\u53ef\u8fa8\u8b58 ''{0}'' \u53c3\u6578\uff0c\u4f46\u6240\u8981\u6c42\u7684\u503c\u7121\u6cd5\u8a2d\u5b9a\u3002"},
+
+             {MsgKey.ER_STRING_TOO_LONG,
+             "\u7d50\u679c\u5b57\u4e32\u904e\u9577\uff0c\u7121\u6cd5\u7f6e\u5165 DOMString: ''{0}'' \u4e2d\u3002"},
+
+             {MsgKey.ER_TYPE_MISMATCH_ERR,
+             "\u9019\u500b\u53c3\u6578\u540d\u7a31\u7684\u503c\u985e\u578b\u8207\u671f\u671b\u503c\u985e\u578b\u4e0d\u76f8\u5bb9\u3002"},
+
+             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
+             "\u8cc7\u6599\u8981\u5beb\u5165\u7684\u8f38\u51fa\u76ee\u7684\u5730\u70ba\u7a7a\u503c\u3002"},
+
+             {MsgKey.ER_UNSUPPORTED_ENCODING,
+             "\u767c\u73fe\u4e0d\u652f\u63f4\u7684\u7de8\u78bc\u3002"},
+
+             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
+             "\u7bc0\u9ede\u7121\u6cd5\u5e8f\u5217\u5316\u3002"},
+
+             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
+             "CDATA \u5340\u6bb5\u5305\u542b\u4e00\u6216\u591a\u500b\u7d42\u6b62\u6a19\u8a18 ']]>'\u3002"},
+
+             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
+                 "\u7121\u6cd5\u5efa\u7acb\u300c\u5f62\u5f0f\u5b8c\u6574\u300d\u6aa2\u67e5\u7a0b\u5f0f\u7684\u5be6\u4f8b\u3002Well-formed \u53c3\u6578\u96d6\u8a2d\u70ba true\uff0c\u4f46\u7121\u6cd5\u57f7\u884c\u5f62\u5f0f\u5b8c\u6574\u6aa2\u67e5\u3002"
+             },
+
+             {MsgKey.ER_WF_INVALID_CHARACTER,
+                 "\u7bc0\u9ede ''{0}'' \u5305\u542b\u7121\u6548\u7684 XML \u5b57\u5143\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
+                 "\u5728\u8a3b\u89e3\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
+                 "\u5728\u8655\u7406\u7a0b\u5e8f instructiondata \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
+                 "\u5728 CDATASection \u7684\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
+                 "\u5728\u7bc0\u9ede\u7684\u5b57\u5143\u8cc7\u6599\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002"
+             },
+
+             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
+                 "\u5728\u540d\u70ba ''{1}'' \u7684 ''{0}'' \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143\u3002"
+             },
+
+             { MsgKey.ER_WF_DASH_IN_COMMENT,
+                 "\u8a3b\u89e3\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5b57\u4e32 \"--\"\u3002"
+             },
+
+             {MsgKey.ER_WF_LT_IN_ATTVAL,
+                 "\u8207\u5143\u7d20\u985e\u578b \"{0}\" \u76f8\u95dc\u806f\u7684\u5c6c\u6027 \"{1}\" \u503c\u4e0d\u53ef\u5305\u542b ''<'' \u5b57\u5143\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
+                 "\u4e0d\u5141\u8a31\u4f7f\u7528\u672a\u5256\u6790\u7684\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002"
+             },
+
+             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
+                 "\u5c6c\u6027\u503c\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5916\u90e8\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002"
+             },
+
+             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
+                 "\u5b57\u9996 \"{0}\" \u7121\u6cd5\u9023\u7d50\u5230\u540d\u7a31\u7a7a\u9593 \"{1}\"\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
+                 "\u5143\u7d20 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002"
+             },
+
+             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
+                 "\u5c6c\u6027 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002"
+             },
+
+             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5143\u7d20\u7bc0\u9ede \"{1}\"\u3002"
+             },
+
+             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
+                 "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5c6c\u6027\u7bc0\u9ede \"{1}\"\u3002"
+             },
 
         };