Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6388415

XmlStreamWriterImpl.writeNamespace is not implemented correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • beta
    • xml
    • b78
    • generic
    • generic

      The writeNamespace method is defined as follows:

        /**
         * Writes a namespace to the output stream
         * If the prefix argument to this method is the empty string,
         * "xmlns", or null this method will delegate to writeDefaultNamespace
         *
         * @param prefix the prefix to bind this namespace to
         * @param namespaceURI the uri to bind the prefix to
         * @throws IllegalStateException if the current state does not allow Namespace writing
         * @throws XMLStreamException
         */
        public void writeNamespace(String prefix, String namespaceURI)
          throws XMLStreamException;


      But the code isn't checking for prefix=="xmlns", and hence when it happens it produces malformed documents.

            jsuttorsunw Jeff Suttor (Inactive)
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: