diff --git a/src/main/java/com/ctc/wstx/compat/QNameCreator.java b/src/main/java/com/ctc/wstx/compat/QNameCreator.java index f0bcf964..a94fa15b 100644 --- a/src/main/java/com/ctc/wstx/compat/QNameCreator.java +++ b/src/main/java/com/ctc/wstx/compat/QNameCreator.java @@ -48,7 +48,7 @@ public final class QNameCreator public static QName create(String uri, String localName, String prefix) { - if (_helper == null) { // can't use 3-arg constructor; but 2-arg will be there + if (_helper == null || prefix == null) { // can't use 3-arg constructor; but 2-arg will be there return new QName(uri, localName); } return _helper.create(uri, localName, prefix); diff --git a/src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java b/src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java index bdf6c715..fad4063b 100644 --- a/src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java +++ b/src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java @@ -246,6 +246,9 @@ public String getNamespaceURI() { } public QName getName() { + if (mPrefix == null) { + return new QName(mURI, mLocalName); + } return QNameCreator.create(mURI, mLocalName, mPrefix); }