Skip to content

Commit 453cb9a

Browse files
petergenericrolfl
authored andcommitted
Make sure Attrs generated for "xmlns" attributes specify their namespace as http://www.w3.org/2000/xmlns/
1 parent 2a51fe5 commit 453cb9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/java/org/jdom2/output/support/AbstractDOMOutputProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
6666
import org.jdom2.Document;
6767
import org.jdom2.Element;
6868
import org.jdom2.EntityRef;
69+
import org.jdom2.JDOMConstants;
6970
import org.jdom2.Namespace;
7071
import org.jdom2.ProcessingInstruction;
7172
import org.jdom2.Text;
@@ -462,7 +463,7 @@ protected org.w3c.dom.Element printElement(final FormatStack fstack,
462463
if (ns == Namespace.XML_NAMESPACE) {
463464
continue;
464465
}
465-
ret.setAttribute(getXmlnsTagFor(ns), ns.getURI());
466+
ret.setAttributeNS(JDOMConstants.NS_URI_XMLNS, getXmlnsTagFor(ns), ns.getURI());
466467
}
467468

468469
if (element.hasAttributes()) {

0 commit comments

Comments
 (0)