From 35c687d26618e5214167c10f7f01ed6b699f53cf Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sun, 4 Feb 2024 21:20:28 -0800 Subject: [PATCH 1/2] Minor improvement to SimpleOutputElement.getName() --- src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java | 3 +++ 1 file changed, 3 insertions(+) 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); } From 49a29244d566506fef58b947ef0edac0dabaa578 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sun, 4 Feb 2024 21:22:09 -0800 Subject: [PATCH 2/2] ... --- src/main/java/com/ctc/wstx/compat/QNameCreator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);