diff --git a/exist-core/src/main/java/org/exist/dom/QName.java b/exist-core/src/main/java/org/exist/dom/QName.java index 352360155d4..5f18b49f930 100644 --- a/exist-core/src/main/java/org/exist/dom/QName.java +++ b/exist-core/src/main/java/org/exist/dom/QName.java @@ -41,6 +41,8 @@ public class QName implements Comparable { public static final String WILDCARD = "*"; private static final char COLON = ':'; + private static final char LEFT_BRACE = '{'; + private static final char RIGHT_BRACE = '}'; public static final QName EMPTY_QNAME = new QName("", XMLConstants.NULL_NS_URI); public static final QName DOCUMENT_QNAME = EMPTY_QNAME; @@ -125,8 +127,10 @@ public byte getNameType() { } public String getStringValue() { - if (prefix != null && prefix.length() > 0) { + if (prefix != null && !prefix.isEmpty()) { return prefix + COLON + localPart; + } else if (namespaceURI != null && !XMLConstants.NULL_NS_URI.equals(namespaceURI)) { + return LEFT_BRACE + namespaceURI + RIGHT_BRACE + localPart; } return localPart; }